From ef596cdd64b2c30955dd39ae6e4bdb6ea01ef37a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 11 Apr 2005 06:35:08 +0000 Subject: [PATCH] All projects without explicit root are now children of user-config and user-config is a child of site-config. [SVN r28095] --- v2/build-system.jam | 50 ++++++++++++++++++++--------- v2/build/project.jam | 75 +++++++++++++++++++++++++++----------------- 2 files changed, 82 insertions(+), 43 deletions(-) diff --git a/v2/build-system.jam b/v2/build-system.jam index 22aacdc0d..5a2d1683d 100755 --- a/v2/build-system.jam +++ b/v2/build-system.jam @@ -33,34 +33,54 @@ import version ; local test-config = [ GLOB [ modules.peek : BOOST_BUILD_PATH ] : test-config.jam ] ; if $(test-config) { + module test-config + { + import project : _using : using ; + } import test-config ; } -if ! $(test-config) && ! --ignore-config in [ modules.peek : ARGV ] +local ignore-config ; +if $(test-config) || --ignore-config in [ modules.peek : ARGV ] { - module site-config - { - import toolset : using ; - } + ignore-config = true ; +} - module user-config - { - import toolset : using ; - } - - local user-path = [ modules.peek : HOME ] [ modules.peek : BOOST_BUILD_PATH ] ; +local user-path = [ modules.peek : HOME ] [ modules.peek : BOOST_BUILD_PATH ] ; + +# Load site-config. +module site-config +{ + import project : initialize ; + initialize site-config ; +} + +if ! $(ignore-config) +{ if [ os.name ] in NT CYGWIN { - modules.load site-config : : [ modules.peek : SystemRoot ] $(user-path) ; - modules.load user-config : : $(user-path) ; - } + modules.load site-config : : [ modules.peek : SystemRoot ] $(user-path) ; + } else { modules.load site-config : : /etc $(user-path) ; - modules.load user-config : : $(user-path) ; } } + +# Load user-config. +module user-config +{ + import project : initialize ; + initialize user-config ; +} + +if ! $(ignore-config) +{ + modules.load user-config : : $(user-path) ; +} + + if USER_MODULE in [ RULENAMES ] { USER_MODULE site-config user-config ; diff --git a/v2/build/project.jam b/v2/build/project.jam index 2ac430321..e25abad89 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -379,37 +379,52 @@ rule initialize ( # defined at the end of this file. modules.clone-rules project-rules $(module-name) ; - # We search for parent/project-root only if jamfile was specified --- i.e - # if the project is not standalone. - if $(location) - { - local parent-module ; - if ! $(basename) in $(JAMROOT) + local parent-module ; + if $(module-name) = site-config + { + # No parent. + } + else if $(module-name) = user-config + { + parent-module = site-config ; + } + else + { + # We search for parent/project-root only if jamfile was specified + # --- i.e + # if the project is not standalone. + if $(location) && ! $(basename) in $(JAMROOT) { parent-module = [ load-parent $(location) ] ; - inherit-attributes $(module-name) : $(parent-module) ; - } - - local parent ; - if $(parent-module) + } + else { - parent = [ target $(parent-module) ] ; - } + parent-module = user-config ; + } + } + + if $(parent-module) + { + inherit-attributes $(module-name) : $(parent-module) ; + } + + local parent ; + if $(parent-module) + { + parent = [ target $(parent-module) ] ; + } - if ! $(.target.$(module-name)) + if ! $(.target.$(module-name)) + { + .target.$(module-name) = [ new project-target $(module-name) + : $(module-name) $(parent) + : [ attribute $(module-name) requirements ] ] ; + + if --debug-loading in [ modules.peek : ARGV ] { - .target.$(module-name) = [ new project-target $(module-name) - : $(module-name) $(parent) - : [ attribute $(module-name) requirements ] ] ; - - if --debug-loading in [ modules.peek : ARGV ] - { - ECHO "Assigned project target" $(.target.$(module-name)) - "to '$(module-name)'" ; - } - - - } + ECHO "Assigned project target" $(.target.$(module-name)) + "to '$(module-name)'" ; + } } .current-project = [ target $(module-name) ] ; @@ -420,8 +435,12 @@ rule inherit-attributes ( project-module : parent-module ) { local attributes = $($(project-module).attributes) ; local pattributes = [ attributes $(parent-module) ] ; - $(attributes).set parent : [ path.parent - [ path.make [ modules.binding $(parent-module) ] ] ] ; + # Parent module might be locationless user-config. + if [ modules.binding $(parent-module) ] + { + $(attributes).set parent : [ path.parent + [ path.make [ modules.binding $(parent-module) ] ] ] ; + } $(attributes).set default-build : [ $(pattributes).get default-build ] ; $(attributes).set requirements