diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2018-12-14 23:22:14 -0800 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@gmail.com> | 2018-12-27 22:31:19 -0800 |
commit | 004a6c14e3ac4855dabfff91a56d35bc5a67266a (patch) | |
tree | 9ac850f2f56f98f50aa36dd2f1dc2cee6eda84e3 /numpy/distutils/fcompiler/environment.py | |
parent | 4adf52ebde53e01a0b1ed7509b0add6ac4575044 (diff) | |
download | numpy-004a6c14e3ac4855dabfff91a56d35bc5a67266a.tar.gz |
MAINT: add warning to numpy.distutils for LDFLAGS append behavior.
See gh-7427
Diffstat (limited to 'numpy/distutils/fcompiler/environment.py')
-rw-r--r-- | numpy/distutils/fcompiler/environment.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/numpy/distutils/fcompiler/environment.py b/numpy/distutils/fcompiler/environment.py index 489784580..4238f35cb 100644 --- a/numpy/distutils/fcompiler/environment.py +++ b/numpy/distutils/fcompiler/environment.py @@ -1,6 +1,7 @@ from __future__ import division, absolute_import, print_function import os +import warnings from distutils.dist import Distribution __metaclass__ = type @@ -54,8 +55,18 @@ class EnvironmentConfig(object): if envvar is not None: envvar_contents = os.environ.get(envvar) if envvar_contents is not None: - if var and append and os.environ.get('NPY_DISTUTILS_APPEND_FLAGS', '0') == '1': - var = var + [envvar_contents] + if var and append: + if os.environ.get('NPY_DISTUTILS_APPEND_FLAGS', '0') == '1': + var = var + [envvar_contents] + else: + var = envvar_contents + if 'NPY_DISTUTILS_APPEND_FLAGS' not in os.environ.keys(): + msg = "{} is used as is, not appended ".format(envvar) + \ + "to flags already defined " + \ + "by numpy.distutils! Use NPY_DISTUTILS_APPEND_FLAGS=1 " + \ + "to obtain appending behavior instead (this " + \ + "behavior will become default in a future release)." + warnings.warn(msg, UserWarning, stacklevel=3) else: var = envvar_contents if confvar is not None and self._conf: |