diff options
author | David Cournapeau <cournape@gmail.com> | 2008-07-31 16:31:10 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-07-31 16:31:10 +0000 |
commit | 3f025b5400c0855472a772487de8930bac9b5eef (patch) | |
tree | 4cd722fafc989f2ff13a7611d7f99ad297620891 | |
parent | 23e03f2d320c1303a8fb199bc1f090a5b372f929 (diff) | |
download | numpy-3f025b5400c0855472a772487de8930bac9b5eef.tar.gz |
Handle inplace generation of __config__.
-rw-r--r-- | numpy/setupscons.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/numpy/setupscons.py b/numpy/setupscons.py index 4ddd2fe04..b3ba29ad5 100644 --- a/numpy/setupscons.py +++ b/numpy/setupscons.py @@ -1,8 +1,12 @@ #!/usr/bin/env python +from os.path import join as pjoin def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration - config = Configuration('numpy',parent_package,top_path, setup_name = 'setupscons.py') + from numpy.distutils.misc_util import scons_generate_config_py + + pkgname = 'numpy' + config = Configuration(pkgname,parent_package,top_path, setup_name = 'setupscons.py') config.add_subpackage('distutils') config.add_subpackage('testing') config.add_subpackage('f2py') @@ -16,7 +20,16 @@ def configuration(parent_package='',top_path=None): config.add_subpackage('ma') config.add_data_dir('doc') config.add_data_dir('tests') - config.scons_make_config_py() # installs __config__.py + + def add_config(*args, **kw): + # Generate __config__, handle inplace issues. + if kw['scons_cmd'].inplace: + target = pjoin(kw['pkg_name'], '__config__.py') + else: + target = pjoin(kw['scons_cmd'].build_lib, kw['pkg_name'], '__config__.py') + scons_generate_config_py(target) + config.add_sconscript(None, post_hook = add_config) + return config if __name__ == '__main__': |