Now, the vendor specific flags. The parameter linker can be either gnu, darwin, osf, hpux or sun.
(toolset, linker, condition)
| 463 | # Now, the vendor specific flags. |
| 464 | # The parameter linker can be either gnu, darwin, osf, hpux or sun. |
| 465 | def init_link_flags(toolset, linker, condition): |
| 466 | """ |
| 467 | Now, the vendor specific flags. |
| 468 | The parameter linker can be either gnu, darwin, osf, hpux or sun. |
| 469 | """ |
| 470 | toolset_link = toolset + '.link' |
| 471 | if linker == 'gnu': |
| 472 | # Strip the binary when no debugging is needed. We use --strip-all flag |
| 473 | # as opposed to -s since icc (intel's compiler) is generally |
| 474 | # option-compatible with and inherits from the gcc toolset, but does not |
| 475 | # support -s. |
| 476 | |
| 477 | # FIXME: what does unchecked translate to? |
| 478 | flags(toolset_link, 'OPTIONS', map(lambda x: x + '/<debug-symbols>off', condition), ['-Wl,--strip-all']) # : unchecked ; |
| 479 | flags(toolset_link, 'RPATH', condition, ['<dll-path>']) # : unchecked ; |
| 480 | flags(toolset_link, 'RPATH_LINK', condition, ['<xdll-path>']) # : unchecked ; |
| 481 | flags(toolset_link, 'START-GROUP', condition, ['-Wl,--start-group'])# : unchecked ; |
| 482 | flags(toolset_link, 'END-GROUP', condition, ['-Wl,--end-group']) # : unchecked ; |
| 483 | |
| 484 | # gnu ld has the ability to change the search behaviour for libraries |
| 485 | # referenced by -l switch. These modifiers are -Bstatic and -Bdynamic |
| 486 | # and change search for -l switches that follow them. The following list |
| 487 | # shows the tried variants. |
| 488 | # The search stops at the first variant that has a match. |
| 489 | # *nix: -Bstatic -lxxx |
| 490 | # libxxx.a |
| 491 | # |
| 492 | # *nix: -Bdynamic -lxxx |
| 493 | # libxxx.so |
| 494 | # libxxx.a |
| 495 | # |
| 496 | # windows (mingw,cygwin) -Bstatic -lxxx |
| 497 | # libxxx.a |
| 498 | # xxx.lib |
| 499 | # |
| 500 | # windows (mingw,cygwin) -Bdynamic -lxxx |
| 501 | # libxxx.dll.a |
| 502 | # xxx.dll.a |
| 503 | # libxxx.a |
| 504 | # xxx.lib |
| 505 | # cygxxx.dll (*) |
| 506 | # libxxx.dll |
| 507 | # xxx.dll |
| 508 | # libxxx.a |
| 509 | # |
| 510 | # (*) This is for cygwin |
| 511 | # Please note that -Bstatic and -Bdynamic are not a guarantee that a |
| 512 | # static or dynamic lib indeed gets linked in. The switches only change |
| 513 | # search patterns! |
| 514 | |
| 515 | # On *nix mixing shared libs with static runtime is not a good idea. |
| 516 | flags(toolset_link, 'FINDLIBS-ST-PFX', |
| 517 | map(lambda x: x + '/<runtime-link>shared', condition), |
| 518 | ['-Wl,-Bstatic']) # : unchecked ; |
| 519 | flags(toolset_link, 'FINDLIBS-SA-PFX', |
| 520 | map(lambda x: x + '/<runtime-link>shared', condition), |
| 521 | ['-Wl,-Bdynamic']) # : unchecked ; |
| 522 |