From dc3f8a8a56685b83b28ea6572948fc633ada1c15 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 19 Dec 2001 22:58:18 +0000 Subject: [PATCH] integrate Rene's variant inheritance and hacks fix for declaration of SHARED_TYPES [SVN r12129] --- boost-base.jam | 62 +++++++++++++++++++++++++++++++++++++++++------ v1/boost-base.jam | 62 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 108 insertions(+), 16 deletions(-) diff --git a/boost-base.jam b/boost-base.jam index e99530db3..c3bd0ad00 100644 --- a/boost-base.jam +++ b/boost-base.jam @@ -76,6 +76,8 @@ else TOOLS ?= gcc ; } +SHARED_TYPES = DLL ; + # detect-build-tools : # # Declares a pseudotarget for the specified build tools which is built by @@ -630,13 +632,29 @@ rule relevant-features # name return $(gRELEVANT_FEATURES($(<))) ; } -# variant name : []value... +# variant name [ : parents... ] : []value... # # Declare a build variant, whose configuration is given by the given (optionally # toolset-qualified) properties. -rule variant ( name : tool-properties * ) +rule variant ( name : parents-or-properties * : tool-properties * ) { - gALL_VARIANTS += $(name) + gALL_VARIANTS += $(name) ; + local parents ; + if ! $(tool-properties) + { + if $(parents-or-properties[1]:G) + { + tool-properties = $(parents-or-properties) ; + } + else + { + parents = $(parents-or-properties) ; + } + } + else + { + parents = $(parents-or-properties) ; + } local toolset ; for toolset in $(TOOLS) { @@ -647,8 +665,28 @@ rule variant ( name : tool-properties * ) # is neccessary to get the relevant-features correctly set. We supply # the variant name as the target name, so that error messages will look # coherent. - gBASE_PROPERTIES($(toolset),$(name)) - = [ sort [ select-properties $(toolset) $(toolset) $(name) : $(tool-properties) ] ] ; + local name-properties + = [ select-properties $(toolset) $(toolset) $(name) : $(tool-properties) ] ; + if $(parents) + { + local parent ; + for parent in $(parents) + { + local parent-properties + = $(gBASE_PROPERTIES($(toolset),$(parent))) ; + local inherited-features + = [ unique + [ difference $(parent-properties:G) : $(name-properties:G) ] + $(gFREE_FEATURES) + $(gPATH_FEATURES) + $(gDEPENDENCY_FEATURES ] ; + local inherited-properties + = [ get-properties $(inherited-features) : $(parent-properties) ] ; + name-properties + += $(inherited-properties) ; + } + } + gBASE_PROPERTIES($(toolset),$(name)) = [ sort $(name-properties) ] ; } } @@ -1381,8 +1419,6 @@ rule main-target } } -SHARED_TYPES = DLL ; - gGENERATOR_FUNCTION(EXE) = executable-file ; # exe target : sources : requirements : local-build # @@ -1407,7 +1443,17 @@ gGENERATOR_FUNCTION(LIB) = library-file ; # Declare a statically-linked library target. rule lib { - declare-local-target $(<) : $(2) : $(3) : $(4) : LIB ; + local suppress = [ get-values : $(4) ] ; + if $(suppress) + { + local gSUPPRESS_FAKE_TARGETS = $(suppress[1]) ; + declare-local-target $(<) : $(2) : $(3) : + [ difference $(4) : [ get-properties : $(4) ] ] : LIB ; + } + else + { + declare-local-target $(<) : $(2) : $(3) : $(4) : LIB ; + } } # unit-test target : sources : requirements : local-build diff --git a/v1/boost-base.jam b/v1/boost-base.jam index e99530db3..c3bd0ad00 100644 --- a/v1/boost-base.jam +++ b/v1/boost-base.jam @@ -76,6 +76,8 @@ else TOOLS ?= gcc ; } +SHARED_TYPES = DLL ; + # detect-build-tools : # # Declares a pseudotarget for the specified build tools which is built by @@ -630,13 +632,29 @@ rule relevant-features # name return $(gRELEVANT_FEATURES($(<))) ; } -# variant name : []value... +# variant name [ : parents... ] : []value... # # Declare a build variant, whose configuration is given by the given (optionally # toolset-qualified) properties. -rule variant ( name : tool-properties * ) +rule variant ( name : parents-or-properties * : tool-properties * ) { - gALL_VARIANTS += $(name) + gALL_VARIANTS += $(name) ; + local parents ; + if ! $(tool-properties) + { + if $(parents-or-properties[1]:G) + { + tool-properties = $(parents-or-properties) ; + } + else + { + parents = $(parents-or-properties) ; + } + } + else + { + parents = $(parents-or-properties) ; + } local toolset ; for toolset in $(TOOLS) { @@ -647,8 +665,28 @@ rule variant ( name : tool-properties * ) # is neccessary to get the relevant-features correctly set. We supply # the variant name as the target name, so that error messages will look # coherent. - gBASE_PROPERTIES($(toolset),$(name)) - = [ sort [ select-properties $(toolset) $(toolset) $(name) : $(tool-properties) ] ] ; + local name-properties + = [ select-properties $(toolset) $(toolset) $(name) : $(tool-properties) ] ; + if $(parents) + { + local parent ; + for parent in $(parents) + { + local parent-properties + = $(gBASE_PROPERTIES($(toolset),$(parent))) ; + local inherited-features + = [ unique + [ difference $(parent-properties:G) : $(name-properties:G) ] + $(gFREE_FEATURES) + $(gPATH_FEATURES) + $(gDEPENDENCY_FEATURES ] ; + local inherited-properties + = [ get-properties $(inherited-features) : $(parent-properties) ] ; + name-properties + += $(inherited-properties) ; + } + } + gBASE_PROPERTIES($(toolset),$(name)) = [ sort $(name-properties) ] ; } } @@ -1381,8 +1419,6 @@ rule main-target } } -SHARED_TYPES = DLL ; - gGENERATOR_FUNCTION(EXE) = executable-file ; # exe target : sources : requirements : local-build # @@ -1407,7 +1443,17 @@ gGENERATOR_FUNCTION(LIB) = library-file ; # Declare a statically-linked library target. rule lib { - declare-local-target $(<) : $(2) : $(3) : $(4) : LIB ; + local suppress = [ get-values : $(4) ] ; + if $(suppress) + { + local gSUPPRESS_FAKE_TARGETS = $(suppress[1]) ; + declare-local-target $(<) : $(2) : $(3) : + [ difference $(4) : [ get-properties : $(4) ] ] : LIB ; + } + else + { + declare-local-target $(<) : $(2) : $(3) : $(4) : LIB ; + } } # unit-test target : sources : requirements : local-build