comparison configure @ 33799:6a9627d6f8f1

configure: use 'uname -m' to find out host architecture Before 'uname -m' was only the fallback after trying 'uname -p', but the former is more reliable across platforms, so just use it directly. This should hopefully address Bugzilla #1560.
author diego
date Thu, 21 Jul 2011 01:21:36 +0000
parents d4d29d2329f2
children 94292629886d
comparison
equal deleted inserted replaced
33798:2a145501610c 33799:6a9627d6f8f1
1464 ;; 1464 ;;
1465 esac 1465 esac
1466 1466
1467 1467
1468 # host's CPU/instruction set 1468 # host's CPU/instruction set
1469 host_arch=$(uname -p 2>&1) 1469 case "$(uname -m 2>&1)" in
1470 case "$host_arch" in
1471 i386|sparc|ppc|alpha|arm|mips|vax)
1472 ;;
1473 powerpc) # Darwin returns 'powerpc'
1474 host_arch=ppc
1475 ;;
1476 *) # uname -p on Linux returns 'unknown' for the processor type,
1477 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1478
1479 # Maybe uname -m (machine hardware name) returns something we
1480 # recognize.
1481
1482 # x86/x86pc is used by QNX
1483 case "$(uname -m 2>&1)" in
1484 x86_64|amd64|i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;; 1470 x86_64|amd64|i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
1485 ia64) host_arch=ia64 ;; 1471 ia64) host_arch=ia64 ;;
1486 macppc|ppc) host_arch=ppc ;; 1472 macppc|ppc) host_arch=ppc ;;
1487 ppc64) host_arch=ppc64 ;; 1473 ppc64) host_arch=ppc64 ;;
1488 alpha) host_arch=alpha ;; 1474 alpha) host_arch=alpha ;;
1495 s390x) host_arch=s390x ;; 1481 s390x) host_arch=s390x ;;
1496 *mips*) host_arch=mips ;; 1482 *mips*) host_arch=mips ;;
1497 vax) host_arch=vax ;; 1483 vax) host_arch=vax ;;
1498 xtensa*) host_arch=xtensa ;; 1484 xtensa*) host_arch=xtensa ;;
1499 *) host_arch=UNKNOWN ;; 1485 *) host_arch=UNKNOWN ;;
1500 esac
1501 ;;
1502 esac 1486 esac
1503 else # if test -z "$_target" 1487 else # if test -z "$_target"
1504 system_name=$(echo $_target | cut -d '-' -f 2) 1488 system_name=$(echo $_target | cut -d '-' -f 2)
1505 case "$(echo $system_name | tr A-Z a-z)" in 1489 case "$(echo $system_name | tr A-Z a-z)" in
1506 linux) system_name=Linux ;; 1490 linux) system_name=Linux ;;