diff --git a/v2/tools/darwin.jam b/v2/tools/darwin.jam index 048ae9946..366160f9d 100644 --- a/v2/tools/darwin.jam +++ b/v2/tools/darwin.jam @@ -15,12 +15,7 @@ import common ; toolset.register darwin ; import gcc ; toolset.inherit-generators darwin : gcc ; -# we can't pass -s to ld unless we also pass -static -# so we removed -s completly from OPTIONS and add it -# to ST_OPTIONS -toolset.inherit-flags darwin : gcc : off ; toolset.inherit-rules darwin : gcc ; -flags darwin.link ST_OPTIONS off : -s ; # No additional initialization should be necessary rule init ( version ? : command * : options * ) @@ -29,6 +24,14 @@ rule init ( version ? : command * : options * ) local command = [ common.get-invocation-command darwin : g++ : $(command) ] ; common.handle-options darwin : $(condition) : $(command) : $(options) ; + + # we can't pass -s to ld unless we also pass -static + # so we removed -s completly from OPTIONS and add it + # to ST_OPTIONS + gcc.init-link-flags gnu $(condition) ; + toolset.inherit-flags darwin : gcc : $(condition)/off ; + flags darwin.link ST_OPTIONS off : -s ; + } # Darwin has a different shared library suffix diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 48d9b9e8c..d10ebc3af 100644 --- a/v2/tools/gcc.jam +++ b/v2/tools/gcc.jam @@ -53,7 +53,7 @@ rule init ( version ? : command * : options * ) if ! $(linker) { linker = gnu ; } - init-link-flags $(linker) ; + init-link-flags $(linker) $(condition) ; } if [ os.name ] = NT @@ -183,23 +183,23 @@ generators.override gcc.prebuilt : builtin.prebuilt ; # Declare flags for linking +# First, the common flags +flags gcc.link OPTIONS on : -g ; +flags gcc.link OPTIONS on : -pg ; +flags gcc.link OPTIONS ; +flags gcc.link LINKPATH ; +flags gcc.link FINDLIBS-ST ; +flags gcc.link FINDLIBS-SA ; +flags gcc.link LIBRARIES ; + +# For static we made sure there are no dynamic libraries +# in the link +flags gcc.link OPTIONS static : -static ; + +# Now, the vendor specific flags # The parameter linker can be either gnu or sun -rule init-link-flags ( linker ) +rule init-link-flags ( linker condition ) { - # First, the common flags - flags gcc.link OPTIONS on : -g ; - flags gcc.link OPTIONS on : -pg ; - flags gcc.link OPTIONS ; - flags gcc.link LINKPATH ; - flags gcc.link FINDLIBS-ST ; - flags gcc.link FINDLIBS-SA ; - flags gcc.link LIBRARIES ; - - # For static we made sure there are no dynamic libraries - # in the link - flags gcc.link OPTIONS static : -static ; - - # Now, the vendor specific flags switch $(linker) { case gnu : @@ -208,17 +208,17 @@ rule init-link-flags ( linker ) # We use --strip-all flag as opposed to -s since icc # (intel's compiler) is generally option-compatible with # and inherits from gcc toolset, but does not support -s - flags gcc.link OPTIONS off : -Wl,--strip-all ; - flags gcc.link RPATH ; - flags gcc.link RPATH_LINK ; + flags gcc.link OPTIONS $(condition)/off : -Wl,--strip-all ; + flags gcc.link RPATH $(condition) : ; + flags gcc.link RPATH_LINK $(condition) : ; } case sun : { - flags gcc.link OPTIONS off : -Wl,-s ; - flags gcc.link RPATH ; + flags gcc.link OPTIONS $(condition)/off : -Wl,-s ; + flags gcc.link RPATH $(condition) : ; # Solaris linker does not have a separate -rpath-link, but # allows to use -L for the same purpose. - flags gcc.link LINKPATH ; + flags gcc.link LINKPATH $(condition) : ; # This permits shared libraries with non-PIC code on Solaris # VP, 2004/09/07: Now that we have -fPIC hardcode in link.dll, @@ -226,7 +226,7 @@ rule init-link-flags ( linker ) # 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 gcc.link OPTIONS shared : -mimpure-text ; + flags gcc.link OPTIONS $(condition)/shared : -mimpure-text ; } case * : { diff --git a/v2/tools/intel-linux.jam b/v2/tools/intel-linux.jam index 7ca97e160..c24a0c068 100644 --- a/v2/tools/intel-linux.jam +++ b/v2/tools/intel-linux.jam @@ -17,8 +17,6 @@ feature.extend-subfeature toolset intel : platform : linux ; toolset.inherit-generators intel-linux intel linux : gcc ; -toolset.inherit-flags intel-linux : gcc - : off on full space ; toolset.inherit-rules intel-linux : gcc ; # Initializes the intel-linux toolset @@ -34,6 +32,10 @@ rule init ( version ? : command * : options * ) : $(command) : /opt/intel_cc_80/bin ] ; common.handle-options intel-linux : $(condition) : $(command) : $(options) ; + + gcc.init-link-flags gnu $(condition) ; + toolset.inherit-flags intel-linux : gcc + : off on full space ; } flags intel-linux.compile OPTIONS off : "-Ob0" ;