diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-04-05 11:32:08 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-04-05 11:32:08 +0100 |
commit | e727fa2798ffc794cbb99211cf1a5499354bc1d5 (patch) | |
tree | ba3d5b43f907fe82dfdbc13275c336077a9e8b20 | |
parent | 7287d036f77a8e36b33684f04817b77934c30178 (diff) | |
download | perl-e727fa2798ffc794cbb99211cf1a5499354bc1d5.tar.gz |
In Darwin's hints, only add -no-cpp-precomp to ccflags if it's not an error.
Previously -no-cpp-precomp was added uncondtionally to cppflags and ccflags.
Apple's compiler accepts this unconditionally. gcc 4.5 warns about it, but
ignores it. gcc 4.6 treats the unknown flag as an error. Hence test whether
the flag causes problems, and only add it if it does not.
(Searching with Google suggests that this flag has been unnecessary on OS X
for some time. However, there's no clear documentation about it to confirm
when it stopped being necessary.)
-rw-r--r-- | hints/darwin.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/hints/darwin.sh b/hints/darwin.sh index dab060773a..95dc549541 100644 --- a/hints/darwin.sh +++ b/hints/darwin.sh @@ -126,11 +126,13 @@ case "$(grep '^#define INT32_MIN' /usr/include/stdint.h)" in esac # Avoid Apple's cpp precompiler, better for extensions -cppflags="${cppflags} -no-cpp-precomp" +if [ "X`echo | ${cc} -no-cpp-precomp -E - 2>&1 >/dev/null`" = "X" ]; then + cppflags="${cppflags} -no-cpp-precomp" -# This is necessary because perl's build system doesn't -# apply cppflags to cc compile lines as it should. -ccflags="${ccflags} ${cppflags}" + # This is necessary because perl's build system doesn't + # apply cppflags to cc compile lines as it should. + ccflags="${ccflags} ${cppflags}" +fi # Known optimizer problems. case "`cc -v 2>&1`" in |