summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-06-12 06:35:22 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-06-12 06:35:22 +0000
commite0b47b1e27dc8e6d1005598f517e1ab568d4805e (patch)
tree07fbd8099bf8c09097efaae07feefc2b7d44bbce
parent327a4d2a4a78c538db5797b05379a3a7c52b2d23 (diff)
downloadnumpy-e0b47b1e27dc8e6d1005598f517e1ab568d4805e.tar.gz
scons command: set distutils libdir relatively to build directory.
-rw-r--r--numpy/distutils/command/scons.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/numpy/distutils/command/scons.py b/numpy/distutils/command/scons.py
index fbbf525f3..05b5de0cc 100644
--- a/numpy/distutils/command/scons.py
+++ b/numpy/distutils/command/scons.py
@@ -38,6 +38,14 @@ def get_scons_local_path():
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 @@ class scons(old_build_ext):
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)