This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Ensure that documentation works under 'use strict'.
[perl5.git] / cflags.SH
index 2aee426..3af1e97 100755 (executable)
--- a/cflags.SH
+++ b/cflags.SH
@@ -226,33 +226,31 @@ Intel*) ;; # # Is that you, Intel C++?
                    ;;
                  esac
                  ;;
-               *) case "$opt" in
-                  -W)
-                    # -Wextra is the modern form of -W, so add
-                    # -W only if -Wextra is not there already.
-                    case " $warn " in
-                    *-Wextra*) ;;
-                    *)
-                      echo "cflags.SH: Adding $opt."
-                      warn="$warn $opt"
-                      ;;
-                    esac
-                    ;;
-                 -Werror=declaration-after-statement)
-                    # -pedantic* (with -std=c89) covers -Werror=d-a-s.
-                    case "$stdflags$warn" in
-                    *-std=c89*-pedantic*|*-pedantic*-std=c89*) ;;
-                    *)
-                      echo "cflags.SH: Adding $opt."
-                      warn="$warn $opt"
-                      ;;
-                    esac
-                   ;;
+               -W)
+                 # -Wextra is the modern form of -W, so add
+                 # -W only if -Wextra is not there already.
+                 case " $warn " in
+                 *-Wextra*) ;;
+                 *)
+                   echo "cflags.SH: Adding $opt."
+                   warn="$warn $opt"
+                   ;;
+                 esac
+                 ;;
+               -Werror=declaration-after-statement)
+                  # -pedantic* (with -std=c89) covers -Werror=d-a-s.
+                  case "$stdflags$warn" in
+                  *-std=c89*-pedantic*|*-pedantic*-std=c89*) ;;
                   *)
                      echo "cflags.SH: Adding $opt."
                      warn="$warn $opt"
                      ;;
                   esac
+                  ;;
+               *)
+                  echo "cflags.SH: Adding $opt."
+                  warn="$warn $opt"
+                  ;;
                esac
              fi
              ;;
@@ -378,14 +376,14 @@ do
   esac
 done
 
-# If usethreads and clang, add -Wthread-safety for clang 3.5 or later.
+# If usethreads and clang, add -Wthread-safety for clang 3.6 or later.
 # gccversion is defined also for clang, because compat, use that for matching.
-# Apple overwrites clang version with XCode version.
-# Aggressively forward-proofing.
+# Apple overwrites clang version with XCode version, see hints/darwin.sh
+# for the gory details.  Aggressively forward-proofing.
 case "$usethreads" in
 define)
 case "$gccversion" in
-*" Clang 3."[56789]*|*" Clang "[456]*|*"Apple LLVM "[6789]*)
+*" Clang 3."[56789]*|*" Clang "[456]*|*"Apple LLVM 6.1"*|*"Apple LLVM "[789]*)
   for f in -Wthread-safety
   do
     case " $warn " in
@@ -487,10 +485,10 @@ for file do
 
     # allow variables like toke_cflags to be evaluated
 
-    if echo $file | grep -v / >/dev/null
-    then
-      eval 'eval ${'"${file}_cflags"'-""}'
-    fi
+    case "$file" in
+    */*) ;;
+    *) eval 'eval ${'"${file}_cflags"'-""}' ;;
+    esac
 
     # or customize here