summaryrefslogtreecommitdiff
path: root/numpy/distutils/command/config_compiler.py
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2007-05-18 20:17:48 +0000
committerPearu Peterson <pearu.peterson@gmail.com>2007-05-18 20:17:48 +0000
commit6f82e1e9c704daaf398015ecc20892d89e56b259 (patch)
tree7c3d04682a4dcd7ea50490a1e4cac08f3cf983a8 /numpy/distutils/command/config_compiler.py
parent571f16714fe9c2c744c6563d495dd0aaa47a843b (diff)
downloadnumpy-6f82e1e9c704daaf398015ecc20892d89e56b259.tar.gz
unify config_fc, build_clib, build_ext commands --fcompiler options so that --fcompiler can be specified only once in a command line
Diffstat (limited to 'numpy/distutils/command/config_compiler.py')
-rw-r--r--numpy/distutils/command/config_compiler.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/numpy/distutils/command/config_compiler.py b/numpy/distutils/command/config_compiler.py
index 30a21dd7d..ebbe4c8e1 100644
--- a/numpy/distutils/command/config_compiler.py
+++ b/numpy/distutils/command/config_compiler.py
@@ -1,5 +1,6 @@
import sys
from distutils.core import Command
+from numpy.distutils import log
#XXX: Implement confic_cc for enhancing C/C++ compiler options.
#XXX: Linker flags
@@ -56,7 +57,22 @@ class config_fc(Command):
return
def finalize_options(self):
- # Do nothing.
+ log.info('unifing config_fc, build_ext, build_clib commands fcompiler options')
+ build_clib = self.get_finalized_command('build_clib')
+ build_ext = self.get_finalized_command('build_ext')
+ for a in ['fcompiler']:
+ l = []
+ for c in [self, build_clib, build_ext]:
+ v = getattr(c,a)
+ if v is not None and v not in l: l.append(v)
+ if not l: v1 = None
+ else: v1 = l[0]
+ if len(l)>1:
+ log.warn(' commands have different --%s options: %s'\
+ ', using first in list as default' % (a, l))
+ if v1:
+ for c in [self, build_clib, build_ext]:
+ if getattr(c,a) is None: setattr(c, a, v1)
return
def run(self):