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

numpy-svn@scip... numpy-svn@scip...
Tue Sep 25 04:07:31 CDT 2007


Author: cdavid
Date: 2007-09-25 04:07:17 -0500 (Tue, 25 Sep 2007)
New Revision: 4124

Modified:
   branches/numpy.scons/numpy/distutils/command/scons.py
   branches/numpy.scons/numpy/distutils/scons/__init__.py
Log:
 * Do not use default list of tools when creating scons environment.
 * Add mingw convertion between distutils name and scons name.

Modified: branches/numpy.scons/numpy/distutils/command/scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/scons.py	2007-09-25 03:47:10 UTC (rev 4123)
+++ branches/numpy.scons/numpy/distutils/command/scons.py	2007-09-25 09:07:17 UTC (rev 4124)
@@ -22,6 +22,8 @@
         return 'msvc'
     elif compiler.compiler_type == 'intel':
         return 'intelc'
+    elif compiler.compiler_type == 'mingw32':
+        return 'mingw'
     else:
         return compiler.compiler[0]
 
@@ -96,7 +98,7 @@
 
         # XXX: does this work everywhere in all situations ? This assumes
         # scons.py is executable.
-        scons_exec = pjoin(get_scons_local_path(), 'scons.py')
+        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)

Modified: branches/numpy.scons/numpy/distutils/scons/__init__.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-09-25 03:47:10 UTC (rev 4123)
+++ branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-09-25 09:07:17 UTC (rev 4124)
@@ -1,6 +1,7 @@
 from os.path import join as pjoin
 import os.path
 import ConfigParser
+import sys
 
 from SCons.Options import Options
 from SCons.Tool import Tool
@@ -62,7 +63,9 @@
     # XXX: I would prefer subclassing Environment, because we really expect
     # some different behaviour than just Environment instances...
     opts = GetNumpyOptions(args)
-    env = Environment(options = opts)
+    # We set tools to an empty list, to be sure that the custom options are
+    # given first. At the end, we add the default tool.
+    env = Environment(options = opts, tools = [])
 
     # Setting dirs according to command line options
     env.AppendUnique(build_dir = pjoin(env['build_prefix']))
@@ -86,7 +89,13 @@
                 else:
                     # XXX: what is the right way to add one directory in the
                     # PATH ? (may not work on windows).
-                    env['ENV']['PATH'] += ':%s' % env['cc_opt_path']
+                    t = Tool(env['cc_opt'])
+                    t(env) 
+		    #env.Tool(env['cc_opt'])
+		    if sys.platform == 'win32':
+		        env['ENV']['PATH'] += ';%s' % env['cc_opt_path']
+		    else:
+		        env['ENV']['PATH'] += ':%s' % env['cc_opt_path']
             else:
                 t = Tool(env['cc_opt'])
                 t(env) 
@@ -95,6 +104,9 @@
             raise AssertionError("SCONS: Could not initialize tool ? Error is %s" % \
                                  str(e))
 
+    #print env.Dump('TOOLS')
+    #t = Tool('default')
+    #t(env)
     # Adding custom builder
     env['BUILDERS']['NumpySharedLibrary'] = NumpySharedLibrary
     env['BUILDERS']['NumpyCTypes'] = NumpyCTypes



More information about the Numpy-svn mailing list