From e9b173e248179ea7016bcf8b1d9b3cfb59f46e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sun, 20 Jul 2008 16:47:51 +0000 Subject: [PATCH] Minor stylistic comment changes & trailing spaces removal in the Boost Build tools/qcc.jam module. [SVN r47639] --- v2/tools/qcc.jam | 132 ++++++++++++++++++++++------------------------- 1 file changed, 63 insertions(+), 69 deletions(-) diff --git a/v2/tools/qcc.jam b/v2/tools/qcc.jam index bf640f529..91968ab5b 100644 --- a/v2/tools/qcc.jam +++ b/v2/tools/qcc.jam @@ -26,41 +26,38 @@ toolset.inherit-flags qcc : unix ; toolset.inherit-rules qcc : unix ; - -# Make the "o" suffix used for qcc toolset on all -# platforms -type.set-generated-target-suffix OBJ : qcc : o ; +# Set typed target suffixes used by the qcc toolset. +type.set-generated-target-suffix OBJ : qcc : o ; type.set-generated-target-suffix STATIC_LIB : qcc : a ; -# Initializes the qcc 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 being specified as option-value. Valid option names -# are: cxxflags, linkflags and linker-type. Accepted values for linker-type -# are gnu and sun, gnu being the default. +# Initializes the qcc 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 being specified as +# option-value. Valid option names are: cxxflags, linkflags and +# linker-type. Accepted values for linker-type are gnu and sun, gnu being the +# default. +# # Example: # using qcc : 3.4 : : foo bar sun ; +# rule init ( version ? : command * : options * ) { local condition = [ common.check-init-parameters qcc : version $(version) ] ; - local command = [ common.get-invocation-command qcc : QCC : $(command) ] ; - common.handle-options qcc : $(condition) : $(command) : $(options) ; } generators.register-c-compiler qcc.compile.c++ : CPP : OBJ : qcc ; -generators.register-c-compiler qcc.compile.c : C : OBJ : qcc ; +generators.register-c-compiler qcc.compile.c : C : OBJ : qcc ; generators.register-c-compiler qcc.compile.asm : ASM : OBJ : qcc ; -# Declare flags for compilation +# Declare flags for compilation. flags qcc.compile OPTIONS on : -gstabs+ ; -# Declare flags and action for compilation +# Declare flags and action for compilation. flags qcc.compile OPTIONS off : -O0 ; flags qcc.compile OPTIONS speed : -O3 ; flags qcc.compile OPTIONS space : -Os ; @@ -85,69 +82,70 @@ flags qcc.compile OPTIONS shared : -shared ; actions compile.c++ { - "$(CONFIG_COMMAND)" -Wc,-ftemplate-depth-100 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -Wc,-ftemplate-depth-100 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } actions compile.c { - "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } actions compile.asm { - "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" } -# The class which check that we don't try to use -# the static property while creating or using shared library, -# since it's not supported by qcc/libc. + +# The class checking that we do not try to use the static property +# while creating or using a shared library, since it is not supported by qcc/ +# /libc. +# class qcc-linking-generator : unix-linking-generator { rule generated-targets ( sources + : property-set : project name ? ) { - if static in [ $(property-set).raw ] + if static in [ $(property-set).raw ] { local m ; if [ id ] = "qcc.link.dll" { m = "on qcc, DLL can't be build with static" ; - } - if ! $(m) { + } + if ! $(m) + { for local s in $(sources) { local type = [ $(s).type ] ; - if $(type) && [ type.is-derived $(type) SHARED_LIB ] + if $(type) && [ type.is-derived $(type) SHARED_LIB ] { m = "on qcc, using DLLS together with the static options is not possible " ; - } - } + } + } } if $(m) { - errors.user-error $(m) : - "it's suggested to use static together with the static" ; + errors.user-error $(m) : "It is suggested to use" + "static together with static." ; } - } - - return [ unix-linking-generator.generated-targets + + return [ unix-linking-generator.generated-targets $(sources) : $(property-set) : $(project) $(name) ] ; - } + } } -generators.register [ new qcc-linking-generator qcc.link : LIB OBJ : EXE +generators.register [ new qcc-linking-generator qcc.link : LIB OBJ : EXE : qcc ] ; -generators.register [ new qcc-linking-generator qcc.link.dll : LIB OBJ : SHARED_LIB - : qcc ] ; +generators.register [ new qcc-linking-generator qcc.link.dll : LIB OBJ + : SHARED_LIB : qcc ] ; generators.override qcc.prebuilt : builtin.prebuilt ; generators.override qcc.searched-lib-generator : searched-lib-generator ; - -# Declare flags for linking -# First, the common flags +# Declare flags for linking. +# First, the common flags. flags qcc.link OPTIONS on : -gstabs+ ; flags qcc.link OPTIONS on : -p ; flags qcc.link OPTIONS ; @@ -158,8 +156,8 @@ flags qcc.link LIBRARIES ; flags qcc.link FINDLIBS-SA : m ; -# For static we made sure there are no dynamic libraries -# in the link +# For static we made sure there are no dynamic libraries in the +# link. flags qcc.link OPTIONS static : -static ; # Assuming this is just like with gcc. @@ -167,47 +165,42 @@ flags qcc.link RPATH : : unchecked ; flags qcc.link RPATH_LINK : : unchecked ; - -# Declare actions for linking +# Declare actions for linking. +# rule link ( targets * : sources * : properties * ) { - SPACE on $(targets) = " " ; - # Serialize execution of the 'link' action, since - # running N links in parallel is just slower. - # For now, serialize only qcc links, it might be a good - # idea to serialize all links. + SPACE on $(targets) = " " ; + # Serialize execution of the 'link' action, since running N links in + # parallel is just slower. For now, serialize only qcc links while it might + # be a good idea to serialize all links. JAM_SEMAPHORE on $(targets) = qcc-link-semaphore ; } actions link bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) } -# Always remove archive and start again. Here's rationale from -# Andre Hentz: -# I had a file, say a1.c, that was included into liba.a. -# I moved a1.c to a2.c, updated my Jamfiles and rebuilt. -# My program was crashing with absurd errors. -# After some debugging I traced it back to the fact that a1.o was *still* -# in liba.a +# Always remove archive and start again. Here is the rationale from Andre Hentz: +# I had a file, say a1.c, that was included into liba.a. I moved a1.c to a2.c, +# updated my Jamfiles and rebuilt. My program was crashing with absurd errors. +# After some debugging I traced it back to the fact that a1.o was *still* in +# liba.a RM = [ common.rm-command ] ; - if [ os.name ] = NT { RM = "if exist \"$(<[1])\" DEL \"$(<[1])\"" ; } -# Declare action for creating static libraries -# The 'r' letter means to add files to the archive with replacement -# Since we remove archive, we don't care about replacement, but -# there's no option "add without replacement". -# The 'c' letter means suppresses warning in case the archive -# does not exists yet. That warning is produced only on -# some platforms, for whatever reasons. -actions piecemeal archive +# Declare action for creating static libraries. The 'r' letter means to add +# files to the archive with replacement. Since we remove the archive, we do not +# care about replacement, but there is no option to "add without replacement". +# The 'c' letter suppresses warnings in case the archive does not exists yet. +# That warning is produced only on some platforms, for whatever reasons. +# +actions piecemeal archive { $(RM) "$(<)" ar rc "$(<)" "$(>)" @@ -216,13 +209,14 @@ actions piecemeal archive rule link.dll ( targets * : sources * : properties * ) { - SPACE on $(targets) = " " ; + SPACE on $(targets) = " " ; JAM_SEMAPHORE on $(targets) = qcc-link-semaphore ; } + # Differ from 'link' above only by -shared. +# actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" $(HAVE_SONAME)-Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA) $(OPTIONS) } -