This file lists all the Phusion Passenger C++ library files and contains code for calculating how to compile and how to link them into executables. It's used by the build system (build/*.rb) and lib/phusion_passenger/standalone/runtime_installer.rb.
# File lib/phusion_passenger/common_library.rb, line 34 def initialize(&block) @all_components = {} @all_ordered_components = [] @selected_components = {} @namespace = "common" if defined?(COMMON_OUTPUT_DIR) @output_dir = COMMON_OUTPUT_DIR + "libpassenger_common" else @output_dir = "." end instance_eval(&block) if block end
# File lib/phusion_passenger/common_library.rb, line 54 def define_component(object_name, options) options[:deps] ||= [] @all_components[object_name] = options @all_ordered_components << object_name @selected_components[object_name] = options end
# File lib/phusion_passenger/common_library.rb, line 103 def define_tasks(extra_compiler_flags = nil) flags = "-Iext -Iext/common #{LIBEV_CFLAGS} #{extra_compiler_flags} " flags << "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}" flags.strip! group_all_components_by_category.each_pair do |category, object_names| define_category_tasks(category, object_names, flags) end task("#{@namespace}:clean") do sh "rm -rf #{@output_dir}" end return self end
# File lib/phusion_passenger/common_library.rb, line 65 def exclude(*selector) return dup.send(:exclude!, *selector) end
# File lib/phusion_passenger/common_library.rb, line 47 def initialize_copy(other) [:all_components, :all_ordered_components, :selected_components, :namespace, :output_dir].each do |name| var_name = "@#{name}" instance_variable_set(var_name, other.instance_variable_get(var_name).dup) end end
# File lib/phusion_passenger/common_library.rb, line 77 def link_objects result = [] selected_categories.each do |category| if category_complete?(category) && false # Feature disabled: we don't want to waste too much space when # packaging the runtime ('passenger package-runtime') so we # never generate static libraries. if aggregate_sources? result << "#{@output_dir}/#{category}.o" else result << "#{@output_dir}/#{category}.a" end else object_names = selected_objects_beloging_to_category(category) result.concat(object_filenames_for(object_names)) end end return result end
# File lib/phusion_passenger/common_library.rb, line 99 def link_objects_as_string return link_objects.join(' ') end
# File lib/phusion_passenger/common_library.rb, line 61 def only(*selector) return dup.send(:only!, *selector) end
Generated with the Darkfish Rdoc Generator 2.