From: "H.Merijn Brand" <h.m.brand@hccnet.nl>
Message-Id: <
20020516164139.666A.H.M.BRAND@hccnet.nl>
gcc 3 version parsing proofing.
p4raw-id: //depot/perl@16629
# reset
_DEC_cc_style=
case "$isgcc" in
-gcc) _gcc_version=`$cc --version 2>&1 | tr . ' '`
- set $_gcc_version
+gcc) if [ "X$gccversion" = "X" ]; then
+ # Done too late in Configure if hinted
+ gccversion=`$cc --version | sed 's/.*(GCC) *//'`
+ fi
+ set $gcc_version
if test "$1" -lt 2 -o \( "$1" -eq 2 -a \( "$2" -lt 95 -o \( "$2" -eq 95 -a "$3" -lt 2 \) \) \); then
cat >&4 <<EOF
-*** Your cc seems to be gcc and its version ($_gcc_version) seems to be
+*** Your cc seems to be gcc and its version ($gcc_version) seems to be
*** less than 2.95.2. This is not a good idea since old versions of gcc
*** are known to produce buggy code when compiling Perl (and no doubt for
*** other programs, too).
ccflags="$cc_cppflags"
if [ "X$gccversion" = "X" ]; then
# Done too late in Configure if hinted
- gccversion=`$cc --version | sed 's/.*(GCC) *//`
+ gccversion=`$cc --version | sed 's/.*(GCC) *//'`
fi
case "$gccversion" in
[012]*) # HP-UX and gcc-2.* break UINT32_MAX :-(
case "$cc" in
*gcc*)
# "$gccversion" not set yet
- vers=`gcc -v 2>&1 | sed -n -e 's@.*version \([^ ][^ ]*\) .*@\1@p'`
- case $vers in
+ if [ "X$gccversion" = "X" ]; then
+ # Done too late in Configure if hinted
+ gccversion=`$cc --version | sed 's/.*(GCC) *//'`
+ fi
+ case $gccversion in
*2.95*)
ccflags='-fno-strict-aliasing'
# More optimisation provided in gcc-2.95 causes miniperl to segv.
# Try compiling the test case.
if $cc -o t001 -O $ccflags $ldflags ../hints/t001.c; then
gccbug=`$run ./t001`
+ if [ "X$gccversion" = "X" ]; then
+ # Done too late in Configure if hinted
+ gccversion=`$cc --version | sed 's/.*(GCC) *//'`
+ fi
case "$gccbug" in
- *fails*) gccversion=`$cc --version`
- cat >&4 <<EOF
+ *fails*) cat >&4 <<EOF
This C compiler ($gccversion) is known to have optimizer
problems when compiling pp_pack.c. The Stratus bug number
for this problem is gnu_g++-220.