def register(): if not type.registered('LIB'): type.register('LIB') type.register_type('STATIC_LIB', ['lib', 'a'], 'LIB', ['NT', 'CYGWIN']) type.register_type('STATIC_LIB', ['a'], 'LIB') type.register_type('IMPORT_LIB', [], 'STATIC_LIB') type.set_generated_target_suffix('IMPORT_LIB', [], 'lib') type.register_type('SHARED_LIB', ['dll'], 'LIB', ['NT', 'CYGWIN']) type.register_type('SHARED_LIB', ['so'], 'LIB') type.register_type('SEARCHED_LIB', [], 'LIB')
def register (): if not type.registered ('LIB'): type.register ('LIB') type.register_type ('STATIC_LIB', ['lib', 'a'], 'LIB', ['NT', 'CYGWIN']) type.register_type ('STATIC_LIB', ['a'], 'LIB') type.register_type ('IMPORT_LIB', [], 'STATIC_LIB') type.set_generated_target_suffix ('IMPORT_LIB', [], 'lib') type.register_type ('SHARED_LIB', ['dll'], 'LIB', ['NT', 'CYGWIN']) type.register_type ('SHARED_LIB', ['so'], 'LIB') type.register_type ('SEARCHED_LIB', [], 'LIB')
# On cygwin i.e. <target-os>cygwin # libxxx.a static library # cygxxx.dll DLL # libxxx.dll.a import library # type.register('LIB') # FIXME: should not register both extensions on both platforms. type.register('STATIC_LIB', ['a', 'lib'], 'LIB') # The 'lib' prefix is used everywhere type.set_generated_target_prefix('STATIC_LIB', [], 'lib') # Use '.lib' suffix for windows type.set_generated_target_suffix('STATIC_LIB', ['<target-os>windows'], 'lib') # Except with gcc. type.set_generated_target_suffix('STATIC_LIB', ['<toolset>gcc', '<target-os>windows'], 'a') # Use xxx.lib for import libs type.register('IMPORT_LIB', [], 'STATIC_LIB') type.set_generated_target_prefix('IMPORT_LIB', [], '') type.set_generated_target_suffix('IMPORT_LIB', [], 'lib') # Except with gcc (mingw or cygwin), where use libxxx.dll.a type.set_generated_target_prefix('IMPORT_LIB', ['<toolset>gcc'], 'lib') type.set_generated_target_suffix('IMPORT_LIB', ['<toolset>gcc'], 'dll.a') type.register('SHARED_LIB', ['so', 'dll', 'dylib'], 'LIB')
# xxx.dll DLL # xxx.lib import library # # On windows (cygwin) i.e. <target-os>cygwin # libxxx.a static library # xxx.dll DLL # libxxx.dll.a import library # # Note: user can always override by using the <tag>@rule # This settings have been choosen, so that mingw # is in line with msvc naming conventions. For # cygwin the cygwin naming convention has been choosen. # Make the "o" suffix used for gcc toolset on all # platforms type.set_generated_target_suffix('OBJ', ['<toolset>gcc'], 'o') type.set_generated_target_suffix('STATIC_LIB', ['<toolset>gcc', '<target-os>cygwin'], 'a') type.set_generated_target_suffix('IMPORT_LIB', ['<toolset>gcc', '<target-os>cygwin'], 'dll.a') type.set_generated_target_prefix('IMPORT_LIB', ['<toolset>gcc', '<target-os>cygwin'], 'lib') __machine_match = re.compile('^([^ ]+)') __version_match = re.compile('^([0-9.]+)') def init(version = None, command = None, options = None): """ Initializes the gcc toolset for the given version. If necessary, command may be used to specify where the compiler is located. The parameter 'options' is a space-delimited list of options, each one specified as <option-name>option-value. Valid option names are: cxxflags, linkflags and linker-type. Accepted linker-type values are gnu, darwin, osf, hpux or sun
# xxx.dll DLL # xxx.lib import library # # On windows (cygwin) i.e. <target-os>cygwin # libxxx.a static library # xxx.dll DLL # libxxx.dll.a import library # # Note: user can always override by using the <tag>@rule # This settings have been choosen, so that mingw # is in line with msvc naming conventions. For # cygwin the cygwin naming convention has been choosen. # Make the "o" suffix used for gcc toolset on all # platforms type.set_generated_target_suffix('OBJ', ['<toolset>gcc'], 'o') type.set_generated_target_suffix('STATIC_LIB', ['<toolset>gcc', '<target-os>cygwin'], 'a') type.set_generated_target_suffix('IMPORT_LIB', ['<toolset>gcc', '<target-os>cygwin'], 'dll.a') type.set_generated_target_prefix('IMPORT_LIB', ['<toolset>gcc', '<target-os>cygwin'], 'lib') __machine_match = re.compile('^([^ ]+)') __version_match = re.compile('^([0-9.]+)') def init(version=None, command=None, options=None): """
toolset.inherit_flags ('darwin', 'gcc') toolset.inherit_rules ('darwin', 'gcc') def init (version = None, command = None, options = None): options = to_seq (options) condition = common.check_init_parameters ('darwin', None, ('version', version)) command = common.get_invocation_command ('darwin', 'g++', command) common.handle_options ('darwin', condition, command, options) gcc.init_link_flags ('darwin', 'darwin', condition) # Darwin has a different shared library suffix type.set_generated_target_suffix ('SHARED_LIB', ['<toolset>darwin'], 'dylib') # we need to be able to tell the type of .dylib files type.register_suffixes ('dylib', 'SHARED_LIB') feature.feature ('framework', [], ['free']) toolset.flags ('darwin.compile', 'OPTIONS', '<link>shared', ['-dynamic']) toolset.flags ('darwin.compile', 'OPTIONS', None, ['-Wno-long-double', '-no-cpp-precomp']) toolset.flags ('darwin.compile.c++', 'OPTIONS', None, ['-fcoalesce-templates']) toolset.flags ('darwin.link', 'FRAMEWORK', '<framework>') # This is flag is useful for debugging the link step # uncomment to see what libtool is doing under the hood # toolset.flags ('darwin.link.dll', 'OPTIONS', None, '[-Wl,-v'])
def init(version=None, command=None, options=None): options = to_seq(options) condition = common.check_init_parameters('darwin', None, ('version', version)) command = common.get_invocation_command('darwin', 'g++', command) common.handle_options('darwin', condition, command, options) gcc.init_link_flags('darwin', 'darwin', condition) # Darwin has a different shared library suffix type.set_generated_target_suffix('SHARED_LIB', ['<toolset>darwin'], 'dylib') # we need to be able to tell the type of .dylib files type.register_suffixes('dylib', 'SHARED_LIB') feature.feature('framework', [], ['free']) toolset.flags('darwin.compile', 'OPTIONS', '<link>shared', ['-dynamic']) toolset.flags('darwin.compile', 'OPTIONS', None, ['-Wno-long-double', '-no-cpp-precomp']) toolset.flags('darwin.compile.c++', 'OPTIONS', None, ['-fcoalesce-templates']) toolset.flags('darwin.link', 'FRAMEWORK', '<framework>') # This is flag is useful for debugging the link step # uncomment to see what libtool is doing under the hood