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

numpy-svn at scipy.org numpy-svn at scipy.org
Fri Jan 26 18:44:04 CST 2007


Author: rkern
Date: 2007-01-26 18:35:17 -0600 (Fri, 26 Jan 2007)
New Revision: 3521

Modified:
   trunk/numpy/distutils/fcompiler/gnu.py
Log:
Generalize the setting of MACOSX_DEPLOYMENT_TARGET.

Modified: trunk/numpy/distutils/fcompiler/gnu.py
===================================================================
--- trunk/numpy/distutils/fcompiler/gnu.py	2007-01-26 04:16:37 UTC (rev 3520)
+++ trunk/numpy/distutils/fcompiler/gnu.py	2007-01-27 00:35:17 UTC (rev 3521)
@@ -1,5 +1,6 @@
 import re
 import os
+import platform
 import sys
 import warnings
 
@@ -61,14 +62,16 @@
     def get_flags_linker_so(self):
         opt = self.linker_so[1:]
         if sys.platform=='darwin':
+            osx_version = platform.mac_ver()[0][:4]
+            osx_major, osx_minor = osx_version.split('.')
             target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', None)
-            if target is None:
-                target = '10.3'
+            if target is None or target == '':
+                target = osx_version
             major, minor = target.split('.')
             if int(minor) < 3:
-                minor = '3'
+                minor = osx_minor
                 warnings.warn('Environment variable '
-                    'MACOSX_DEPLOYMENT_TARGET reset to 10.3')
+                    'MACOSX_DEPLOYMENT_TARGET reset to %s.%s' % (major, minor))
             os.environ['MACOSX_DEPLOYMENT_TARGET'] = '%s.%s' % (major,
                 minor)
 



More information about the Numpy-svn mailing list