parameters: (toolset, linker, condition)
docstring: Now, the vendor specific flags.
          The parameter linker can be either gnu, darwin, osf, hpux or sun.
docstring_summary: Now, the vendor specific flags.
          The parameter linker can be either gnu, darwin, osf, hpux or sun.
docstring_tokens: Now the vendor specific flags . The parameter linker can be either gnu darwin osf hpux or sun .
function: def init_link_flags(toolset, linker, condition):
      """
          Now, the vendor specific flags.
          The parameter linker can be either gnu, darwin, osf, hpux or sun.
      """
      toolset_link = toolset + '.link'
      if linker == 'gnu':
          # Strip the binary when no debugging is needed. We use --strip-all flag
          # as opposed to -s since icc (intel's compiler) is generally
          # option-compatible with and inherits from the gcc toolset, but does not
          # support -s.
  
          # FIXME: what does unchecked translate to?
          flags(toolset_link, 'OPTIONS', map(lambda x: x + '/<debug-symbols>off', condition), ['-Wl,--strip-all'])  # : unchecked ;
          flags(toolset_link, 'RPATH',       condition,                      ['<dll-path>'])       # : unchecked ;
          flags(toolset_link, 'RPATH_LINK',  condition,                      ['<xdll-path>'])      # : unchecked ;
          flags(toolset_link, 'START-GROUP', condition,                      ['-Wl,--start-group'])# : unchecked ;
          flags(toolset_link, 'END-GROUP',   condition,                      ['-Wl,--end-group'])  # : unchecked ;
  
          # gnu ld has the ability to change the search behaviour for libraries
          # referenced by -l switch. These modifiers are -Bstatic and -Bdynamic
          # and change search for -l switches that follow them. The following list
          # shows the tried variants.
          # The search stops at the first variant that has a match.
          # *nix: -Bstatic -lxxx
          #    libxxx.a
          #
          # *nix: -Bdynamic -lxxx
          #    libxxx.so
          #    libxxx.a
          #
          # windows (mingw,cygwin) -Bstatic -lxxx
          #    libxxx.a
          #    xxx.lib
          #
          # windows (mingw,cygwin) -Bdynamic -lxxx
          #    libxxx.dll.a
          #    xxx.dll.a
          #    libxxx.a
          #    xxx.lib
          #    cygxxx.dll (*)
          #    libxxx.dll
          #    xxx.dll
          #    libxxx.a
          #
          # (*) This is for cygwin
          # Please note that -Bstatic and -Bdynamic are not a guarantee that a
          # static or dynamic lib indeed gets linked in. The switches only change
          # search patterns!
  
          # On *nix mixing shared libs with static runtime is not a good idea.
          flags(toolset_link, 'FINDLIBS-ST-PFX',
                map(lambda x: x + '/<runtime-link>shared', condition),
              ['-Wl,-Bstatic']) # : unchecked ;
          flags(toolset_link, 'FINDLIBS-SA-PFX',
                map(lambda x: x + '/<runtime-link>shared', condition),
              ['-Wl,-Bdynamic']) # : unchecked ;
  
          # On windows allow mixing of static and dynamic libs with static
          # runtime.
          flags(toolset_link, 'FINDLIBS-ST-PFX',
                map(lambda x: x + '/<runtime-link>static/<target-os>windows', condition),
                ['-Wl,-Bstatic']) # : unchecked ;
          flags(toolset_link, 'FINDLIBS-SA-PFX',
                map(lambda x: x + '/<runtime-link>static/<target-os>windows', condition),
                ['-Wl,-Bdynamic']) # : unchecked ;
          flags(toolset_link, 'OPTIONS',
                map(lambda x: x + '/<runtime-link>static/<target-os>windows', condition),
                ['-Wl,-Bstatic']) # : unchecked ;
  
      elif linker == 'darwin':
          # On Darwin, the -s option to ld does not work unless we pass -static,
          # and passing -static unconditionally is a bad idea. So, don't pass -s.
          # at all, darwin.jam will use separate 'strip' invocation.
          flags(toolset_link, 'RPATH', condition, ['<dll-path>']) # : unchecked ;
          flags(toolset_link, 'RPATH_LINK', condition, ['<xdll-path>']) # : unchecked ;
  
      elif linker == 'osf':
          # No --strip-all, just -s.
          flags(toolset_link, 'OPTIONS', map(lambda x: x + '/<debug-symbols>off', condition), ['-Wl,-s'])
              # : unchecked ;
          flags(toolset_link, 'RPATH', condition, ['<dll-path>']) # : unchecked ;
          # This does not supports -R.
          flags(toolset_link, 'RPATH_OPTION', condition, ['-rpath']) # : unchecked ;
          # -rpath-link is not supported at all.
  
      elif linker == 'sun':
          flags(toolset_link, 'OPTIONS', map(lambda x: x + '/<debug-symbols>off', condition), ['-Wl,-s'])
              # : unchecked ;
          flags(toolset_link, 'RPATH', condition, ['<dll-path>']) # : unchecked ;
          # Solaris linker does not have a separate -rpath-link, but allows to use
          # -L for the same purpose.
          flags(toolset_link, 'LINKPATH', condition, ['<xdll-path>']) # : unchecked ;
  
          # This permits shared libraries with non-PIC code on Solaris.
          # VP, 2004/09/07: Now that we have -fPIC hardcode in link.dll, the
          # following is not needed. Whether -fPIC should be hardcoded, is a
          # separate question.
          # AH, 2004/10/16: it is still necessary because some tests link against
          # static libraries that were compiled without PIC.
          flags(toolset_link, 'OPTIONS', map(lambda x: x + '/<link>shared', condition), ['-mimpure-text'])
              # : unchecked ;
  
      elif linker == 'hpux':
          flags(toolset_link, 'OPTIONS', map(lambda x: x + '/<debug-symbols>off', condition),
              ['-Wl,-s']) # : unchecked ;
          flags(toolset_link, 'OPTIONS', map(lambda x: x + '/<link>shared', condition),
              ['-fPIC']) # : unchecked ;
  
      else:
          # FIXME:
          errors.user_error(
          "$(toolset) initialization: invalid linker '$(linker)' " +
          "The value '$(linker)' specified for <linker> is not recognized. " +
          "Possible values are 'gnu', 'darwin', 'osf', 'hpux' or 'sun'")
function_tokens: def init_link_flags ( toolset , linker , condition ) : toolset_link = toolset + '.link' if linker == 'gnu' : # Strip the binary when no debugging is needed. We use --strip-all flag # as opposed to -s since icc (intel's compiler) is generally # option-compatible with and inherits from the gcc toolset, but does not # support -s. # FIXME: what does unchecked translate to? flags ( toolset_link , 'OPTIONS' , map ( lambda x : x + '/<debug-symbols>off' , condition ) , [ '-Wl,--strip-all' ] ) # : unchecked ; flags ( toolset_link , 'RPATH' , condition , [ '<dll-path>' ] ) # : unchecked ; flags ( toolset_link , 'RPATH_LINK' , condition , [ '<xdll-path>' ] ) # : unchecked ; flags ( toolset_link , 'START-GROUP' , condition , [ '-Wl,--start-group' ] ) # : unchecked ; flags ( toolset_link , 'END-GROUP' , condition , [ '-Wl,--end-group' ] ) # : unchecked ; # gnu ld has the ability to change the search behaviour for libraries # referenced by -l switch. These modifiers are -Bstatic and -Bdynamic # and change search for -l switches that follow them. The following list # shows the tried variants. # The search stops at the first variant that has a match. # *nix: -Bstatic -lxxx #    libxxx.a # # *nix: -Bdynamic -lxxx #    libxxx.so #    libxxx.a # # windows (mingw,cygwin) -Bstatic -lxxx #    libxxx.a #    xxx.lib # # windows (mingw,cygwin) -Bdynamic -lxxx #    libxxx.dll.a #    xxx.dll.a #    libxxx.a #    xxx.lib #    cygxxx.dll (*) #    libxxx.dll #    xxx.dll #    libxxx.a # # (*) This is for cygwin # Please note that -Bstatic and -Bdynamic are not a guarantee that a # static or dynamic lib indeed gets linked in. The switches only change # search patterns! # On *nix mixing shared libs with static runtime is not a good idea. flags ( toolset_link , 'FINDLIBS-ST-PFX' , map ( lambda x : x + '/<runtime-link>shared' , condition ) , [ '-Wl,-Bstatic' ] ) # : unchecked ; flags ( toolset_link , 'FINDLIBS-SA-PFX' , map ( lambda x : x + '/<runtime-link>shared' , condition ) , [ '-Wl,-Bdynamic' ] ) # : unchecked ; # On windows allow mixing of static and dynamic libs with static # runtime. flags ( toolset_link , 'FINDLIBS-ST-PFX' , map ( lambda x : x + '/<runtime-link>static/<target-os>windows' , condition ) , [ '-Wl,-Bstatic' ] ) # : unchecked ; flags ( toolset_link , 'FINDLIBS-SA-PFX' , map ( lambda x : x + '/<runtime-link>static/<target-os>windows' , condition ) , [ '-Wl,-Bdynamic' ] ) # : unchecked ; flags ( toolset_link , 'OPTIONS' , map ( lambda x : x + '/<runtime-link>static/<target-os>windows' , condition ) , [ '-Wl,-Bstatic' ] ) # : unchecked ; elif linker == 'darwin' : # On Darwin, the -s option to ld does not work unless we pass -static, # and passing -static unconditionally is a bad idea. So, don't pass -s. # at all, darwin.jam will use separate 'strip' invocation. flags ( toolset_link , 'RPATH' , condition , [ '<dll-path>' ] ) # : unchecked ; flags ( toolset_link , 'RPATH_LINK' , condition , [ '<xdll-path>' ] ) # : unchecked ; elif linker == 'osf' : # No --strip-all, just -s. flags ( toolset_link , 'OPTIONS' , map ( lambda x : x + '/<debug-symbols>off' , condition ) , [ '-Wl,-s' ] ) # : unchecked ; flags ( toolset_link , 'RPATH' , condition , [ '<dll-path>' ] ) # : unchecked ; # This does not supports -R. flags ( toolset_link , 'RPATH_OPTION' , condition , [ '-rpath' ] ) # : unchecked ; # -rpath-link is not supported at all. elif linker == 'sun' : flags ( toolset_link , 'OPTIONS' , map ( lambda x : x + '/<debug-symbols>off' , condition ) , [ '-Wl,-s' ] ) # : unchecked ; flags ( toolset_link , 'RPATH' , condition , [ '<dll-path>' ] ) # : unchecked ; # Solaris linker does not have a separate -rpath-link, but allows to use # -L for the same purpose. flags ( toolset_link , 'LINKPATH' , condition , [ '<xdll-path>' ] ) # : unchecked ; # This permits shared libraries with non-PIC code on Solaris. # VP, 2004/09/07: Now that we have -fPIC hardcode in link.dll, the # following is not needed. Whether -fPIC should be hardcoded, is a # separate question. # AH, 2004/10/16: it is still necessary because some tests link against # static libraries that were compiled without PIC. flags ( toolset_link , 'OPTIONS' , map ( lambda x : x + '/<link>shared' , condition ) , [ '-mimpure-text' ] ) # : unchecked ; elif linker == 'hpux' : flags ( toolset_link , 'OPTIONS' , map ( lambda x : x + '/<debug-symbols>off' , condition ) , [ '-Wl,-s' ] ) # : unchecked ; flags ( toolset_link , 'OPTIONS' , map ( lambda x : x + '/<link>shared' , condition ) , [ '-fPIC' ] ) # : unchecked ; else : # FIXME: errors . user_error ( "$(toolset) initialization: invalid linker '$(linker)' " + "The value '$(linker)' specified for <linker> is not recognized. " + "Possible values are 'gnu', 'darwin', 'osf', 'hpux' or 'sun'" )