Upgrade to CPAN-1.87_62
[p5sagit/p5-mst-13.2.git] / cflags.SH
index bc22c2c..cc369d9 100755 (executable)
--- a/cflags.SH
+++ b/cflags.SH
@@ -88,20 +88,18 @@ Intel*) ;; # Haven't we been through this already?
     ;;
 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
 
+# stdflags currently unused.
 stdflags=''
 
-# Be strict C89 for gcc (but not for g++).
-case "$gccversion" in
-'') ;;
-Intel*) ;; # Nice try, Intel C++.
-12]*) ;; # Go easy on the older versions of gcc.
-*) case "$cc" in
-   *g++*) ;;
-   *) stdflags="$stdflags -std=c89" ;;
-   esac
-   ;;
-esac
+extra=''
+
+# Code to set any extra flags here.
 
 echo "Extracting cflags (with variable substitutions)"
 : This section of the file will have variable substitutions done on it.
@@ -116,6 +114,8 @@ $startsh
 warn="$warn"
 # Extra standardness.
 stdflags="$stdflags"
+# Extra extra.
+extra="$extra"
 
 !GROK!THIS!
 
@@ -224,13 +224,17 @@ for file do
     *) ;;
     esac
 
+case "$cc" in
+*g++*) ccflags="`echo $ccflags|sed 's/-Wdeclaration-after-statement/ /'`" ;;
+esac
+
 if test -f .patch; then
   ccflags="-DPERL_PATCHNUM=`cat .patch` $ccflags"
 fi
 
     : Can we perhaps use $ansi2knr here
-    echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn"
-    eval "$also "'"$cc -DPERL_CORE -c $ccflags $stdflags $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