From 1bca125a3f0c1e86b7777adebcdde5671b713f92 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Sat, 8 Apr 2006 08:13:56 +0000 Subject: Fix ticket 48. --- numpy/distutils/command/config_compiler.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'numpy/distutils/command') 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): -- cgit v1.2.1