[Numpy-svn] r4454 - branches/numpy.scons/numpy/distutils/scons/core

numpy-svn@scip... numpy-svn@scip...
Wed Nov 14 00:46:14 CST 2007


Author: cdavid
Date: 2007-11-14 00:46:09 -0600 (Wed, 14 Nov 2007)
New Revision: 4454

Modified:
   branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py
Log:
Fix path handling in GetNumpyEnvironment

Modified: branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py	2007-11-13 16:15:56 UTC (rev 4453)
+++ branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py	2007-11-14 06:46:09 UTC (rev 4454)
@@ -145,9 +145,10 @@
 
     # ===============================================
     # Setting tools according to command line options
-    if not env['ENV'].has_key('PATH'):
-        env['ENV']['PATH'] = []
 
+    # List of supplemental paths to take into account
+    path_list = []
+
     # XXX: how to handle tools which are not in standard location ? Is adding
     # the full path of the compiler enough ? (I am sure some compilers also
     # need LD_LIBRARY_SHARED and other variables to be set, too....)
@@ -170,10 +171,7 @@
                     t = Tool(env['cc_opt'])
                     t(env) 
                     customize_cc(t.name, env)
-                    if sys.platform == 'win32':
-                        env['ENV']['PATH'] += ';%s' % env['cc_opt_path']
-                    else:
-                        env['ENV']['PATH'] += ':%s' % env['cc_opt_path']
+                    path_list.append(env['cc_opt_path'])
             else:
                 # Do not care about PATH info because none given from scons
                 # distutils command
@@ -197,10 +195,7 @@
                 # PATH ? (may not work on windows).
                 t = Tool(env['f77_opt'], toolpath = ['numpy/distutils/scons/tools'])
                 t(env) 
-                if sys.platform == 'win32':
-                    env['ENV']['PATH'] += ';%s' % env['f77_opt_path']
-                else:
-                    env['ENV']['PATH'] += ':%s' % env['f77_opt_path']
+                path_list.append(env['f77_opt_path'])
         except EnvironmentError, e:
             # scons could not understand cc_opt (bad name ?)
             raise AssertionError("SCONS: Could not initialize tool ? Error is %s" % \
@@ -215,6 +210,12 @@
         else:
             print "========== NO FORTRAN COMPILER FOUND ==========="
 
+    if not env['ENV'].has_key('PATH'):
+        env['ENV']['PATH'] = os.pathsep.join(path_list)
+    else:
+        env['ENV']['PATH'] = os.pathsep.join(path_list + env['ENV']['PATH'].split(os.pathsep))
+
+    print env['ENV']['PATH']
     # XXX: Really, we should use our own subclass of Environment, instead of
     # adding Numpy* functions !
 



More information about the Numpy-svn mailing list