summaryrefslogtreecommitdiff
path: root/numpy/distutils/command/build_src.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-08-04 16:23:10 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-08-04 16:23:10 +0000
commite74c00e2774b258680c97cd44a00c71ca4abc278 (patch)
tree1b40bdc5b8c5bbc66469b081e1f48d26333fce2b /numpy/distutils/command/build_src.py
parentb9b85f81702ebeaed6b39eff40d12fe2b05a2a27 (diff)
downloadnumpy-e74c00e2774b258680c97cd44a00c71ca4abc278.tar.gz
BUG: fix building of npy-pkg-config file so that one can reliably get the install prefix from the install command,
Diffstat (limited to 'numpy/distutils/command/build_src.py')
-rw-r--r--numpy/distutils/command/build_src.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/numpy/distutils/command/build_src.py b/numpy/distutils/command/build_src.py
index 15e78eebc..c7249c243 100644
--- a/numpy/distutils/command/build_src.py
+++ b/numpy/distutils/command/build_src.py
@@ -5,6 +5,7 @@ import os
import re
import sys
import shlex
+import copy
from distutils.command import build_ext
from distutils.dep_util import newer_group, newer
@@ -144,6 +145,7 @@ class build_src(build_ext.build_ext):
setattr(self, c, v)
def run(self):
+ log.info("build_src")
if not (self.extensions or self.libraries):
return
self.build_sources()
@@ -228,9 +230,16 @@ class build_src(build_ext.build_ext):
return full_install_dir, generated_path
def build_npy_pkg_config(self):
- log.info('building npkg modules')
-
- install_cmd = get_cmd('install')
+ log.info('build_src: building npy-pkg config files')
+
+ # XXX: another ugly workaround to circumvent distutils brain damage. We
+ # need the install prefix here, but finalizing the options of the
+ # install command when only building sources cause error. Instead, we
+ # copy the install command instance, and finalize the copy so that it
+ # does not disrupt how distutils want to do things when with the
+ # original install command instance.
+ install_cmd = copy.copy(get_cmd('install'))
+ install_cmd.finalize_options()
build_npkg = False
gd = {}
if hasattr(install_cmd, 'install_libbase'):