This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
/p vs (?p)
[perl5.git] / cflags.SH
index 134dfc6..af1b43b 100755 (executable)
--- a/cflags.SH
+++ b/cflags.SH
@@ -17,6 +17,11 @@ case "$0" in
 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
 esac
 
+if test -f config_h.SH -a ! -f config.h; then
+    . ./config_h.SH
+    CONFIG_H=already-done
+fi
+
 warn=''
 
 # Add -Wall for the core modules iff gcc and not already -Wall
@@ -114,7 +119,7 @@ case "$gccversion" in
 '') ;;
 [12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
 Intel*) ;; # # Is that you, Intel C++?
-*)  for opt in -ansi -pedantic -std=c89 -W -Wextra -Wdeclaration-after-statement -Wendif-labels
+*)  for opt in -ansi -pedantic -std=c89 -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat
     do
        case " $ccflags " in
        *" $opt "*) ;; # Skip if already there.
@@ -142,18 +147,20 @@ rm -f _cflags.c _cflags$_exe
 case "$gccversion" in
 '') ;;
 *)
-  # If we have -Duse64bitint (or equivalent) in effect and the quadtype
-  # has become 'long long', gcc -pedantic becomes unbearable (moreso
-  # when combined with -Wall) because long long and LL and %lld|%Ld
-  # become warn-worthy.  So let's drop the -pedantic in that case.
-  case "$quadtype:$sPRId64" in
-  "long long"*|*lld*|*Ld*)
-    ccflags="`echo $ccflags|sed 's/-pedantic/ /'`"
-    warn="`echo $warn|sed 's/-pedantic/ /'`"
-    ;;
-  esac
-  # Using certain features (like the gcc brace groups)
-  # require knowing whether -pedantic has been specified.
+  if [ "$gccansipedantic" = "" ]; then
+    # If we have -Duse64bitint (or equivalent) in effect and the quadtype
+    # has become 'long long', gcc -pedantic becomes unbearable (moreso
+    # when combined with -Wall) because long long and LL and %lld|%Ld
+    # become warn-worthy.  So let's drop the -pedantic in that case.
+    case "$quadtype:$sPRId64" in
+    "long long"*|*lld*|*Ld*)
+      ccflags="`echo $ccflags|sed 's/-pedantic/ /'`"
+      warn="`echo $warn|sed 's/-pedantic/ /'`"
+      ;;
+    esac
+  fi
+  # Using certain features (like the gcc statement expressions)
+  # requires knowing whether -pedantic has been specified.
   case "$warn$ccflags" in
   *-pedantic*) warn="$warn -DPERL_GCC_PEDANTIC" ;;
   esac
@@ -293,7 +300,7 @@ case "$cc" in
   # but then whined about.
   for f in -Wdeclaration-after-statement -std=c89
   do
-    ccflags="`echo $ccflags|sed 's/$f/ /'`"
+    ccflags=`echo $ccflags|sed 's/$f/ /'`
   done
   ;;
 esac