diff options
author | Robert Kern <robert.kern@gmail.com> | 2007-01-27 00:35:17 +0000 |
---|---|---|
committer | Robert Kern <robert.kern@gmail.com> | 2007-01-27 00:35:17 +0000 |
commit | 56a6330e2a69392a7e230f4b0417f9cc623b8dde (patch) | |
tree | fac347525646918a4eb3bbfc8a7f15edc5e18a4a /numpy | |
parent | 37953a567622b540ea5970ad8a29ed16ae6a5969 (diff) | |
download | numpy-56a6330e2a69392a7e230f4b0417f9cc623b8dde.tar.gz |
Generalize the setting of MACOSX_DEPLOYMENT_TARGET.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/distutils/fcompiler/gnu.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py index ac7984ebc..60101dc00 100644 --- a/numpy/distutils/fcompiler/gnu.py +++ b/numpy/distutils/fcompiler/gnu.py @@ -1,5 +1,6 @@ import re import os +import platform import sys import warnings @@ -61,14 +62,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('.') 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) |