
import sys
from distutils.core import Command

#XXX: Implement confic_cc for enhancing C/C++ compiler options.
#XXX: Linker flags

class config_fc(Command):
    """ Distutils command to hold user specified options
    to Fortran compilers.

    config_fc command is used by the FCompiler.customize() method.
    """

    user_options = [
        ('fcompiler=',None,"specify Fortran compiler type"),
        ('f77exec=', None, "specify F77 compiler command"),
        ('f90exec=', None, "specify F90 compiler command"),
        ('f77flags=',None,"specify F77 compiler flags"),
        ('f90flags=',None,"specify F90 compiler flags"),
        ('opt=',None,"specify optimization flags"),
        ('arch=',None,"specify architecture specific optimization flags"),
        ('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']

    def initialize_options(self):
        self.fcompiler = None
        self.f77exec = None
        self.f90exec = None
        self.f77flags = None
        self.f90flags = None
        self.opt = None
        self.arch = None
        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()
        return

    def run(self):
        # Do nothing.
        return

@@ -125,16 +125,319 @@
  flags%0A%0A
+def show_fortran_compilers(_cache=%5B%5D):%0A    # Using cache to prevent infinite recursion%0A    if _cache: return%0A    _cache.append(1)%0A    %0A    from numpy.distutils.fcompiler import show_fcompilers%0A    import distutils.core%0A    dist = distutils.core._setup_distribution%0A    show_fcompilers(dist)%0A    return%0A%0A
 class co
@@ -1235,32 +1235,64 @@
 optimization%22),%0A
+        %5D%0A%0A    help_options = %5B%0A
         ('help-f
@@ -1306,16 +1306,17 @@
 r',None,
+ 
 %22list av
@@ -1341,16 +1341,49 @@
 mpilers%22
+,%0A         show_fortran_compilers
 ),%0A     
@@ -1439,25 +1439,8 @@
 rch'
-,'help-fcompiler'
 %5D%0A%0A 
@@ -1748,43 +1748,8 @@
 one%0A
-        self.help_fcompiler = None%0A
     
@@ -1804,167 +1804,21 @@
     
-if self.help_fcompiler:%0A            from numpy.distutils.fcompiler import show_fcompilers%0A            show_fcompilers(self.distribution)%0A            sys.exit()
+# Do nothing.
 %0A   

Fix ticket 48.