summaryrefslogtreecommitdiff
path: root/cflags.SH
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-07-15 15:19:45 +0300
committerH.Merijn Brand <h.m.brand@xs4all.nl>2006-07-15 11:41:59 +0000
commit11fcce8542fe48eab3406b8f4526f9237289ec13 (patch)
treef7d2c14638652249660ad87df1cb283c29221477 /cflags.SH
parentc1289dd7d5e8d409a94f43524726bbeba2f888b0 (diff)
downloadperl-11fcce8542fe48eab3406b8f4526f9237289ec13.tar.gz
Re: [PATCH] cflags.SH: add -std=c89
Message-ID: <44B8B331.8090009@iki.fi> p4raw-id: //depot/perl@28576
Diffstat (limited to 'cflags.SH')
-rwxr-xr-xcflags.SH27
1 files changed, 22 insertions, 5 deletions
diff --git a/cflags.SH b/cflags.SH
index 7a07408cb7..db51ca2a7d 100755
--- 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,21 @@ Intel*) ;;
;;
esac
+
+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
+
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 +112,10 @@ rm -f cflags
$spitshell >cflags <<!GROK!THIS!
$startsh
-# Used for gcc.
+# Extra warnings, used e.g. for gcc.
warn="$warn"
+# Extra standardness.
+stdflags="$stdflags"
!GROK!THIS!
@@ -204,8 +221,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"
+ eval "$also "'"$cc -DPERL_CORE -c $ccflags $stdflags $optimize $warn"'
. $TOP/config.sh