X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=cflags.SH;h=fe4bacc2197474ded7dc37c9534108835dc00e0d;hb=42cd432e78efd1039af03fb10782bd0dba2e23ee;hp=ece6548aff481de52c683a61cd66be482773e4ff;hpb=5cf489d61c74279295e704d8bb682720f309c5fa;p=p5sagit%2Fp5-mst-13.2.git diff --git a/cflags.SH b/cflags.SH index ece6548..fe4bacc 100755 --- 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 && ! test -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 @@ -142,16 +147,18 @@ 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 + 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 @@ -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