Update of /cvsroot/boost/boost/tools/build/v2/tools
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26441

Modified Files:
      Tag: RC_1_34_0
        python.jam 
Log Message:
Fix a bug wherein multiple python interpreters could get set on a
target.  My explanation from a mail to Martin Wille:


  IIUC, your
  configuration looks like:

     using python : 2.4 : ... ;
     using python : 2.4 : ... : : : <toolset>gcc 
<toolset-gcc:version>4.1.2_linux_x86_64 ;
     using python : 2.4 : ... : : : <toolset>gcc 
<toolset-gcc:version>4.1.0_linux_x86_64 ;

  The intention is of course that the latter pythons will be used in
  preference to the former one if their conditions are matched more
  explicitly.  

  We are using the "flags" rule to directly associate the interpreter
  command with targets being built, provided the condition passed is
  matched.

      # Set up the PYTHON variable to point at the interpreter.
      flags python.capture-output PYTHON $(condition:J=/) : $(interpreter-cmd) ;

  Here's an excerpt of docs for the condition parameter on flags:

               condition * :    # A condition when this flag should be applied.
                                # Should be set of property sets. If one of
                                # those property sets is contained in build
                                # properties, the flag will be used.

  So what happens is that, because it's less specific, the flags
  invocation for the first python matches when either of the latter
  pythons was supposed to match, and the PYTHON variable that is used to
  hold the interpreter command on the testing target accumulates both
  interpreters.

  We have a mechanism for "choose the closest property match," but it
  doesn't apply to the flags rule: it's target alternatives.  Since we
  define target alternatives for the python library anyway, I think I
  can handle this by creating a property to hold the interpreter command
  and associating it with the appropriate target alternative, then
  keying off *that* command to set up flags.


Index: python.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/python.jam,v
retrieving revision 1.12.2.45
retrieving revision 1.12.2.46
diff -u -d -r1.12.2.45 -r1.12.2.46
--- python.jam  23 Mar 2007 13:35:11 -0000      1.12.2.45
+++ python.jam  23 Mar 2007 14:21:49 -0000      1.12.2.46
@@ -523,6 +523,9 @@
 
 # The version of the python interpreter to use
 feature.feature python : : propagated ;
+feature.feature python.interpreter : : free ;
+
+flags python.capture-output PYTHON : <python.interpreter> ;
 
 # Return a list of candidate commands to try when looking for a Python
 # interpreter.  prefix is expected to be a native path.
@@ -788,9 +791,7 @@
     
     condition += <target-os>$(target-os) ;
     
-    # Set up the PYTHON variable to point at the interpreter.
-    flags python.capture-output PYTHON $(condition:J=/) : $(interpreter-cmd) ;
-    
+    # Set up the PYTHON variable to point at the interpreter.    
     local target-requirements = $(condition) ;
     local system-libs ;
     for local x in [ system-library-dependencies $(target-os) ]
@@ -834,6 +835,8 @@
         dll-path += $(exec-prefix) ;
     }
     
+    local usage-requirements = <include>$(includes) 
<python.interpreter>$(interpreter-cmd) ;
+    
     #
     # Declare the "python" target. This should really be called
     # python_for_embedding
@@ -845,7 +848,7 @@
           : 
           : $(target-requirements)
           :
-          : <include>$(includes) <framework>$(fwk)
+          : $(usage-requirements) <framework>$(fwk)
           ;
     }
     else
@@ -859,7 +862,7 @@
             # the system libs is a mystery, but if we don't do it, on
             # cygwin, -lpythonX.Y never appears in the command line
             # (although it does on linux).
-          : <include>$(includes) <library-path>$(libraries) 
<dll-path>$(dll-path) <library>python.lib
+          : $(usage-requirements) <library-path>$(libraries) 
<dll-path>$(dll-path) <library>python.lib
           ;
     }
     
@@ -884,7 +887,7 @@
                      :  
                      : $(target-requirements)
                      :
-                     : <include>$(includes) 
+                     : $(usage-requirements)
                      ;
     }
 }


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to