summaryrefslogtreecommitdiff
path: root/numpy/distutils/fcompiler/gnu.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-12-16 18:26:13 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-12-16 18:26:13 +0000
commit65af92bcd4a6f2fb82e99c27770a28dda69488fc (patch)
tree36d8c359463030a8a9e3517bbe819fb998089d86 /numpy/distutils/fcompiler/gnu.py
parent4f1e6358b6d544b81c78805113b4f87d59f3482c (diff)
downloadnumpy-65af92bcd4a6f2fb82e99c27770a28dda69488fc.tar.gz
Add a function to get configured target for gfortran.
Diffstat (limited to 'numpy/distutils/fcompiler/gnu.py')
-rw-r--r--numpy/distutils/fcompiler/gnu.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index 593b48ac0..7dcc350e4 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -10,6 +10,7 @@ from numpy.distutils.misc_util import msvc_runtime_library
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 @@ class Gnu95FCompiler(GnuFCompiler):
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)