From: Jarkko Hietaniemi Date: Sat, 15 Jul 2006 12:19:45 +0000 (+0300) Subject: Re: [PATCH] cflags.SH: add -std=c89 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=11fcce8542fe48eab3406b8f4526f9237289ec13;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] cflags.SH: add -std=c89 Message-ID: <44B8B331.8090009@iki.fi> p4raw-id: //depot/perl@28576 --- diff --git a/cflags.SH b/cflags.SH index 7a07408..db51ca2 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 <