[Numpy-svn] r4475 - branches/numpy.scons/numpy/distutils/scons/core

numpy-svn@scip... numpy-svn@scip...
Tue Nov 20 05:22:50 CST 2007


Author: cdavid
Date: 2007-11-20 05:22:45 -0600 (Tue, 20 Nov 2007)
New Revision: 4475

Modified:
   branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py
Log:
Add -fno-second-underscore flag for g77 in scons to keep ABI with distutils

Modified: branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py	2007-11-20 09:56:30 UTC (rev 4474)
+++ branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py	2007-11-20 11:22:45 UTC (rev 4475)
@@ -1,6 +1,6 @@
 # Last Changed: .
 import os.path
-from os.path import join as pjoin, dirname as pdirname
+from os.path import join as pjoin, dirname as pdirname, basename as pbasename
 import sys
 
 import re
@@ -49,6 +49,10 @@
 
     return suncc.search(cnt)
 
+def is_f77_gnu(fullpath):
+    # XXX
+    return pbasename(fullpath) == 'g77' or pbasename(fullpath) == 'gfortran'
+
 def get_vs_version(env):
     try:
          version = env['MSVS']['VERSION']
@@ -170,8 +174,6 @@
             # scons could not understand cc_opt (bad name ?)
             raise AssertionError("SCONS: Could not initialize tool ? Error is %s" % \
                                  str(e))
-        # XXX: really have to understand how fortran compilers work in scons...
-        env['F77'] = env['_FORTRAND']
     else:
         def_fcompiler =  FindTool(DEF_FORTRAN_COMPILERS, env)
         if def_fcompiler:
@@ -180,6 +182,12 @@
         else:
             print "========== NO FORTRAN COMPILER FOUND ==========="
 
+    # XXX: really have to understand how fortran compilers work in scons...
+    env['F77'] = env['_FORTRAND']
+
+    if is_f77_gnu(env['F77']):
+        env.AppendUnique(SHF77FLAGS = '-fno-second-underscore')
+
 def _GetNumpyEnvironment(args):
     """Call this with args = ARGUMENTS."""
     from SCons.Environment import Environment



More information about the Numpy-svn mailing list