Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83884 - trunk/tools/build/v2/test
From: steven_at_[hidden]
Date: 2013-04-13 18:01:37


Author: steven_watanabe
Date: 2013-04-13 18:01:36 EDT (Sat, 13 Apr 2013)
New Revision: 83884
URL: http://svn.boost.org/trac/boost/changeset/83884

Log:
Make sure that we get the long path form of the cwd so that path comparison works correctly.
Text files modified:
   trunk/tools/build/v2/test/MockToolset.py | 22 +++++++++++++++-------
   1 files changed, 15 insertions(+), 7 deletions(-)

Modified: trunk/tools/build/v2/test/MockToolset.py
==============================================================================
--- trunk/tools/build/v2/test/MockToolset.py (original)
+++ trunk/tools/build/v2/test/MockToolset.py 2013-04-13 18:01:36 EDT (Sat, 13 Apr 2013)
@@ -24,6 +24,8 @@
 parser.add_option('--static-lib', dest="static_libraries", action="append")
 parser.add_option('--shared-lib', dest="shared_libraries", action="append")
 
+cwd = os.environ["JAM_CWD"]
+
 class MockInfo(object):
   def __init__(self):
     self.files = dict()
@@ -71,7 +73,7 @@
 
     # Normalize a path for comparison purposes
     def adjust_path(p):
- return os.path.normcase(os.path.abspath(p))
+ return os.path.normcase(os.path.normpath(os.path.join(cwd, p)))
 
     # order matters
     if options.includes is None:
@@ -139,11 +141,17 @@
   t.write('mock.jam', '''
 import feature ;
 import toolset ;
+import path ;
+import modules ;
+import common ;
 
-python-cmd = "\"%s\"" ;
+.python-cmd = "\"%s\"" ;
 
 rule init ( )
 {
+ local here = [ path.make [ modules.binding $(__name__) ] ] ;
+ here = [ path.native [ path.root [ path.parent $(here) ] [ path.pwd ] ] ] ;
+ .config-cmd = [ common.variable-setting-command JAM_CWD : $(here) ] $(.python-cmd) ;
 }
 
 feature.extend toolset : mock ;
@@ -159,12 +167,12 @@
 
 actions compile.c
 {
- $(python-cmd) mock.py -c -x c -I$(INCLUDES) $(>) -o $(<)
+ $(.config-cmd) mock.py -c -x c -I"$(INCLUDES)" "$(>)" -o "$(<)"
 }
 
 actions compile.c++
 {
- $(python-cmd) mock.py -c -x c++ -I$(INCLUDES) $(>) -o $(<)
+ $(.config-cmd) mock.py -c -x c++ -I"$(INCLUDES)" "$(>)" -o "$(<)"
 }
 
 toolset.flags mock.link USER_OPTIONS <linkflags> ;
@@ -175,17 +183,17 @@
 
 actions link
 {
- $(python-cmd) mock.py $(>) -o $(<) $(USER_OPTIONS) -L$(LINK_PATH) --static-lib=$(FINDLIBS-STATIC) --shared-lib=$(FINDLIBS-SHARED)
+ $(.config-cmd) mock.py "$(>)" -o "$(<)" $(USER_OPTIONS) -L"$(LINK_PATH)" --static-lib=$(FINDLIBS-STATIC) --shared-lib=$(FINDLIBS-SHARED)
 }
 
 actions archive
 {
- $(python-cmd) mock.py --archive $(>) -o $(<) $(USER_OPTIONS)
+ $(.config-cmd) mock.py --archive "$(>)" -o "$(<)" $(USER_OPTIONS)
 }
 
 actions link.dll
 {
- $(python-cmd) mock.py --dll $(>) -o $(<) $(USER_OPTIONS) -L$(LINK_PATH) --static-lib=$(FINDLIBS-STATIC) --shared-lib=$(FINDLIBS-SHARED)
+ $(.config-cmd) mock.py --dll "$(>)" -o "$(<)" $(USER_OPTIONS) -L"$(LINK_PATH)" --static-lib=$(FINDLIBS-STATIC) --shared-lib=$(FINDLIBS-SHARED)
 }
 
 ''' % sys.executable.replace('\\', '\\\\'))


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