$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r57836 - in trunk/tools/build/v2: . build
From: ghost_at_[hidden]
Date: 2009-11-21 06:49:14
Author: vladimir_prus
Date: 2009-11-21 06:49:13 EST (Sat, 21 Nov 2009)
New Revision: 57836
URL: http://svn.boost.org/trac/boost/changeset/57836
Log:
Permit path-constant with relative path in config files.
Thanks to Johan Nilsson for the bug report.
Text files modified: 
   trunk/tools/build/v2/build-system.jam  |     6 ++++++                                  
   trunk/tools/build/v2/build/targets.jam |    12 +++++++++++-                            
   2 files changed, 17 insertions(+), 1 deletions(-)
Modified: trunk/tools/build/v2/build-system.jam
==============================================================================
--- trunk/tools/build/v2/build-system.jam	(original)
+++ trunk/tools/build/v2/build-system.jam	2009-11-21 06:49:13 EST (Sat, 21 Nov 2009)
@@ -238,6 +238,12 @@
                 "$(filename)" "from" $(where) "." ;
         }
 
+        # Set source location so that path-constant in config files
+        # with relative paths work. This is of most importance
+        # for project-config.jam, but may be used in other
+        # config files as well.
+        local attributes = [ project.attributes $(module-name) ] ;
+        $(attributes).set source-location : $(where:D) : exact ;
         modules.load $(module-name) : $(filename) : $(path) ;
         project.load-used-projects $(module-name) ;
     }
Modified: trunk/tools/build/v2/build/targets.jam
==============================================================================
--- trunk/tools/build/v2/build/targets.jam	(original)
+++ trunk/tools/build/v2/build/targets.jam	2009-11-21 06:49:13 EST (Sat, 21 Nov 2009)
@@ -485,7 +485,17 @@
               local r ;
               for local v in $(value)
               {
-                v = [ path.root [ path.make $(v) ] $(self.location) ] ;
+                local l = $(self.location) ;
+                if ! $(l)
+                {
+                    # Project corresponding to config files do not have 
+                    # 'location' attribute, but do have source location.
+                    # It might be more reasonable to make every project have
+                    # a location and use some other approach to prevent buildable
+                    # targets in config files, but that's for later.
+                    l = [ get source-location ] ;
+                }                
+                v = [ path.root [ path.make $(v) ] $(l) ] ;
                 # Now make the value absolute path.
                 v = [ path.root $(v) [ path.pwd ] ] ;
                 # Constants should be in platform-native form.