comparison configure @ 26636:d3ce3939637a

Rewrite (gcc) compiler check to default to enabling compilation and not set gcc-specific variables before the compiler is confirmed to be gcc.
author diego
date Sun, 04 May 2008 11:35:07 +0000
parents 540968176bbf
children f467dcaeeb26
comparison
equal deleted inserted replaced
26635:540968176bbf 26636:d3ce3939637a
1417 cc_version="v. ?.??, bad" 1417 cc_version="v. ?.??, bad"
1418 cc_fail=yes 1418 cc_fail=yes
1419 ;; 1419 ;;
1420 10.1) 1420 10.1)
1421 cc_version="$cc_version, ok" 1421 cc_version="$cc_version, ok"
1422 cc_fail=no
1423 ;; 1422 ;;
1424 *) 1423 *)
1425 cc_version="$cc_version, bad" 1424 cc_version="$cc_version, bad"
1426 cc_fail=yes 1425 cc_fail=yes
1427 ;; 1426 ;;
1428 esac 1427 esac
1429 echores "$cc_version" 1428 echores "$cc_version"
1430 else 1429 else
1431 for _cc in "$_cc" gcc cc ; do 1430 for _cc in "$_cc" cc gcc ; do
1431 cc_name_tmp=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1432 if test "$cc_name_tmp" = "gcc"; then
1433 cc_name=$cc_name_tmp
1432 echocheck "$_cc version" 1434 echocheck "$_cc version"
1433 cc_vendor=gnu 1435 cc_vendor=gnu
1434 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1435 cc_version=`$_cc -dumpversion 2>&1` 1436 cc_version=`$_cc -dumpversion 2>&1`
1436 if test "$?" -gt 0; then
1437 cc_version="not found"
1438 fi
1439 case $cc_version in 1437 case $cc_version in
1440 '') 1438 2.96*)
1441 cc_version="v. ?.??, bad"
1442 cc_fail=yes 1439 cc_fail=yes
1443 ;; 1440 ;;
1444 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*) 1441 *)
1445 _cc_major=`echo $cc_version | cut -d '.' -f 1` 1442 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1446 _cc_minor=`echo $cc_version | cut -d '.' -f 2` 1443 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1447 _cc_mini=`echo $cc_version | cut -d '.' -f 3` 1444 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1448 cc_version="$cc_version, ok"
1449 cc_fail=no
1450 ;;
1451 'not found')
1452 cc_fail=yes
1453 ;;
1454 *)
1455 cc_version="$cc_version, bad"
1456 cc_fail=yes
1457 ;; 1445 ;;
1458 esac 1446 esac
1459 echores "$cc_version" 1447 echores "$cc_version"
1460 test "$cc_fail" = "no" && break 1448 break
1449 fi
1461 done 1450 done
1462 fi # icc 1451 fi # icc
1463 test "$cc_fail" = yes && die "unsupported compiler version" 1452 test "$cc_fail" = yes && die "unsupported compiler version"
1464 1453
1465 echocheck "host cc" 1454 echocheck "host cc"