summaryrefslogtreecommitdiff
path: root/numpy/distutils/fcompiler/gnu.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/distutils/fcompiler/gnu.py')
-rw-r--r--numpy/distutils/fcompiler/gnu.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index 60101dc00..4e2a618e5 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -1,6 +1,5 @@
import re
import os
-import platform
import sys
import warnings
@@ -62,14 +61,16 @@ class GnuFCompiler(FCompiler):
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('.')
+ # MACOSX_DEPLOYMENT_TARGET must be at least 10.3. This is
+ # a reasonable default value even when building on 10.4 when using
+ # the official Python distribution and those derived from it (when
+ # not broken).
target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', None)
if target is None or target == '':
- target = osx_version
+ target = '10.3'
major, minor = target.split('.')
if int(minor) < 3:
- minor = osx_minor
+ minor = '3'
warnings.warn('Environment variable '
'MACOSX_DEPLOYMENT_TARGET reset to %s.%s' % (major, minor))
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '%s.%s' % (major,