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

numpy-svn@scip... numpy-svn@scip...
Thu Jun 12 01:35:26 CDT 2008


Author: cdavid
Date: 2008-06-12 01:35:22 -0500 (Thu, 12 Jun 2008)
New Revision: 5267

Modified:
   trunk/numpy/distutils/command/scons.py
Log:
scons command: set distutils libdir relatively to build directory.

Modified: trunk/numpy/distutils/command/scons.py
===================================================================
--- trunk/numpy/distutils/command/scons.py	2008-06-12 05:45:18 UTC (rev 5266)
+++ trunk/numpy/distutils/command/scons.py	2008-06-12 06:35:22 UTC (rev 5267)
@@ -38,6 +38,14 @@
     from numscons import get_scons_path
     return get_scons_path()
 
+def get_distutils_libdir(cmd):
+    """Returns the path where distutils install libraries, relatively to the
+    scons build directory."""
+    from numscons import get_scons_build_dir
+    scdir = get_scons_build_dir()
+    n = scdir.count(os.sep)
+    return pjoin(os.sep.join([os.pardir for i in range(n+1)]), cmd.build_lib)
+
 def get_python_exec_invoc():
     """This returns the python executable from which this file is invocated."""
     # Do we  need to take into account the PYTHONPATH, in a cross platform way,
@@ -361,7 +369,7 @@
             cmd.append('pkg_name="%s"' % pkg_name)
             #cmd.append('distutils_libdir=%s' % protect_path(pjoin(self.build_lib,
             #                                                    pdirname(sconscript))))
-            cmd.append('distutils_libdir=%s' % protect_path(pjoin(self.build_lib)))
+            cmd.append('distutils_libdir=%s' % protect_path(get_distutils_libdir(self)))
 
             if not self._bypass_distutils_cc:
                 cmd.append('cc_opt=%s' % self.scons_compiler)



More information about the Numpy-svn mailing list