diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2006-04-08 17:10:26 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2006-04-08 17:10:26 +0000 |
commit | 6932d858cf4701106a7cedf0edce70c34bf75925 (patch) | |
tree | 762c3f5c01ccd1ac9ca0afdac6bbd0e92d7f92d3 /numpy/distutils/command/build_clib.py | |
parent | 5cb0f8bb28951f09beec7036601eab8796ab5d03 (diff) | |
download | numpy-6932d858cf4701106a7cedf0edce70c34bf75925.tar.gz |
Add support to specify config_fc option in setup.py file.
Diffstat (limited to 'numpy/distutils/command/build_clib.py')
-rw-r--r-- | numpy/distutils/command/build_clib.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/numpy/distutils/command/build_clib.py b/numpy/distutils/command/build_clib.py index 7b6a0fa69..080f98aa1 100644 --- a/numpy/distutils/command/build_clib.py +++ b/numpy/distutils/command/build_clib.py @@ -91,10 +91,12 @@ class build_clib(old_build_clib): def build_libraries(self, libraries): - compiler = self.compiler - fcompiler = self.fcompiler for (lib_name, build_info) in libraries: + # default compilers + compiler = self.compiler + fcompiler = self.fcompiler + sources = build_info.get('sources') if sources is None or not is_sequence(sources): raise DistutilsSetupError, \ @@ -103,6 +105,8 @@ class build_clib(old_build_clib): "a list of source filenames") % lib_name sources = list(sources) + + lib_file = compiler.library_filename(lib_name, output_dir=self.build_clib) @@ -113,6 +117,18 @@ class build_clib(old_build_clib): else: log.info("building '%s' library", lib_name) + + config_fc = build_info.get('config_fc',{}) + if fcompiler is not None and config_fc: + log.info('using setup script specified config_fc for fortran compiler: %s' \ + % (config_fc)) + from numpy.distutils.fcompiler import new_fcompiler + fcompiler = new_fcompiler(compiler=self.fcompiler.compiler_type, + verbose=self.verbose, + dry_run=self.dry_run, + force=self.force) + fcompiler.customize(config_fc) + macros = build_info.get('macros') include_dirs = build_info.get('include_dirs') extra_postargs = build_info.get('extra_compiler_args') or [] |