diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2006-04-08 08:13:56 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2006-04-08 08:13:56 +0000 |
commit | 1bca125a3f0c1e86b7777adebcdde5671b713f92 (patch) | |
tree | 3f8a08484937f85319791f8fe15d643036d25766 /numpy/distutils/command/config_compiler.py | |
parent | 18c2a959e5ef86a576cc13470ac845174b57a39c (diff) | |
download | numpy-1bca125a3f0c1e86b7777adebcdde5671b713f92.tar.gz |
Fix ticket 48.
Diffstat (limited to 'numpy/distutils/command/config_compiler.py')
-rw-r--r-- | numpy/distutils/command/config_compiler.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/numpy/distutils/command/config_compiler.py b/numpy/distutils/command/config_compiler.py index 1c7aad7b7..8e23a3d3d 100644 --- a/numpy/distutils/command/config_compiler.py +++ b/numpy/distutils/command/config_compiler.py @@ -5,6 +5,17 @@ from distutils.core import Command #XXX: Implement confic_cc for enhancing C/C++ compiler options. #XXX: Linker flags +def show_fortran_compilers(_cache=[]): + # Using cache to prevent infinite recursion + if _cache: return + _cache.append(1) + + from numpy.distutils.fcompiler import show_fcompilers + import distutils.core + dist = distutils.core._setup_distribution + show_fcompilers(dist) + return + class config_fc(Command): """ Distutils command to hold user specified options to Fortran compilers. @@ -23,10 +34,14 @@ class config_fc(Command): ('debug','g',"compile with debugging information"), ('noopt',None,"compile without optimization"), ('noarch',None,"compile without arch-dependent optimization"), - ('help-fcompiler',None,"list available Fortran compilers"), ] - boolean_options = ['debug','noopt','noarch','help-fcompiler'] + help_options = [ + ('help-fcompiler',None, "list available Fortran compilers", + show_fortran_compilers), + ] + + boolean_options = ['debug','noopt','noarch'] def initialize_options(self): self.fcompiler = None @@ -39,14 +54,10 @@ class config_fc(Command): self.debug = None self.noopt = None self.noarch = None - self.help_fcompiler = None return def finalize_options(self): - if self.help_fcompiler: - from numpy.distutils.fcompiler import show_fcompilers - show_fcompilers(self.distribution) - sys.exit() + # Do nothing. return def run(self): |