diff options
author | Robert Kern <robert.kern@gmail.com> | 2008-07-19 01:12:16 +0000 |
---|---|---|
committer | Robert Kern <robert.kern@gmail.com> | 2008-07-19 01:12:16 +0000 |
commit | c003f55e3068e99b174a3407aab0499662cdbfb2 (patch) | |
tree | 1d185f464f4db8e3286aa0f772e8666af8d87dd6 /numpy/distutils/misc_util.py | |
parent | f3bef65f681d7a845a699071a0b11f3e5d68fea5 (diff) | |
download | numpy-c003f55e3068e99b174a3407aab0499662cdbfb2.tar.gz |
Generate headers in the right place for inplace builds.
Diffstat (limited to 'numpy/distutils/misc_util.py')
-rw-r--r-- | numpy/distutils/misc_util.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py index 30a5014aa..96311b311 100644 --- a/numpy/distutils/misc_util.py +++ b/numpy/distutils/misc_util.py @@ -114,9 +114,20 @@ def njoin(*path): def get_mathlibs(path=None): """Return the MATHLIB line from numpyconfig.h """ - if path is None: - path = os.path.join(get_numpy_include_dirs()[0], 'numpy') - config_file = os.path.join(path,'numpyconfig.h') + if path is not None: + config_file = os.path.join(path,'numpyconfig.h') + else: + # Look for the file in each of the numpy include directories. + dirs = get_numpy_include_dirs() + for path in dirs: + fn = os.path.join(path,'numpyconfig.h') + if os.path.exists(fn): + config_file = fn + break + else: + raise DistutilsError('numpyconfig.h not found in numpy include ' + 'dirs %r' % (dirs,)) + fid = open(config_file) mathlibs = [] s = '#define MATHLIB' |