$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r85183 - in trunk/tools/build/v2: build tools
From: steven_at_[hidden]
Date: 2013-08-01 11:49:37
Author: steven_watanabe
Date: 2013-08-01 11:49:37 EDT (Thu, 01 Aug 2013)
New Revision: 85183
URL: http://svn.boost.org/trac/boost/changeset/85183
Log:
Apply Bjorn Roald's patch for generating header links in git.
Text files modified: 
   trunk/tools/build/v2/build/configure.jam |   125 +++++++++++++++++++++------------------ 
   trunk/tools/build/v2/tools/link.jam      |    26 +++----                                 
   2 files changed, 80 insertions(+), 71 deletions(-)
Modified: trunk/tools/build/v2/build/configure.jam
==============================================================================
--- trunk/tools/build/v2/build/configure.jam	Thu Aug  1 11:18:00 2013	(r85182)
+++ trunk/tools/build/v2/build/configure.jam	2013-08-01 11:49:37 EDT (Thu, 01 Aug 2013)	(r85183)
@@ -123,10 +123,71 @@
     }
 }
 
+# Attempts to build a set of virtual targets
+rule try-build ( targets * : ps : what : retry ? )
+{
+   local cache-name = $(what) [ $(ps).raw ] ;
+   cache-name = $(cache-name:J=-) ;
+   local value = [ config-cache.get $(cache-name) ] ;
+        
+    local result ;
+    local jam-targets ;
 
-# Attempt to build a metatarget named by 'metatarget-reference' in context of
-# 'project' with properties 'ps'. Returns non-empty value if build is OK.
-#
+    for local t in $(targets)
+    {
+        jam-targets += [ $(t).actualize ] ;
+    }
+         
+    if $(value)
+    {
+        local x = [ PAD "    - $(what)" : $(.width) ] ; 
+        if $(value) = true
+        {
+            .$(what)-supported.$(ps) = yes ;
+            result = true ;
+            log-check-result "$(x) : yes (cached)" ;
+        }
+        else
+        {
+            log-check-result "$(x) : no  (cached)" ;
+        }
+    }       
+    else if ! UPDATE_NOW in [ RULENAMES ]
+    {
+        # Cannot determine. Assume existance.
+    }
+    else
+    {
+        local x = [ PAD "    - $(what)" : $(.width) ] ;
+        if [ UPDATE_NOW $(jam-targets) :
+             $(.log-fd) : ignore-minus-n : ignore-minus-q ]
+        {
+            .$(what)-supported.$(ps) = yes ;
+            result = true ;
+            log-check-result "$(x) : yes" ;
+        }
+        else
+        {
+            log-check-result "$(x) : no" ;
+        }
+    }
+    if ! $(value)
+    {
+        if $(result)
+        {
+            config-cache.set $(cache-name) : true ;
+        }
+        else
+        {
+            config-cache.set $(cache-name) : false ;
+        }
+    }        
+    return $(result) ;
+}
+
+# Attempt to build a metatarget named by 'metatarget-reference'
+# in context of 'project' with properties 'ps'.
+# Returns non-empty value if build is OK.
 rule builds-raw ( metatarget-reference : project : ps : what : retry ? )
 {
     local result ;
@@ -135,64 +196,14 @@
     {
         .$(what)-tested.$(ps) = true ;
 
-        local cache-name = $(what) [ $(ps).raw ] ;
-        cache-name = $(cache-name:J=-) ;
-        local value = [ config-cache.get $(cache-name) ] ;
-        
         local targets = [ targets.generate-from-reference 
             $(metatarget-reference) : $(project) : $(ps) ] ;
 
-        local jam-targets ;
-        for local t in $(targets[2-])
-        {
-            jam-targets += [ $(t).actualize ] ;
-        }
-             
-        if $(value)
-        {
-            local x = [ PAD "    - $(what)" : $(.width) ] ; 
-            if $(value) = true
-            {
-                .$(what)-supported.$(ps) = yes ;
-                result = true ;
-                log-check-result "$(x) : yes (cached)" ;
-            }
-            else
-            {
-                log-check-result "$(x) : no  (cached)" ;
-            }
-        }       
-        else if ! UPDATE_NOW in [ RULENAMES ]
-        {
-            # Cannot determine. Assume existance.
-        }
-        else
-        {
-            local x = [ PAD "    - $(what)" : $(.width) ] ;
-            if [ UPDATE_NOW $(jam-targets) :
-                 $(.log-fd) : ignore-minus-n : ignore-minus-q ]
-            {
-                .$(what)-supported.$(ps) = yes ;
-                result = true ;
-                log-check-result "$(x) : yes" ;
-            }
-            else
-            {
-                log-check-result "$(x) : no" ;
-            }
-        }
-        if ! $(value)
-        {
-            if $(result)
-            {
-                config-cache.set $(cache-name) : true ;
-            }
-            else
-            {
-                config-cache.set $(cache-name) : false ;
-            }
-        }        
+        result = [ try-build $(targets[2-]) : $(ps) : $(what) : $(retry) ] ;
+        .$(what)-supported.$(ps) = $(result) ;
+
         return $(result) ;
+
     }
     else
     {
Modified: trunk/tools/build/v2/tools/link.jam
==============================================================================
--- trunk/tools/build/v2/tools/link.jam	Thu Aug  1 11:18:00 2013	(r85182)
+++ trunk/tools/build/v2/tools/link.jam	2013-08-01 11:49:37 EDT (Thu, 01 Aug 2013)	(r85183)
@@ -10,6 +10,7 @@
 import configure ;
 import path ;
 import property ;
+import property-set ;
 import common ;
 
 rule get-root-project ( project )
@@ -33,7 +34,7 @@
    $(TOUCH) "$(<)"
 }
 
-rule can-symlink ( project )
+rule can-symlink ( project : ps )
 {
     if ! $(.can-symlink)
     {
@@ -44,7 +45,7 @@
         local target = [ new file-target test-symlink : :
             $(project) : [ new action $(source-target) : link.mklink ] ] ;
 
-        if [ configure.try-build $(target) : "symlinks supported" ]
+        if [ configure.try-build $(target) : $(ps) : "symlinks supported" ]
         {
             .can-symlink = true ;
         }       
@@ -60,11 +61,10 @@
 }
 
 
-rule can-hardlink ( project )
+rule can-hardlink ( project : ps )
 {
     if ! $(.can-hardlink)
     {
-        # Find the root project.
         local root-project = [ get-root-project $(project) ] ;
 
         local source-target = [ new file-target test-hardlink-source : :
@@ -72,7 +72,7 @@
         local target = [ new file-target test-hardlink : :
             $(project) : [ new action $(source-target) : link.hardlink ] ] ;
 
-        if [ configure.try-build $(target) : "hardlinks supported" ]
+        if [ configure.try-build $(target) : $(ps) : "hardlinks supported" ]
         {
             .can-hardlink = true ;
         }       
@@ -143,10 +143,8 @@
         local files = [ path.glob-tree $(location) : * ] ;
         local targets ;
 
-        if ! [ link.can-symlink $(self.project) ]
-        {
-            link.can-hardlink $(self.project) ;
-        }
+        link.can-symlink $(self.project) : $(property-set) ;
+        link.can-hardlink $(self.project) : $(property-set) ;
 
         if [ $(property-set).get <location> ]
         {
@@ -183,15 +181,15 @@
     local source = [ path.native [ path.relative-to [ path.pwd ] $(>) ] ] ;
     LOCATE on $(target) = . ;
     DEPENDS $(.current-target) : $(target) ;
-    if $(.can-symlink) = true
-    {
-        link.mklink $(target) : $(source) ;
-    }
-    else if $(.can-hardlink) = true
+    if $(.can-hardlink) = true
     {
         DEPENDS $(target) : $(source) ;
         link.hardlink $(target) : $(source) ;
     }
+    else if $(.can-symlink) = true
+    {
+        link.mklink $(target) : $(source) ;
+    }
     else
     {
         DEPENDS $(target) : $(source) ;