summaryrefslogtreecommitdiff
path: root/cflags.SH
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2015-11-22 11:40:36 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2015-11-23 06:55:12 -0500
commit9ce5f19e953f07bac7e8d983c49fc33376200c0f (patch)
tree3946044bd3d0f380437b3d623feadd84c5ed8385 /cflags.SH
parent3baee7ccba467a3ddc1cb6bfb1a4cabd40cd7424 (diff)
downloadperl-9ce5f19e953f07bac7e8d983c49fc33376200c0f.tar.gz
add -Wthread-safety for clang 3.5 or later
With this change there is no need to explicitly e.g. Configure ... -Accflags='-Wthread-safety' since doing just -Dusethreads with recent enough clang will automatically add the -Wthread-safety
Diffstat (limited to 'cflags.SH')
-rwxr-xr-xcflags.SH23
1 files changed, 23 insertions, 0 deletions
diff --git a/cflags.SH b/cflags.SH
index ec70ed216a..2aee42673d 100755
--- a/cflags.SH
+++ b/cflags.SH
@@ -378,6 +378,29 @@ do
esac
done
+# If usethreads and clang, add -Wthread-safety for clang 3.5 or later.
+# gccversion is defined also for clang, because compat, use that for matching.
+# Apple overwrites clang version with XCode version.
+# Aggressively forward-proofing.
+case "$usethreads" in
+define)
+case "$gccversion" in
+*" Clang 3."[56789]*|*" Clang "[456]*|*"Apple LLVM "[6789]*)
+ for f in -Wthread-safety
+ do
+ case " $warn " in
+ *" $f "*) ;; # Skip if already there.
+ *)
+ echo "cflags.SH: Adding $f because usethreads and clang and gccversion '$gccversion'"
+ warn="$warn $f"
+ ;;
+ esac
+ done
+;;
+esac
+;;
+esac
+
echo "cflags.SH: cc = $cc"
echo "cflags.SH: ccflags = $ccflags"
echo "cflags.SH: stdflags = $stdflags"