Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-06-03 20:51:45


Author: jurko
Date: 2008-06-03 20:51:44 EDT (Tue, 03 Jun 2008)
New Revision: 46109
URL: http://svn.boost.org/trac/boost/changeset/46109

Log:
Made Boost Build's python.jam toolset module work correctly when the python command interpreter executable path contains spaces. This is not supported on Windows with Boost Jam versions prior to 3.1.17. Made python.jam toolset's cygwin symlink detection work correctly with symlinks to .cmd files. Minor stylistic changes.
Text files modified:
   trunk/tools/build/v2/tools/python.jam | 21 +++++++++++++++------
   1 files changed, 15 insertions(+), 6 deletions(-)

Modified: trunk/tools/build/v2/tools/python.jam
==============================================================================
--- trunk/tools/build/v2/tools/python.jam (original)
+++ trunk/tools/build/v2/tools/python.jam 2008-06-03 20:51:44 EDT (Tue, 03 Jun 2008)
@@ -34,6 +34,7 @@
 import feature ;
 import set ;
 import builtin ;
+import version ;
 
 
 # Make this module a project.
@@ -133,7 +134,7 @@
 # Try to identify Cygwin symlinks. Invoking such a file directly as an NT
 # executable from a native Windows build of bjam would be fatal to the bjam
 # process. One /can/ invoke them through sh.exe or bash.exe, if you can prove
-# that those aren't also symlinks ;-)
+# that those aren't also symlinks. ;-)
 #
 # If a symlink is found returns non-empty; we try to extract the target of the
 # symlink from the file and return that.
@@ -145,7 +146,7 @@
 
     # Look for a file with the given path having the S attribute set, as cygwin
     # symlinks do. /-C means "do not use thousands separators in file sizes."
- local dir-listing = [ shell-cmd "DIR /-C /A:S "$(path) ] ;
+ local dir-listing = [ shell-cmd "DIR /-C /A:S \""$(path)"\"" ] ;
 
     if $(dir-listing)
     {
@@ -207,12 +208,12 @@
     {
         dirs = . [ os.executable-path ] ;
     }
- local base = [ default-extension $(cmd:D=) : .exe .bat ] ;
+ local base = [ default-extension $(cmd:D=) : .exe .cmd .bat ] ;
     local paths = [ GLOB $(dirs) : $(base) ] ;
     if $(paths)
     {
- # Make sure we didn't find a Cygwin symlink. Invoking such a
- # file as an NT executable will be fatal to the bjam process.
+ # Make sure we have not run into a Cygwin symlink. Invoking such a file
+ # as an NT executable would be fatal for the bjam process.
         return [ is-cygwin-symlink $(paths[1]) ] ;
     }
 }
@@ -453,7 +454,7 @@
         debug-message If you intend to target a Cygwin build of Python, please ;
         debug-message replace the path to the link with the path to a real executable ;
         debug-message (guessing: \"$(skip-symlink)\") "in" your 'using python' line ;
- debug-message "in" user-config.jam or site-config.jam. Don't forget to escape ;
+ debug-message "in" user-config.jam or site-config.jam. Do not forget to escape ;
         debug-message backslashes ;
         debug-message -------------------------------------------------------------------- ;
     }
@@ -474,6 +475,14 @@
         }
 
         # Invoke Python and ask it for all those values.
+ if [ version.check-jam-version 3 1 17 ] || ( [ os.name ] != NT )
+ {
+ # Prior to version 3.1.17 Boost Jam's SHELL command did not support
+ # quoted commands correctly on Windows. This means that on that
+ # platform we do not support using a Python command interpreter
+ # executable whose path contains a space character.
+ python-cmd = \"$(python-cmd)\" ;
+ }
         local full-cmd =
             $(python-cmd)" -c \"from sys import *; print '"$(format:J=\\n)"' % ("$(exprs:J=,)")\"" ;
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk