$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r59987 - in trunk: . libs/mpi/build libs/python/build
From: ghost_at_[hidden]
Date: 2010-02-28 03:22:47
Author: vladimir_prus
Date: 2010-02-28 03:22:46 EST (Sun, 28 Feb 2010)
New Revision: 59987
URL: http://svn.boost.org/trac/boost/changeset/59987
Log:
Implement --python-buildid.
Fixes #3544.
Patch from Gaudenz Steinlin.
Text files modified: 
   trunk/Jamroot                      |    12 ++++++++++++                            
   trunk/libs/mpi/build/Jamfile.v2    |    20 ++++++++++++++++++++                    
   trunk/libs/python/build/Jamfile.v2 |    20 ++++++++++++++++++++                    
   3 files changed, 52 insertions(+), 0 deletions(-)
Modified: trunk/Jamroot
==============================================================================
--- trunk/Jamroot	(original)
+++ trunk/Jamroot	2010-02-28 03:22:46 EST (Sun, 28 Feb 2010)
@@ -90,6 +90,12 @@
 #   --buildid=ID            Adds the specified ID to the name of built
 #                           libraries.  The default is to not add anything.
 #
+#   --python-buildid=ID     Adds the specified ID to the name of built
+#                           libraries that depend on Python.  The default 
+#                           is to not add anything. This ID is added in 
+#                           addition t --buildid.
+#
+#
 #   --help                  This message.
 #
 #   --with-<library>        Build and install the specified <library>
@@ -352,6 +358,12 @@
     constant BUILD_ID : [ regex.replace $(build-id) "[*\\/:.\"\' ]" "_" ] ;
 }
 
+# Python build id (only for Python libraries)
+local python-id = [ MATCH "^--python-buildid=(.*)" : [ modules.peek : ARGV ] ] ;
+if $(python-id)
+{
+    constant PYTHON_ID : [ regex.replace $(python-id) "[*\\/:.\"\']" "_" ] ;
+}
 
 # This rule is called by Boost.Build to determine the name of target. We use it
 # to encode the build variant, compiler name and boost version in the target
Modified: trunk/libs/mpi/build/Jamfile.v2
==============================================================================
--- trunk/libs/mpi/build/Jamfile.v2	(original)
+++ trunk/libs/mpi/build/Jamfile.v2	2010-02-28 03:22:46 EST (Sun, 28 Feb 2010)
@@ -9,6 +9,7 @@
 #           Andrew Lumsdaine
 
 import mpi ;
+import indirect ;
 import python ;
 
 libraries = ;
@@ -18,8 +19,27 @@
 
 project boost/mpi
   : source-location ../src
+  : requirements
+    -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
+    <tag>@$(__name__).tag
   ;
 
+rule tag ( name : type ? : property-set )
+{
+    local result = $(name) ;
+    if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
+    {
+        if $(name) = boost_mpi_python && $(PYTHON_ID)
+        {
+            result = $(result)-$(PYTHON_ID) ;
+        }
+    }
+    
+    # forward to the boost tagging rule
+    return  [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag 
+                $(result) : $(type) : $(property-set) ] ;
+}
+
 lib boost_mpi 
   : 
     broadcast.cpp
Modified: trunk/libs/python/build/Jamfile.v2
==============================================================================
--- trunk/libs/python/build/Jamfile.v2	(original)
+++ trunk/libs/python/build/Jamfile.v2	2010-02-28 03:22:46 EST (Sun, 28 Feb 2010)
@@ -3,6 +3,7 @@
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
 import os ;
+import indirect ;
 import modules ;
 import feature ;
 
@@ -41,8 +42,27 @@
 
 project boost/python
   : source-location ../src
+  : requirements
+    -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
+    <tag>@$(__name__).tag
   ;
 
+rule tag ( name : type ? : property-set )
+{
+    local result = $(name) ;
+    if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
+    {
+        if $(name) = boost_python && $(PYTHON_ID)
+        {
+            result = $(result)-$(PYTHON_ID) ;
+        }
+    }
+    
+    # forward to the boost tagging rule
+    return  [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag 
+                $(result) : $(type) : $(property-set) ] ;
+}
+
 rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { return $(no) ; } }
 rule unless ( test ? : yes * : no * ) { if ! $(test) { return $(yes) ; } else { return $(no) ; } }