From 1cb9cf2429165660a40eb499b392b3a6133cdd34 Mon Sep 17 00:00:00 2001 From: mbyt Date: Mon, 5 Jan 2015 21:20:16 +0100 Subject: BLD: ensure OPT build environment variable is read --- numpy/distutils/unixccompiler.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'numpy/distutils/unixccompiler.py') 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: -- cgit v1.2.1