From bfc5bb50b2bec09f0b6d90f5224af937165a29d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Fri, 22 Aug 2008 22:15:39 +0000 Subject: [PATCH] Minor stylistic change to Boost Build toolset modules making them refer to the toolset.flags rule by its full name. [SVN r48298] --- v2/tools/gcc.jam | 233 ++++++++++++++++++++++++----------------------- v2/tools/qcc.jam | 58 ++++++------ 2 files changed, 149 insertions(+), 142 deletions(-) diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 72e8ca3dc..d1ee62396 100644 --- a/v2/tools/gcc.jam +++ b/v2/tools/gcc.jam @@ -10,7 +10,7 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -import toolset : flags ; +import toolset ; import property ; import generators ; import os ; @@ -24,6 +24,7 @@ import property-set ; import pch ; import regex ; + if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] { .debug-configuration = true ; @@ -168,7 +169,7 @@ rule init ( version ? : command * : options * ) { ECHO notice: using gcc libraries :: $(condition) :: $(lib_path) ; } - flags gcc.link RUN_PATH $(condition) : $(lib_path) ; + toolset.flags gcc.link RUN_PATH $(condition) : $(lib_path) ; } # If it's not a system gcc install we should adjust the various programs as @@ -179,7 +180,7 @@ rule init ( version ? : command * : options * ) local archiver = [ common.get-invocation-command gcc : ar : [ feature.get-values : $(options) ] : $(bin) : search-path ] ; - flags gcc.archive .AR $(condition) : $(archiver[1]) ; + toolset.flags gcc.archive .AR $(condition) : $(archiver[1]) ; if $(.debug-configuration) { ECHO notice: using gcc archiver :: $(condition) :: $(archiver[1]) ; @@ -285,25 +286,25 @@ generators.register [ new gcc-pch-generator gcc.compile.c++.pch : H : CPP_PCH : generators.override gcc.compile.c.pch : pch.default-c-pch-generator ; generators.override gcc.compile.c++.pch : pch.default-cpp-pch-generator ; -flags gcc.compile PCH_FILE on : ; +toolset.flags gcc.compile PCH_FILE on : ; # Declare flags and action for compilation. -flags gcc.compile OPTIONS off : -O0 ; -flags gcc.compile OPTIONS speed : -O3 ; -flags gcc.compile OPTIONS space : -Os ; +toolset.flags gcc.compile OPTIONS off : -O0 ; +toolset.flags gcc.compile OPTIONS speed : -O3 ; +toolset.flags gcc.compile OPTIONS space : -Os ; -flags gcc.compile OPTIONS off : -fno-inline ; -flags gcc.compile OPTIONS on : -Wno-inline ; -flags gcc.compile OPTIONS full : -finline-functions -Wno-inline ; +toolset.flags gcc.compile OPTIONS off : -fno-inline ; +toolset.flags gcc.compile OPTIONS on : -Wno-inline ; +toolset.flags gcc.compile OPTIONS full : -finline-functions -Wno-inline ; -flags gcc.compile OPTIONS off : -w ; -flags gcc.compile OPTIONS on : -Wall ; -flags gcc.compile OPTIONS all : -Wall -pedantic ; -flags gcc.compile OPTIONS on : -Werror ; +toolset.flags gcc.compile OPTIONS off : -w ; +toolset.flags gcc.compile OPTIONS on : -Wall ; +toolset.flags gcc.compile OPTIONS all : -Wall -pedantic ; +toolset.flags gcc.compile OPTIONS on : -Werror ; -flags gcc.compile OPTIONS on : -g ; -flags gcc.compile OPTIONS on : -pg ; -flags gcc.compile OPTIONS off : -fno-rtti ; +toolset.flags gcc.compile OPTIONS on : -g ; +toolset.flags gcc.compile OPTIONS on : -pg ; +toolset.flags gcc.compile OPTIONS off : -fno-rtti ; # On cygwin and mingw, gcc generates position independent code by default, and # warns if -fPIC is specified. This might not be the right way of checking if @@ -330,7 +331,7 @@ if [ os.name ] != CYGWIN && [ os.name ] != NT # Yet another alternative would be to create a propagated # feature and set it when building shared libraries, but that would be hard # to implement and would increase the target path length even more. - flags gcc.compile OPTIONS shared : -fPIC ; + toolset.flags gcc.compile OPTIONS shared : -fPIC ; } if [ os.name ] != NT && [ os.name ] != OSF && [ os.name ] != HPUX && [ os.name ] != AIX { @@ -341,11 +342,11 @@ if [ os.name ] != NT && [ os.name ] != OSF && [ os.name ] != HPUX && [ os.name ] } -flags gcc.compile USER_OPTIONS ; -flags gcc.compile.c++ USER_OPTIONS ; -flags gcc.compile DEFINES ; -flags gcc.compile INCLUDES ; -flags gcc.compile.c++ TEMPLATE_DEPTH ; +toolset.flags gcc.compile USER_OPTIONS ; +toolset.flags gcc.compile.c++ USER_OPTIONS ; +toolset.flags gcc.compile DEFINES ; +toolset.flags gcc.compile INCLUDES ; +toolset.flags gcc.compile.c++ TEMPLATE_DEPTH ; actions compile.c++.pch @@ -505,13 +506,13 @@ else # Declare flags for linking. # First, the common flags. -flags gcc.link OPTIONS on : -g ; -flags gcc.link OPTIONS on : -pg ; -flags gcc.link USER_OPTIONS ; -flags gcc.link LINKPATH ; -flags gcc.link FINDLIBS-ST ; -flags gcc.link FINDLIBS-SA ; -flags gcc.link LIBRARIES ; +toolset.flags gcc.link OPTIONS on : -g ; +toolset.flags gcc.link OPTIONS on : -pg ; +toolset.flags gcc.link USER_OPTIONS ; +toolset.flags gcc.link LINKPATH ; +toolset.flags gcc.link FINDLIBS-ST ; +toolset.flags gcc.link FINDLIBS-SA ; +toolset.flags gcc.link LIBRARIES ; # For static we made sure there are no dynamic libraries in the # link. On HP-UX not all system libraries exist as archived libraries (for @@ -519,7 +520,7 @@ flags gcc.link LIBRARIES ; # cannot be specified. if [ os.name ] != HPUX { - flags gcc.link OPTIONS static : -static ; + toolset.flags gcc.link OPTIONS static : -static ; } # Now, the vendor specific flags. @@ -528,17 +529,55 @@ rule init-link-flags ( toolset linker condition ) { switch $(linker) { + case aix : + { + # + # On AIX we *have* to use the native linker. + # + # Using -brtl, the AIX linker will look for libraries with both the .a + # and .so extensions, such as libfoo.a and libfoo.so. Without -brtl, the + # AIX linker looks only for libfoo.a. Note that libfoo.a is an archived + # file that may contain shared objects and is different from static libs + # as on Linux. + # + # The -bnoipath strips the prepending (relative) path of libraries from + # the loader section in the target library or executable. Hence, during + # load-time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded + # -blibpath (*similar* to -lrpath/-lrpath-link) is searched. Without + # this option, the prepending (relative) path + library name is + # hard-coded in the loader section, causing *only* this path to be + # searched during load-time. Note that the AIX linker does not have an + # -soname equivalent, this is as close as it gets. + # + # The above options are definately for AIX 5.x, and most likely also for + # AIX 4.x and AIX 6.x. For details about the AIX linker see: + # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf + # + + toolset.flags $(toolset).link OPTIONS : -Wl,-brtl -Wl,-bnoipath + : unchecked ; + } + + case 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. + toolset.flags $(toolset).link RPATH $(condition) : : unchecked ; + toolset.flags $(toolset).link RPATH_LINK $(condition) : : unchecked ; + } + case 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. - flags $(toolset).link OPTIONS $(condition)/off : -Wl,--strip-all : unchecked ; - flags $(toolset).link RPATH $(condition) : : unchecked ; - flags $(toolset).link RPATH_LINK $(condition) : : unchecked ; - flags $(toolset).link START-GROUP $(condition) : -Wl,--start-group : unchecked ; - flags $(toolset).link END-GROUP $(condition) : -Wl,--end-group : unchecked ; + toolset.flags $(toolset).link OPTIONS $(condition)/off : -Wl,--strip-all : unchecked ; + toolset.flags $(toolset).link RPATH $(condition) : : unchecked ; + toolset.flags $(toolset).link RPATH_LINK $(condition) : : unchecked ; + toolset.flags $(toolset).link START-GROUP $(condition) : -Wl,--start-group : unchecked ; + toolset.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 @@ -572,49 +611,52 @@ rule init-link-flags ( toolset linker condition ) # search patterns! # On *nix mixing shared libs with static runtime is not a good idea. - flags $(toolset).link FINDLIBS-ST-PFX $(condition)/shared + toolset.flags $(toolset).link FINDLIBS-ST-PFX $(condition)/shared : -Wl,-Bstatic : unchecked ; - flags $(toolset).link FINDLIBS-SA-PFX $(condition)/shared + toolset.flags $(toolset).link FINDLIBS-SA-PFX $(condition)/shared : -Wl,-Bdynamic : unchecked ; # On windows allow mixing of static and dynamic libs with static # runtime. - flags $(toolset).link FINDLIBS-ST-PFX $(condition)/static/windows + toolset.flags $(toolset).link FINDLIBS-ST-PFX $(condition)/static/windows : -Wl,-Bstatic : unchecked ; - flags $(toolset).link FINDLIBS-SA-PFX $(condition)/static/windows + toolset.flags $(toolset).link FINDLIBS-SA-PFX $(condition)/static/windows : -Wl,-Bdynamic : unchecked ; - flags $(toolset).link OPTIONS $(condition)/static/windows + toolset.flags $(toolset).link OPTIONS $(condition)/static/windows : -Wl,-Bstatic : unchecked ; } - case darwin : + case hpux : { - # 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) : : unchecked ; - flags $(toolset).link RPATH_LINK $(condition) : : unchecked ; + toolset.flags $(toolset).link OPTIONS $(condition)/off + : -Wl,-s : unchecked ; + toolset.flags $(toolset).link OPTIONS $(condition)/shared + : -fPIC : unchecked ; } case osf : { - # No --strip-all, just -s. - flags $(toolset).link OPTIONS $(condition)/off : -Wl,-s - : unchecked ; - flags $(toolset).link RPATH $(condition) : : unchecked ; - # This does not supports -R. - flags $(toolset).link RPATH_OPTION $(condition) : -rpath : unchecked ; - # -rpath-link is not supported at all. + # No --strip-all, just -s. + toolset.flags $(toolset).link OPTIONS $(condition)/off + : -Wl,-s : unchecked ; + toolset.flags $(toolset).link RPATH $(condition) : + : unchecked ; + # This does not supports -R. + toolset.flags $(toolset).link RPATH_OPTION $(condition) : -rpath + : unchecked ; + # -rpath-link is not supported at all. } case sun : { - flags $(toolset).link OPTIONS $(condition)/off : -Wl,-s + toolset.flags $(toolset).link OPTIONS $(condition)/off + : -Wl,-s : unchecked ; + toolset.flags $(toolset).link RPATH $(condition) : : unchecked ; - flags $(toolset).link RPATH $(condition) : : unchecked ; # Solaris linker does not have a separate -rpath-link, but allows to use # -L for the same purpose. - flags $(toolset).link LINKPATH $(condition) : : unchecked ; + toolset.flags $(toolset).link LINKPATH $(condition) : + : 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 @@ -622,45 +664,10 @@ rule init-link-flags ( toolset linker condition ) # 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 $(condition)/shared : -mimpure-text - : unchecked ; + toolset.flags $(toolset).link OPTIONS $(condition)/shared + : -mimpure-text : unchecked ; } - case hpux : - { - flags $(toolset).link OPTIONS $(condition)/off - : -Wl,-s : unchecked ; - flags $(toolset).link OPTIONS $(condition)/shared - : -fPIC : unchecked ; - } - - case aix : - { - # - # On AIX we *have* to use the native linker. - # - # Using -brtl, the AIX linker will look for libraries with both the .a and .so - # extensions, such as libfoo.a and libfoo.so. Without -brtl, the AIX linker - # looks only for libfoo.a. Note that libfoo.a is an archived file that may - # contain shared objects and is different from static libs as on Linux. - # - # The -bnoipath strips the prepending (relative) path of libraries from - # the loader section in the target library or executable. Hence, during load- - # time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded -blibpath - # (*similar* to -lrpath/-lrpath-link) is searched. Without this option, - # the prepending (relative) path + library name is hard-coded in the loader - # section, causing *only* this path to be searched during load-time. - # Note that the AIX linker does not have an -soname equivalent, this - # is as close as it gets. - # - # The above options are definately for AIX 5.x, and most likely also for - # AIX 4.x and AIX 6.x. For details about AIX linker: - # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf - # - - flags $(toolset).link OPTIONS : -Wl,-brtl -Wl,-bnoipath : unchecked ; - } - case * : { errors.user-error @@ -693,7 +700,7 @@ actions link bind LIBRARIES # always available. .AR = ar ; -flags gcc.archive AROPTIONS ; +toolset.flags gcc.archive AROPTIONS ; rule archive ( targets * : sources * : properties * ) { @@ -752,7 +759,7 @@ actions link.dll bind LIBRARIES if [ os.on-windows ] { - flags gcc OPTIONS multi : -mthreads ; + toolset.flags gcc OPTIONS multi : -mthreads ; } else if [ modules.peek : UNIX ] { @@ -760,8 +767,8 @@ else if [ modules.peek : UNIX ] { case SunOS* : { - flags gcc OPTIONS multi : -pthreads ; - flags gcc FINDLIBS-SA : rt ; + toolset.flags gcc OPTIONS multi : -pthreads ; + toolset.flags gcc FINDLIBS-SA : rt ; } case BeOS : { @@ -769,12 +776,12 @@ else if [ modules.peek : UNIX ] } case *BSD : { - flags gcc OPTIONS multi : -pthread ; + toolset.flags gcc OPTIONS multi : -pthread ; # There is no -lrt on BSD. } case DragonFly : { - flags gcc OPTIONS multi : -pthread ; + toolset.flags gcc OPTIONS multi : -pthread ; # There is no -lrt on BSD - DragonFly is a FreeBSD variant, which # annoyingly does not say it is a *BSD. } @@ -789,8 +796,8 @@ else if [ modules.peek : UNIX ] } case * : { - flags gcc OPTIONS multi : -pthread ; - flags gcc FINDLIBS-SA : rt ; + toolset.flags gcc OPTIONS multi : -pthread ; + toolset.flags gcc FINDLIBS-SA : rt ; } } } @@ -799,11 +806,11 @@ local rule cpu-flags ( toolset variable : architecture : instruction-set + : val { if $(default) { - flags $(toolset) $(variable) + toolset.flags $(toolset) $(variable) $(architecture)/ : $(values) ; } - flags $(toolset) $(variable) + toolset.flags $(toolset) $(variable) /$(instruction-set) $(architecture)/$(instruction-set) : $(values) ; @@ -812,8 +819,8 @@ local rule cpu-flags ( toolset variable : architecture : instruction-set + : val # Set architecture/instruction-set options. # # x86 and compatible -flags gcc OPTIONS x86/32 : -m32 ; -flags gcc OPTIONS x86/64 : -m64 ; +toolset.flags gcc OPTIONS x86/32 : -m32 ; +toolset.flags gcc OPTIONS x86/64 : -m64 ; cpu-flags gcc OPTIONS : x86 : i386 : -march=i386 : default ; cpu-flags gcc OPTIONS : x86 : i486 : -march=i486 ; cpu-flags gcc OPTIONS : x86 : i586 : -march=i586 ; @@ -847,8 +854,8 @@ cpu-flags gcc OPTIONS : x86 : winchip2 : -march=winchip2 ; cpu-flags gcc OPTIONS : x86 : c3 : -march=c3 ; cpu-flags gcc OPTIONS : x86 : c3-2 : -march=c3-2 ; # Sparc -flags gcc OPTIONS sparc/32 : -m32 ; -flags gcc OPTIONS sparc/64 : -m64 ; +toolset.flags gcc OPTIONS sparc/32 : -m32 ; +toolset.flags gcc OPTIONS sparc/64 : -m64 ; cpu-flags gcc OPTIONS : sparc : c3 : -mcpu=c3 : default ; cpu-flags gcc OPTIONS : sparc : v7 : -mcpu=v7 ; cpu-flags gcc OPTIONS : sparc : cypress : -mcpu=cypress ; @@ -865,8 +872,8 @@ cpu-flags gcc OPTIONS : sparc : v9 : -mcpu=v9 ; cpu-flags gcc OPTIONS : sparc : ultrasparc : -mcpu=ultrasparc ; cpu-flags gcc OPTIONS : sparc : ultrasparc3 : -mcpu=ultrasparc3 ; # RS/6000 & PowerPC -flags gcc OPTIONS power/32 : -m32 ; -flags gcc OPTIONS power/64 : -m64 ; +toolset.flags gcc OPTIONS power/32 : -m32 ; +toolset.flags gcc OPTIONS power/64 : -m64 ; cpu-flags gcc OPTIONS : power : 403 : -mcpu=403 ; cpu-flags gcc OPTIONS : power : 505 : -mcpu=505 ; cpu-flags gcc OPTIONS : power : 601 : -mcpu=601 ; @@ -900,6 +907,6 @@ cpu-flags gcc OPTIONS : power : rios2 : -mcpu=rios2 ; cpu-flags gcc OPTIONS : power : rsc : -mcpu=rsc ; cpu-flags gcc OPTIONS : power : rs64a : -mcpu=rs64 ; # AIX variant of RS/6000 & PowerPC -flags gcc OPTIONS power/32/aix : -maix32 ; -flags gcc OPTIONS power/64/aix : -maix64 ; -flags gcc AROPTIONS power/64/aix : "-X 64" ; +toolset.flags gcc OPTIONS power/32/aix : -maix32 ; +toolset.flags gcc OPTIONS power/64/aix : -maix64 ; +toolset.flags gcc AROPTIONS power/64/aix : "-X 64" ; diff --git a/v2/tools/qcc.jam b/v2/tools/qcc.jam index 960309197..9d5f24bc2 100644 --- a/v2/tools/qcc.jam +++ b/v2/tools/qcc.jam @@ -6,7 +6,7 @@ # License Version 1.0. (See accompanying file LICENSE_1_0.txt or # http://www.boost.org/LICENSE_1_0.txt) -import toolset : flags ; +import toolset ; import property ; import generators ; import os ; @@ -55,31 +55,31 @@ generators.register-c-compiler qcc.compile.asm : ASM : OBJ : qcc ; # Declare flags for compilation. -flags qcc.compile OPTIONS on : -gstabs+ ; +toolset.flags qcc.compile OPTIONS on : -gstabs+ ; # Declare flags and action for compilation. -flags qcc.compile OPTIONS off : -O0 ; -flags qcc.compile OPTIONS speed : -O3 ; -flags qcc.compile OPTIONS space : -Os ; +toolset.flags qcc.compile OPTIONS off : -O0 ; +toolset.flags qcc.compile OPTIONS speed : -O3 ; +toolset.flags qcc.compile OPTIONS space : -Os ; -flags qcc.compile OPTIONS off : -Wc,-fno-inline ; -flags qcc.compile OPTIONS on : -Wc,-Wno-inline ; -flags qcc.compile OPTIONS full : -Wc,-finline-functions -Wc,-Wno-inline ; +toolset.flags qcc.compile OPTIONS off : -Wc,-fno-inline ; +toolset.flags qcc.compile OPTIONS on : -Wc,-Wno-inline ; +toolset.flags qcc.compile OPTIONS full : -Wc,-finline-functions -Wc,-Wno-inline ; -flags qcc.compile OPTIONS off : -w ; -flags qcc.compile OPTIONS all : -Wc,-Wall ; -flags qcc.compile OPTIONS on : -Wc,-Werror ; +toolset.flags qcc.compile OPTIONS off : -w ; +toolset.flags qcc.compile OPTIONS all : -Wc,-Wall ; +toolset.flags qcc.compile OPTIONS on : -Wc,-Werror ; -flags qcc.compile OPTIONS on : -p ; +toolset.flags qcc.compile OPTIONS on : -p ; -flags qcc.compile OPTIONS ; -flags qcc.compile.c++ OPTIONS ; -flags qcc.compile DEFINES ; -flags qcc.compile INCLUDES ; +toolset.flags qcc.compile OPTIONS ; +toolset.flags qcc.compile.c++ OPTIONS ; +toolset.flags qcc.compile DEFINES ; +toolset.flags qcc.compile INCLUDES ; -flags qcc.compile OPTIONS shared : -shared ; +toolset.flags qcc.compile OPTIONS shared : -shared ; -flags qcc.compile.c++ TEMPLATE_DEPTH ; +toolset.flags qcc.compile.c++ TEMPLATE_DEPTH ; rule compile.c++ @@ -166,23 +166,23 @@ generators.override qcc.searched-lib-generator : searched-lib-generator ; # Declare flags for linking. # First, the common flags. -flags qcc.link OPTIONS on : -gstabs+ ; -flags qcc.link OPTIONS on : -p ; -flags qcc.link OPTIONS ; -flags qcc.link LINKPATH ; -flags qcc.link FINDLIBS-ST ; -flags qcc.link FINDLIBS-SA ; -flags qcc.link LIBRARIES ; +toolset.flags qcc.link OPTIONS on : -gstabs+ ; +toolset.flags qcc.link OPTIONS on : -p ; +toolset.flags qcc.link OPTIONS ; +toolset.flags qcc.link LINKPATH ; +toolset.flags qcc.link FINDLIBS-ST ; +toolset.flags qcc.link FINDLIBS-SA ; +toolset.flags qcc.link LIBRARIES ; -flags qcc.link FINDLIBS-SA : m ; +toolset.flags qcc.link FINDLIBS-SA : m ; # For static we made sure there are no dynamic libraries in the # link. -flags qcc.link OPTIONS static : -static ; +toolset.flags qcc.link OPTIONS static : -static ; # Assuming this is just like with gcc. -flags qcc.link RPATH : : unchecked ; -flags qcc.link RPATH_LINK : : unchecked ; +toolset.flags qcc.link RPATH : : unchecked ; +toolset.flags qcc.link RPATH_LINK : : unchecked ; # Declare actions for linking.