[Numpy-svn] r6145 - trunk/numpy/distutils/fcompiler

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Dec 16 13:26:22 EST 2008


Author: cdavid
Date: 2008-12-16 12:26:13 -0600 (Tue, 16 Dec 2008)
New Revision: 6145

Modified:
   trunk/numpy/distutils/fcompiler/gnu.py
Log:
Add a function to get configured target for gfortran.

Modified: trunk/numpy/distutils/fcompiler/gnu.py
===================================================================
--- trunk/numpy/distutils/fcompiler/gnu.py	2008-12-16 18:04:24 UTC (rev 6144)
+++ trunk/numpy/distutils/fcompiler/gnu.py	2008-12-16 18:26:13 UTC (rev 6145)
@@ -10,6 +10,7 @@
 
 compilers = ['GnuFCompiler', 'Gnu95FCompiler']
 
+TARGET_R = re.compile("Target: ([a-zA-Z0-9_\-]*)")
 class GnuFCompiler(FCompiler):
     compiler_type = 'gnu'
     compiler_aliases = ('g77',)
@@ -275,6 +276,16 @@
             opt.remove('cc_dynamic')
         return opt
 
+    def get_target(self):
+        status, output = exec_command(self.compiler_f77 +
+                                      ['-v'],
+                                      use_tee=0)
+        if not status:
+	    m = TARGET_R.search(output)
+	    if m:
+	        print m.group(1)	
+        return ""
+
 if __name__ == '__main__':
     from distutils import log
     log.set_verbosity(2)




More information about the Numpy-svn mailing list