diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2006-10-08 09:30:17 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2006-10-08 09:30:17 +0000 |
commit | 45e92465815e16d02a611005b61abc6a65f6b91c (patch) | |
tree | 7cb75b38697c04be28bac4a388a5c8b71db5373c /numpy/distutils/command/build_clib.py | |
parent | cc7fd3d7d62f4bc6ee17456d282475781204f98e (diff) | |
download | numpy-45e92465815e16d02a611005b61abc6a65f6b91c.tar.gz |
numpy.distutils: use language flag or source file extension to select default f77 or f90 compiler.
Diffstat (limited to 'numpy/distutils/command/build_clib.py')
-rw-r--r-- | numpy/distutils/command/build_clib.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/numpy/distutils/command/build_clib.py b/numpy/distutils/command/build_clib.py index 3319c6a75..de1781991 100644 --- a/numpy/distutils/command/build_clib.py +++ b/numpy/distutils/command/build_clib.py @@ -46,9 +46,12 @@ class build_clib(old_build_clib): return # Make sure that library sources are complete. + languages = [] for (lib_name, build_info) in self.libraries: if not all_strings(build_info.get('sources',[])): self.run_command('build_src') + l = build_info.get('language',None) + if l and l not in languages: languages.append(l) from distutils.ccompiler import new_compiler self.compiler = new_compiler(compiler=self.compiler, @@ -69,7 +72,8 @@ class build_clib(old_build_clib): self.fcompiler = new_fcompiler(compiler=self.fcompiler, verbose=self.verbose, dry_run=self.dry_run, - force=self.force) + force=self.force, + requiref90='f90' in languages) self.fcompiler.customize(self.distribution) libraries = self.libraries @@ -124,12 +128,14 @@ class build_clib(old_build_clib): 'for fortran compiler: %s' \ % (config_fc)) from numpy.distutils.fcompiler import new_fcompiler + requiref90 = build_info.get('language','c')=='f90' fcompiler = new_fcompiler(compiler=self.fcompiler.compiler_type, verbose=self.verbose, dry_run=self.dry_run, - force=self.force) + force=self.force, + requiref90=requiref90) 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 [] |