diff options
author | mbyt <random.seed@web.de> | 2015-01-05 21:20:16 +0100 |
---|---|---|
committer | mbyt <random.seed@web.de> | 2015-01-05 21:23:29 +0100 |
commit | 1cb9cf2429165660a40eb499b392b3a6133cdd34 (patch) | |
tree | 02f431ad32e3bcdec274c6fa25f98411fd81b93f /numpy/distutils/unixccompiler.py | |
parent | c6b8109a18e7b8e472b50713b4fc9a36fbb4de91 (diff) | |
download | numpy-1cb9cf2429165660a40eb499b392b3a6133cdd34.tar.gz |
BLD: ensure OPT build environment variable is read
Diffstat (limited to 'numpy/distutils/unixccompiler.py')
-rw-r--r-- | numpy/distutils/unixccompiler.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py index 955407aa0..9e49edadc 100644 --- a/numpy/distutils/unixccompiler.py +++ b/numpy/distutils/unixccompiler.py @@ -30,6 +30,15 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts # add flags for (almost) sane C++ handling ccomp += ['-AA'] self.compiler_so = ccomp + # ensure OPT environment variable is read + if 'OPT' in os.environ: + opt = " ".join(os.environ['OPT'].split()) + ccomp_s = " ".join(ccomp) + if opt not in ccomp_s: + from distutils.sysconfig import get_config_vars + gcv_opt = " ".join(get_config_vars('OPT')[0].split()) + ccomp_s = ccomp_s.replace(gcv_opt, opt) + self.compiler_so = ccomp_s.split() display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src) try: |