Upgrade to Archive-Tar-1.30. Since change #27571 is not included,
[p5sagit/p5-mst-13.2.git] / cflags.SH
index 7a07408..c32d5f8 100755 (executable)
--- a/cflags.SH
+++ b/cflags.SH
@@ -33,7 +33,7 @@ esac
 # The gcc -ansi -pedantic require their own dance, too.
 case "$gccversion" in
 '') ;;
-Intel*) ;;
+Intel*) ;; # Is that you, Intel C++?
 *)  case "$gccansipedantic" in
     define)
        case "$gccversion" in
@@ -71,7 +71,7 @@ esac
 case "$gccversion" in
 '') ;;
 [12]*) ;;
-Intel*) ;;
+Intel*) ;; # Haven't we been through this already?
 *)  for opt in '' extra declaration-after-statement endif-labels
     do
        case " $ccflags " in
@@ -88,6 +88,23 @@ Intel*) ;;
     ;;
 esac
 
+# If we have g++, we cannot have the -Wdeclaration-after-statement.
+# Some g++s accept it but then whine about it with every file.
+case "$cc" in
+*g++*) warn="`echo $warn|sed 's/-Wdeclaration-after-statement/ /'`" ;;
+esac
+
+extra=''
+
+# C and C++ have different rules for const strings;
+# without the -fno-const-strings g++ cannot handle our habit
+# of mixing char literals and char pointers.
+case "$cc" in
+*g++*) extra="$extra -fno-const-strings" ;;
+esac
+
+stdflags=''
+
 echo "Extracting cflags (with variable substitutions)"
 : This section of the file will have variable substitutions done on it.
 : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
@@ -97,8 +114,12 @@ rm -f cflags
 $spitshell >cflags <<!GROK!THIS!
 $startsh
 
-# Used for gcc.
+# Extra warnings, used e.g. for gcc.
 warn="$warn"
+# Extra standardness.
+stdflags="$stdflags"
+# Extra extra.
+extra="$extra"
 
 !GROK!THIS!
 
@@ -169,15 +190,19 @@ for file do
     doio) ;;
     doop) ;;
     dump) ;;
+    globals) ;;
     gv) ;;
     hv) ;;
     locale) ;;
+    madly) ;;
     main) ;;
     malloc) ;;
     mg) ;;
     miniperlmain) ;;
     numeric) ;;
     op) ;;
+    opmini) ;;
+    pad) ;;
     perl) ;;
     perlapi) ;;
     perlmain) ;;
@@ -186,6 +211,7 @@ for file do
     pp_ctl) ;;
     pp_hot) ;;
     pp_pack) ;;
+    pp_sort) ;;
     pp_sys) ;;
     regcomp) ;;
     regexec) ;;
@@ -194,8 +220,11 @@ for file do
     sv) ;;
     taint) ;;
     toke) ;;
+    universal) ;;
     usersub) ;;
+    utf8) ;;
     util) ;;
+    xsutils) ;;
     *) ;;
     esac
 
@@ -204,8 +233,8 @@ if test -f .patch; then
 fi
 
     : Can we perhaps use $ansi2knr here
-    echo "$cc -c -DPERL_CORE $ccflags $optimize $warn"
-    eval "$also "'"$cc -DPERL_CORE -c $ccflags $optimize $warn"'
+    echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn $extra"
+    eval "$also "'"$cc -DPERL_CORE -c $ccflags $stdflags $optimize $warn $extra"'
 
     . $TOP/config.sh