### Home Classes Methods

### In Files

- lib/phusion_passenger/common_library.rb

### Parent

Object

### Methods

- ::new
- #define_component
- #define_tasks
- #exclude
- #initialize_copy
- #link_objects
- #link_objects_as_string
- #only
- #set_namespace
- #set_output_dir

### Included Modules

- Rake::DSL

### Class/Module Index

Quicksearch

- PhusionPassenger
- PhusionPassenger::AbstractInstaller
- PhusionPassenger::AbstractInstaller::Abort
- PhusionPassenger::AbstractInstaller::CommandError
- PhusionPassenger::AdminTools
- PhusionPassenger::AdminTools::MemoryStats
- PhusionPassenger::AdminTools::MemoryStats::Process
- PhusionPassenger::AdminTools::ServerInstance
- PhusionPassenger::AdminTools::ServerInstance::CorruptedDirectoryError
- PhusionPassenger::AdminTools::ServerInstance::GenerationsAbsentError
- PhusionPassenger::AdminTools::ServerInstance::Group
- PhusionPassenger::AdminTools::ServerInstance::Process
- PhusionPassenger::AdminTools::ServerInstance::RoleDeniedError
- PhusionPassenger::AdminTools::ServerInstance::StaleDirectoryError
- PhusionPassenger::AdminTools::ServerInstance::Stats
- PhusionPassenger::AdminTools::ServerInstance::UnsupportedGenerationStructureVersionError
- PhusionPassenger::AnalyticsLogger
- PhusionPassenger::AnalyticsLogger::Connection
- PhusionPassenger::AnalyticsLogger::Lock
- PhusionPassenger::AnalyticsLogger::Log
- PhusionPassenger::ClassicRails
- PhusionPassenger::ClassicRails::CGIFixed
- PhusionPassenger::ClassicRails::ThreadHandlerExtension
- PhusionPassenger::ConsoleTextTemplate
- PhusionPassenger::DebugLogging
- PhusionPassenger::LoaderSharedHelpers
- PhusionPassenger::MessageChannel
- PhusionPassenger::MessageChannel::InvalidHashError
- PhusionPassenger::MessageClient
- PhusionPassenger::NativeSupportLoader
- PhusionPassenger::Packaging
- PhusionPassenger::PlatformInfo
- PhusionPassenger::PlatformInfo::ApacheDetector
- PhusionPassenger::PlatformInfo::ApacheDetector::Result
- PhusionPassenger::PlatformInfo::Depcheck
- PhusionPassenger::PlatformInfo::Depcheck::ConsoleRunner
- PhusionPassenger::PlatformInfo::Depcheck::Dependency
- PhusionPassenger::PlatformInfo::RuntimeError
- PhusionPassenger::Plugin
- PhusionPassenger::PreloaderSharedHelpers
- PhusionPassenger::Rack
- PhusionPassenger::Rack::OutOfBandGc
- PhusionPassenger::Rack::ThreadHandlerExtension
- PhusionPassenger::Rails3Extensions
- PhusionPassenger::Rails3Extensions::AnalyticsLogging
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ACExtension
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ASBenchmarkableExtension
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ExceptionLogger
- PhusionPassenger::RequestHandler
- PhusionPassenger::RequestHandler::ThreadHandler
- PhusionPassenger::RequestHandler::ThreadHandler::Interrupted
- PhusionPassenger::SharedConstants
- PhusionPassenger::Standalone
- PhusionPassenger::Standalone::AppFinder
- PhusionPassenger::Standalone::Command
- PhusionPassenger::Standalone::ConfigFile
- PhusionPassenger::Standalone::ConfigFile::DisallowedContextError
- PhusionPassenger::Standalone::HelpCommand
- PhusionPassenger::Standalone::Main
- PhusionPassenger::Standalone::PackageRuntimeCommand
- PhusionPassenger::Standalone::RuntimeInstaller
- PhusionPassenger::Standalone::RuntimeLocator
- PhusionPassenger::Standalone::StartCommand
- PhusionPassenger::Standalone::StatusCommand
- PhusionPassenger::Standalone::StopCommand
- PhusionPassenger::Standalone::Utils
- PhusionPassenger::Standalone::VersionCommand
- PhusionPassenger::Utils
- PhusionPassenger::Utils::AnsiColors
- PhusionPassenger::Utils::FileSystemWatcher
- PhusionPassenger::Utils::FileSystemWatcher::DirInfo
- PhusionPassenger::Utils::FileSystemWatcher::FileInfo
- PhusionPassenger::Utils::GeneratorTest
- PhusionPassenger::Utils::HostsFileParser
- PhusionPassenger::Utils::JSON
- PhusionPassenger::Utils::JSON::Generator
- PhusionPassenger::Utils::ParserTest
- PhusionPassenger::Utils::TeeInput
- PhusionPassenger::Utils::TmpIO
- PhusionPassenger::Utils::UnseekableSocket
- CommonLibraryBuilder
- Exception
- GC
- IO
- Object
- Signal

No matching classes.

# CommonLibraryBuilder

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.

### Attributes

all_components[R]
output_dir[R]
selected_components[R]

### Public Class Methods

new(&block) click to toggle source

    # 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

### Public Instance Methods

define_component(object_name, options) click to toggle source

    # 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

define_tasks(extra_compiler_flags = nil) click to toggle source

    # 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

exclude(*selector) click to toggle source

    # File lib/phusion_passenger/common_library.rb, line 65
    def exclude(*selector)
            return dup.send(:exclude!, *selector)
    end

initialize_copy(other) click to toggle source

    # 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

link_objects() click to toggle source

    # 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

link_objects_as_string() click to toggle source

    # File lib/phusion_passenger/common_library.rb, line 99
    def link_objects_as_string
            return link_objects.join(' ')
    end

only(*selector) click to toggle source

    # File lib/phusion_passenger/common_library.rb, line 61
    def only(*selector)
            return dup.send(:only!, *selector)
    end

set_namespace(namespace) click to toggle source

    # File lib/phusion_passenger/common_library.rb, line 69
    def set_namespace(namespace)
            return dup.send(:set_namespace!, namespace)
    end

set_output_dir(dir) click to toggle source

    # File lib/phusion_passenger/common_library.rb, line 73
    def set_output_dir(dir)
            return dup.send(:set_output_dir!, dir)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.