summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-18 11:29:37 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-18 11:44:33 +0530
commitfb42d4ec9b8e7bce1cdfb4bb03e283a99b55ebf8 (patch)
tree13662e75bbc5617e7239f2421f7951a59f36ee46
parentcf3fdf8e98f44591227ddfddbaa4a8015bcd8a12 (diff)
config/darwin: Set includes in CPPFLAGS instead of elsewhere
This allows checks like AC_CHECK_HEADER and others to use the correct headers. Also, don't need to set them in CFLAGS, CXXFLAGS, etc if they're in CPPFLAGS.
-rw-r--r--config/darwin.config7
1 files changed, 4 insertions, 3 deletions
diff --git a/config/darwin.config b/config/darwin.config
index 1a62acc2..63f08ef4 100644
--- a/config/darwin.config
+++ b/config/darwin.config
@@ -41,7 +41,7 @@ elif not os.path.exists(sdk_root):
min_osx_sdk_version = min_osx_sdk_version or '10.8'
sdk='-mmacosx-version-min=%s -isysroot %s' % (min_osx_sdk_version, sdk_root)
-for f in ['CFLAGS', 'CCASFLAGS', 'CXXFLAGS', 'OBJCFLAGS', 'LDFLAGS']:
+for f in ['CFLAGS', 'CCASFLAGS', 'CXXFLAGS', 'OBJCFLAGS', 'CPPFLAGS', 'LDFLAGS']:
os.environ[f] = os.environ.get(f, '')
arch_cflags = '-Wall -g -O2'
@@ -69,9 +69,10 @@ for f in ['CFLAGS', 'CCASFLAGS', 'CXXFLAGS', 'OBJCFLAGS']:
incflag = '-I' + incl_dir
if incflag not in os.environ[f]:
os.environ[f] += ' %s ' % incflag
- if sdk not in os.environ[f]:
- os.environ[f] += ' %s ' % sdk
+# To ensure that AC_CHECK_HEADER etc detect the right headers
+if sdk not in os.environ['CPPFLAGS']:
+ os.environ['CPPFLAGS'] = ' %s ' % sdk
if arch_ldflags not in os.environ['LDFLAGS']:
os.environ['LDFLAGS'] += ' %s ' % arch_ldflags
if sdk not in os.environ['LDFLAGS']: