[Numpy-svn] r4135 - in branches/numpy.scons/numpy/distutils: command scons

numpy-svn@scip... numpy-svn@scip...
Tue Sep 25 10:48:36 CDT 2007


Author: cdavid
Date: 2007-09-25 10:47:58 -0500 (Tue, 25 Sep 2007)
New Revision: 4135

Modified:
   branches/numpy.scons/numpy/distutils/command/scons.py
   branches/numpy.scons/numpy/distutils/scons/__init__.py
Log:
 * Always initialize compiler in scons builder so that the compiler path is found
 * Put quotes around directories passed to scons, to avoid problems when spaces are in path variables.

Modified: branches/numpy.scons/numpy/distutils/command/scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/scons.py	2007-09-25 15:41:49 UTC (rev 4134)
+++ branches/numpy.scons/numpy/distutils/command/scons.py	2007-09-25 15:47:58 UTC (rev 4135)
@@ -52,6 +52,8 @@
         # this is harcoded in distutils... A bit cleaner way would be to
         # initialize the compiler instance and then get compiler.cc, but this
         # may be costly: we really just want a string.
+        #compiler.initialize()
+        #print compiler.cc
         return 'cl.exe' 
     else:
         return compiler.compiler[0]
@@ -93,7 +95,10 @@
                                      dry_run=self.dry_run,
                                      force=self.force)
         self.compiler.customize(self.distribution)
-
+		
+		# This initialization seems necessary, sometimes, for find_executable to work...
+        self.compiler.initialize()
+		
         #print "++++++++++++++++++++++++++++++++++++++++"
         #print "self.compiler is %s, this gives us scons tool %s" % (compiler_type, 
         #                                                 dist2sconscc(self.compiler))
@@ -120,10 +125,10 @@
         scons_exec += ' "' + pjoin(get_scons_local_path(), 'scons.py') + '"'
         for i in self.scons_scripts:
             cmd = scons_exec + " -f " + i + ' -I. '
-            cmd += ' src_dir=%s ' % pdirname(i)
-            cmd += ' distutils_libdir=%s ' % pjoin(self.build_lib, pdirname(i))
+            cmd += ' src_dir="%s" ' % pdirname(i)
+            cmd += ' distutils_libdir="%s" ' % pjoin(self.build_lib, pdirname(i))
             cmd += ' cc_opt=%s ' % dist2sconscc(self.compiler)
-            cmd += ' cc_opt_path=%s ' % get_tool_path(self.compiler)
+            cmd += ' cc_opt_path="%s" ' % get_tool_path(self.compiler)
             print cmd
             st = os.system(cmd)
             if st:

Modified: branches/numpy.scons/numpy/distutils/scons/__init__.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-09-25 15:41:49 UTC (rev 4134)
+++ branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-09-25 15:47:58 UTC (rev 4135)
@@ -129,7 +129,7 @@
     for t in FindAllTools(DEF_OTHER_TOOLS, env):
         Tool(t)(env)
 
-    print env.Dump()
+    #print env.Dump()
     #print Environment().Dump('TOOLS')
     # Adding custom builder
     env['BUILDERS']['NumpySharedLibrary'] = NumpySharedLibrary



More information about the Numpy-svn mailing list