summaryrefslogtreecommitdiff
path: root/numpy/distutils/fcompiler/gnu.py
diff options
context:
space:
mode:
authorWarren Weckesser <warren.weckesser@gmail.com>2020-04-10 15:36:13 -0400
committerGitHub <noreply@github.com>2020-04-10 15:36:13 -0400
commit8f7adad487ebac177964a577f5d263da975d8333 (patch)
tree3c06002d9f0cc2f270a78b677ee66cb5c8d1d2d3 /numpy/distutils/fcompiler/gnu.py
parent51d1a99a84f5e2183b79dcc04713ffd90cb0caf2 (diff)
parent42281e9523572e299ab90446f4d83cb50f1149e4 (diff)
downloadnumpy-8f7adad487ebac177964a577f5d263da975d8333.tar.gz
Merge pull request #15921 from mattip/use-sysconfig
ENH: Use sysconfig instead of probing Makefile
Diffstat (limited to 'numpy/distutils/fcompiler/gnu.py')
-rw-r--r--numpy/distutils/fcompiler/gnu.py25
1 files changed, 8 insertions, 17 deletions
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index 8d69f6ba6..796dff351 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -122,26 +122,17 @@ class GnuFCompiler(FCompiler):
# error checking.
if not target:
# If MACOSX_DEPLOYMENT_TARGET is not set in the environment,
- # we try to get it first from the Python Makefile and then we
- # fall back to setting it to 10.3 to maximize the set of
- # versions we can work with. This is a reasonable default
+ # we try to get it first from sysconfig and then
+ # fall back to setting it to 10.9 This is a reasonable default
# even when using the official Python dist and those derived
# from it.
- import distutils.sysconfig as sc
- g = {}
- try:
- get_makefile_filename = sc.get_makefile_filename
- except AttributeError:
- pass # i.e. PyPy
- else:
- filename = get_makefile_filename()
- sc.parse_makefile(filename, g)
- target = g.get('MACOSX_DEPLOYMENT_TARGET', '10.3')
- os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
- if target == '10.3':
- s = 'Env. variable MACOSX_DEPLOYMENT_TARGET set to 10.3'
+ import sysconfig
+ target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
+ if not target:
+ target = '10.9'
+ s = f'Env. variable MACOSX_DEPLOYMENT_TARGET set to {target}'
warnings.warn(s, stacklevel=2)
-
+ os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
opt.extend(['-undefined', 'dynamic_lookup', '-bundle'])
else:
opt.append("-shared")