summaryrefslogtreecommitdiff
path: root/numpy/distutils/command/scons.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-07-26 11:05:56 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-07-26 11:05:56 +0000
commit3131612bc4e067dc254dbff80d9b5afa80b91f4b (patch)
tree25b1835cef7ef7bf8e1d82e4c2accf578ba18236 /numpy/distutils/command/scons.py
parentdd92ae0449704ce9e250d2251a93826fda7c74f1 (diff)
downloadnumpy-3131612bc4e067dc254dbff80d9b5afa80b91f4b.tar.gz
Support for installable libraries in numscons.
Numscons has been modified such as clib are now copied (using the Install builder) where numpy.distutils expect them, and a function has been added to numpy.distutils so that we can add installable libraries in setupscons.py scripts (which add the library to the NumpyDistribution instance).
Diffstat (limited to 'numpy/distutils/command/scons.py')
-rw-r--r--numpy/distutils/command/scons.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/numpy/distutils/command/scons.py b/numpy/distutils/command/scons.py
index f733dc4b2..a8707c106 100644
--- a/numpy/distutils/command/scons.py
+++ b/numpy/distutils/command/scons.py
@@ -54,6 +54,18 @@ def get_distutils_libdir(cmd, pkg):
n = scdir.count(os.sep)
return pjoin(os.sep.join([os.pardir for i in range(n+1)]), cmd.build_lib)
+def get_distutils_clibdir(cmd, pkg):
+ """Returns the path where distutils put pure C libraries."""
+ # XXX: this mess is necessary because scons is launched per package, and
+ # has no knowledge outside its build dir, which is package dependent. If
+ # one day numscons does not launch one process/package, this will be
+ # unnecessary.
+ from numscons import get_scons_build_dir
+ from numscons.core.utils import pkg_to_path
+ scdir = pjoin(get_scons_build_dir(), pkg_to_path(pkg))
+ n = scdir.count(os.sep)
+ return pjoin(os.sep.join([os.pardir for i in range(n+1)]), cmd.build_temp)
+
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,
@@ -422,6 +434,8 @@ class scons(old_build_ext):
# pdirname(sconscript))))
cmd.append('distutils_libdir=%s' %
protect_path(get_distutils_libdir(self, pkg_name)))
+ cmd.append('distutils_clibdir=%s' %
+ protect_path(get_distutils_clibdir(self, pkg_name)))
if not self._bypass_distutils_cc:
cmd.append('cc_opt=%s' % self.scons_compiler)