[Numpy-svn] r5275 - trunk/numpy/distutils/command

numpy-svn@scip... numpy-svn@scip...
Thu Jun 12 04:48:47 CDT 2008


Author: cdavid
Date: 2008-06-12 04:48:42 -0500 (Thu, 12 Jun 2008)
New Revision: 5275

Modified:
   trunk/numpy/distutils/command/scons.py
Log:
Set numpy include path relatively to top setup callee when bootstrapping.

Modified: trunk/numpy/distutils/command/scons.py
===================================================================
--- trunk/numpy/distutils/command/scons.py	2008-06-12 09:01:13 UTC (rev 5274)
+++ trunk/numpy/distutils/command/scons.py	2008-06-12 09:48:42 UTC (rev 5275)
@@ -10,7 +10,6 @@
 from numpy.distutils.fcompiler import FCompiler
 from numpy.distutils.exec_command import find_executable
 from numpy.distutils import log
-from numpy.distutils.misc_util import get_numpy_include_dirs
 
 def get_scons_build_dir():
     """Return the top path where everything produced by scons will be put.
@@ -57,6 +56,21 @@
     import sys
     return sys.executable
 
+def get_numpy_include_dirs(sconscript_path):
+    """Return include dirs for numpy.
+
+    The paths are relatively to the setup.py script path."""
+    from numpy.distutils.misc_util import get_numpy_include_dirs as _incdir
+    from numscons import get_scons_build_dir
+    scdir = pjoin(get_scons_build_dir(), pdirname(sconscript_path))
+    n = scdir.count(os.sep)
+
+    dirs = _incdir()
+    rdirs = []
+    for d in dirs:
+        rdirs.append(pjoin(os.sep.join([os.pardir for i in range(n+1)]), d))
+    return rdirs
+
 def dirl_to_str(dirlist):
     """Given a list of directories, returns a string where the paths are
     concatenated by the path separator.
@@ -387,7 +401,7 @@
                 cmd.append('cxx_opt=%s' % dist2sconscxx(self.cxxcompiler))
                 cmd.append('cxx_opt_path=%s' % protect_path(get_cxx_tool_path(self.cxxcompiler)))
 
-            cmd.append('include_bootstrap=%s' % dirl_to_str(get_numpy_include_dirs()))
+            cmd.append('include_bootstrap=%s' % dirl_to_str(get_numpy_include_dirs(sconscript)))
             if self.silent:
                 if int(self.silent) == 2:
                     cmd.append('-Q')



More information about the Numpy-svn mailing list