11#! /bin/sh
22# Attempt to guess a canonical system name.
3- # Copyright 1992-2013 Free Software Foundation, Inc.
3+ # Copyright 1992-2014 Free Software Foundation, Inc.
44
5- timestamp=' 2013-06-10 '
5+ timestamp=' 2014-11-04 '
66
77# This file is free software; you can redistribute it and/or modify it
88# under the terms of the GNU General Public License as published by
@@ -24,12 +24,12 @@ timestamp='2013-06-10'
2424# program. This Exception is an additional permission under section 7
2525# of the GNU General Public License, version 3 ("GPLv3").
2626#
27- # Originally written by Per Bothner.
27+ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston .
2828#
2929# You can get the latest version of this script from:
3030# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
3131#
32- # Please send patches with a ChangeLog entry to config-patches@gnu.org.
32+ # Please send patches to < config-patches@gnu.org> .
3333
3434
3535me=` echo " $0 " | sed -e ' s,.*/,,' `
@@ -50,7 +50,7 @@ version="\
5050GNU config.guess ($timestamp )
5151
5252Originally written by Per Bothner.
53- Copyright 1992-2013 Free Software Foundation, Inc.
53+ Copyright 1992-2014 Free Software Foundation, Inc.
5454
5555This is free software; see the source for copying conditions. There is NO
5656warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
149149 LIBC=gnu
150150 #endif
151151 EOF
152- eval ` $CC_FOR_BUILD -E $dummy .c 2> /dev/null | grep ' ^LIBC' `
152+ eval ` $CC_FOR_BUILD -E $dummy .c 2> /dev/null | grep ' ^LIBC' | sed ' s, ,,g ' `
153153 ;;
154154esac
155155
579579 else
580580 IBM_ARCH=powerpc
581581 fi
582- if [ -x /usr/bin/oslevel ] ; then
583- IBM_REV=` /usr/bin/oslevel`
582+ if [ -x /usr/bin/lslpp ] ; then
583+ IBM_REV=` /usr/bin/lslpp -Lqc bos.rte.libc |
584+ awk -F: ' { print $3 }' | sed s/[0-9]* $/0/`
584585 else
585586 IBM_REV=${UNAME_VERSION} .${UNAME_RELEASE}
586587 fi
826827 * :MINGW* :* )
827828 echo ${UNAME_MACHINE} -pc-mingw32
828829 exit ;;
829- i * :MSYS* :* )
830+ * :MSYS* :* )
830831 echo ${UNAME_MACHINE} -pc-msys
831832 exit ;;
832833 i* :windows32* :* )
@@ -969,10 +970,10 @@ EOF
969970 eval ` $CC_FOR_BUILD -E $dummy .c 2> /dev/null | grep ' ^CPU' `
970971 test x" ${CPU} " ! = x && { echo " ${CPU} -unknown-linux-${LIBC} " ; exit ; }
971972 ;;
972- or1k :Linux:* :* )
973- echo ${UNAME_MACHINE} -unknown-linux-${LIBC}
973+ openrisc * :Linux:* :* )
974+ echo or1k -unknown-linux-${LIBC}
974975 exit ;;
975- or32:Linux:* :* )
976+ or32:Linux:* :* | or1k * :Linux: * : * )
976977 echo ${UNAME_MACHINE} -unknown-linux-${LIBC}
977978 exit ;;
978979 padre:Linux:* :* )
@@ -1260,16 +1261,26 @@ EOF
12601261 if test " $UNAME_PROCESSOR " = unknown ; then
12611262 UNAME_PROCESSOR=powerpc
12621263 fi
1263- if [ " $CC_FOR_BUILD " != ' no_compiler_found' ]; then
1264- if (echo ' #ifdef __LP64__' ; echo IS_64BIT_ARCH; echo ' #endif' ) | \
1265- (CCOPTS= $CC_FOR_BUILD -E - 2> /dev/null) | \
1266- grep IS_64BIT_ARCH > /dev/null
1267- then
1268- case $UNAME_PROCESSOR in
1269- i386) UNAME_PROCESSOR=x86_64 ;;
1270- powerpc) UNAME_PROCESSOR=powerpc64 ;;
1271- esac
1264+ if test ` echo " $UNAME_RELEASE " | sed -e ' s/\..*//' ` -le 10 ; then
1265+ if [ " $CC_FOR_BUILD " != ' no_compiler_found' ]; then
1266+ if (echo ' #ifdef __LP64__' ; echo IS_64BIT_ARCH; echo ' #endif' ) | \
1267+ (CCOPTS= $CC_FOR_BUILD -E - 2> /dev/null) | \
1268+ grep IS_64BIT_ARCH > /dev/null
1269+ then
1270+ case $UNAME_PROCESSOR in
1271+ i386) UNAME_PROCESSOR=x86_64 ;;
1272+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
1273+ esac
1274+ fi
12721275 fi
1276+ elif test " $UNAME_PROCESSOR " = i386 ; then
1277+ # Avoid executing cc on OS X 10.9, as it ships with a stub
1278+ # that puts up a graphical alert prompting to install
1279+ # developer tools. Any system running Mac OS X 10.7 or
1280+ # later (Darwin 11 and later) is required to have a 64-bit
1281+ # processor. This is not true of the ARM version of Darwin
1282+ # that Apple uses in portable devices.
1283+ UNAME_PROCESSOR=x86_64
12731284 fi
12741285 echo ${UNAME_PROCESSOR} -apple-darwin${UNAME_RELEASE}
12751286 exit ;;
@@ -1361,154 +1372,6 @@ EOF
13611372 exit ;;
13621373esac
13631374
1364- eval $set_cc_for_build
1365- cat > $dummy .c << EOF
1366- #ifdef _SEQUENT_
1367- # include <sys/types.h>
1368- # include <sys/utsname.h>
1369- #endif
1370- main ()
1371- {
1372- #if defined (sony)
1373- #if defined (MIPSEB)
1374- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1375- I don't know.... */
1376- printf ("mips-sony-bsd\n"); exit (0);
1377- #else
1378- #include <sys/param.h>
1379- printf ("m68k-sony-newsos%s\n",
1380- #ifdef NEWSOS4
1381- "4"
1382- #else
1383- ""
1384- #endif
1385- ); exit (0);
1386- #endif
1387- #endif
1388-
1389- #if defined (__arm) && defined (__acorn) && defined (__unix)
1390- printf ("arm-acorn-riscix\n"); exit (0);
1391- #endif
1392-
1393- #if defined (hp300) && !defined (hpux)
1394- printf ("m68k-hp-bsd\n"); exit (0);
1395- #endif
1396-
1397- #if defined (NeXT)
1398- #if !defined (__ARCHITECTURE__)
1399- #define __ARCHITECTURE__ "m68k"
1400- #endif
1401- int version;
1402- version=` (hostinfo | sed -n ' s/.*NeXT Mach \([0-9]*\).*/\1/p' ) 2> /dev/null` ;
1403- if (version < 4)
1404- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1405- else
1406- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1407- exit (0);
1408- #endif
1409-
1410- #if defined (MULTIMAX) || defined (n16)
1411- #if defined (UMAXV)
1412- printf ("ns32k-encore-sysv\n"); exit (0);
1413- #else
1414- #if defined (CMU)
1415- printf ("ns32k-encore-mach\n"); exit (0);
1416- #else
1417- printf ("ns32k-encore-bsd\n"); exit (0);
1418- #endif
1419- #endif
1420- #endif
1421-
1422- #if defined (__386BSD__)
1423- printf ("i386-pc-bsd\n"); exit (0);
1424- #endif
1425-
1426- #if defined (sequent)
1427- #if defined (i386)
1428- printf ("i386-sequent-dynix\n"); exit (0);
1429- #endif
1430- #if defined (ns32000)
1431- printf ("ns32k-sequent-dynix\n"); exit (0);
1432- #endif
1433- #endif
1434-
1435- #if defined (_SEQUENT_)
1436- struct utsname un;
1437-
1438- uname(&un);
1439-
1440- if (strncmp(un.version, "V2", 2) == 0) {
1441- printf ("i386-sequent-ptx2\n"); exit (0);
1442- }
1443- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1444- printf ("i386-sequent-ptx1\n"); exit (0);
1445- }
1446- printf ("i386-sequent-ptx\n"); exit (0);
1447-
1448- #endif
1449-
1450- #if defined (vax)
1451- # if !defined (ultrix)
1452- # include <sys/param.h>
1453- # if defined (BSD)
1454- # if BSD == 43
1455- printf ("vax-dec-bsd4.3\n"); exit (0);
1456- # else
1457- # if BSD == 199006
1458- printf ("vax-dec-bsd4.3reno\n"); exit (0);
1459- # else
1460- printf ("vax-dec-bsd\n"); exit (0);
1461- # endif
1462- # endif
1463- # else
1464- printf ("vax-dec-bsd\n"); exit (0);
1465- # endif
1466- # else
1467- printf ("vax-dec-ultrix\n"); exit (0);
1468- # endif
1469- #endif
1470-
1471- #if defined (alliant) && defined (i860)
1472- printf ("i860-alliant-bsd\n"); exit (0);
1473- #endif
1474-
1475- exit (1);
1476- }
1477- EOF
1478-
1479- $CC_FOR_BUILD -o $dummy $dummy .c 2> /dev/null && SYSTEM_NAME=` $dummy ` &&
1480- { echo " $SYSTEM_NAME " ; exit ; }
1481-
1482- # Apollos put the system type in the environment.
1483-
1484- test -d /usr/apollo && { echo ${ISP} -apollo-${SYSTYPE} ; exit ; }
1485-
1486- # Convex versions that predate uname can use getsysinfo(1)
1487-
1488- if [ -x /usr/convex/getsysinfo ]
1489- then
1490- case ` getsysinfo -f cpu_type` in
1491- c1* )
1492- echo c1-convex-bsd
1493- exit ;;
1494- c2* )
1495- if getsysinfo -f scalar_acc
1496- then echo c32-convex-bsd
1497- else echo c2-convex-bsd
1498- fi
1499- exit ;;
1500- c34* )
1501- echo c34-convex-bsd
1502- exit ;;
1503- c38* )
1504- echo c38-convex-bsd
1505- exit ;;
1506- c4* )
1507- echo c4-convex-bsd
1508- exit ;;
1509- esac
1510- fi
1511-
15121375cat >&2 << EOF
15131376$0 : unable to guess system type
15141377
0 commit comments