1
1
#! /bin/sh
2
2
# Attempt to guess a canonical system name.
3
- # Copyright 1992-2021 Free Software Foundation, Inc.
3
+ # Copyright 1992-2023 Free Software Foundation, Inc.
4
4
5
5
# shellcheck disable=SC2006,SC2268 # see below for rationale
6
6
7
- timestamp=' 2021-06-03 '
7
+ timestamp=' 2023-08-22 '
8
8
9
9
# This file is free software; you can redistribute it and/or modify it
10
10
# under the terms of the GNU General Public License as published by
11
- # the Free Software Foundation; either version 3 of the License, or
11
+ # the Free Software Foundation, either version 3 of the License, or
12
12
# (at your option) any later version.
13
13
#
14
14
# This program is distributed in the hope that it will be useful, but
@@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'`
47
47
usage=" \
48
48
Usage: $0 [OPTION]
49
49
50
- Output the configuration name of the system \` $me ' is run on.
50
+ Output the configuration name of the system ' $me ' is run on.
51
51
52
52
Options:
53
53
-h, --help print this help, then exit
@@ -60,13 +60,13 @@ version="\
60
60
GNU config.guess ($timestamp )
61
61
62
62
Originally written by Per Bothner.
63
- Copyright 1992-2021 Free Software Foundation, Inc.
63
+ Copyright 1992-2023 Free Software Foundation, Inc.
64
64
65
65
This is free software; see the source for copying conditions. There is NO
66
66
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
67
67
68
68
help="
69
- Try \` $me --help' for more information."
69
+ Try ' $me --help' for more information."
70
70
71
71
# Parse command line
72
72
while test $# -gt 0 ; do
@@ -102,8 +102,8 @@ GUESS=
102
102
# temporary files to be created and, as you can see below, it is a
103
103
# headache to deal with in a portable fashion.
104
104
105
- # Historically, ` CC_FOR_BUILD' used to be named ` HOST_CC'. We still
106
- # use ` HOST_CC' if defined, but it is deprecated.
105
+ # Historically, ' CC_FOR_BUILD' used to be named ' HOST_CC'. We still
106
+ # use ' HOST_CC' if defined, but it is deprecated.
107
107
108
108
# Portable tmp directory creation inspired by the Autoconf team.
109
109
@@ -155,6 +155,9 @@ Linux|GNU|GNU/*)
155
155
156
156
set_cc_for_build
157
157
cat << -EOF > "$dummy .c"
158
+ #if defined(__ANDROID__)
159
+ LIBC=android
160
+ #else
158
161
#include <features.h>
159
162
#if defined(__UCLIBC__)
160
163
LIBC=uclibc
@@ -169,6 +172,7 @@ Linux|GNU|GNU/*)
169
172
LIBC=musl
170
173
#endif
171
174
#endif
175
+ #endif
172
176
EOF
173
177
cc_set_libc=` $CC_FOR_BUILD -E " $dummy .c" 2> /dev/null | grep ' ^LIBC' | sed ' s, ,,g' `
174
178
eval " $cc_set_libc "
@@ -437,7 +441,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
437
441
# This test works for both compilers.
438
442
if test " $CC_FOR_BUILD " ! = no_compiler_found; then
439
443
if (echo ' #ifdef __amd64' ; echo IS_64BIT_ARCH; echo ' #endif' ) | \
440
- (CCOPTS=" " $CC_FOR_BUILD -E - 2> /dev/null) | \
444
+ (CCOPTS=" " $CC_FOR_BUILD -m64 - E - 2> /dev/null) | \
441
445
grep IS_64BIT_ARCH > /dev/null
442
446
then
443
447
SUN_ARCH=x86_64
@@ -459,7 +463,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
459
463
UNAME_RELEASE=` uname -v`
460
464
;;
461
465
esac
462
- # Japanese Language versions have a version number like ` 4.1.3-JL'.
466
+ # Japanese Language versions have a version number like ' 4.1.3-JL'.
463
467
SUN_REL=` echo " $UNAME_RELEASE " | sed -e ' s/-/_/' `
464
468
GUESS=sparc-sun-sunos$SUN_REL
465
469
;;
904
908
fi
905
909
;;
906
910
* :FreeBSD:* :* )
907
- UNAME_PROCESSOR=` /usr/bin/ uname -p`
911
+ UNAME_PROCESSOR=` uname -p`
908
912
case $UNAME_PROCESSOR in
909
913
amd64)
910
914
UNAME_PROCESSOR=x86_64 ;;
929
933
i* :PW* :* )
930
934
GUESS=$UNAME_MACHINE -pc-pw32
931
935
;;
936
+ * :SerenityOS:* :* )
937
+ GUESS=$UNAME_MACHINE -pc-serenity
938
+ ;;
932
939
* :Interix* :* )
933
940
case $UNAME_MACHINE in
934
941
x86)
@@ -963,11 +970,37 @@ EOF
963
970
GNU_REL=` echo " $UNAME_RELEASE " | sed -e ' s/[-(].*//' `
964
971
GUESS=$UNAME_MACHINE -unknown-$GNU_SYS$GNU_REL -$LIBC
965
972
;;
973
+ x86_64:[Mm]anagarm:* :* |i? 86:[Mm]anagarm:* :* )
974
+ GUESS=" $UNAME_MACHINE -pc-managarm-mlibc"
975
+ ;;
976
+ * :[Mm]anagarm:* :* )
977
+ GUESS=" $UNAME_MACHINE -unknown-managarm-mlibc"
978
+ ;;
966
979
* :Minix:* :* )
967
980
GUESS=$UNAME_MACHINE -unknown-minix
968
981
;;
969
982
aarch64:Linux:* :* )
970
- GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
983
+ set_cc_for_build
984
+ CPU=$UNAME_MACHINE
985
+ LIBCABI=$LIBC
986
+ if test " $CC_FOR_BUILD " ! = no_compiler_found; then
987
+ ABI=64
988
+ sed ' s/^ //' << EOF > "$dummy .c"
989
+ #ifdef __ARM_EABI__
990
+ #ifdef __ARM_PCS_VFP
991
+ ABI=eabihf
992
+ #else
993
+ ABI=eabi
994
+ #endif
995
+ #endif
996
+ EOF
997
+ cc_set_abi=` $CC_FOR_BUILD -E " $dummy .c" 2> /dev/null | grep ' ^ABI' | sed ' s, ,,g' `
998
+ eval " $cc_set_abi "
999
+ case $ABI in
1000
+ eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
1001
+ esac
1002
+ fi
1003
+ GUESS=$CPU -unknown-linux-$LIBCABI
971
1004
;;
972
1005
aarch64_be:Linux:* :* )
973
1006
UNAME_MACHINE=aarch64_be
@@ -1033,7 +1066,16 @@ EOF
1033
1066
k1om:Linux:* :* )
1034
1067
GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
1035
1068
;;
1036
- loongarch32:Linux:* :* | loongarch64:Linux:* :* | loongarchx32:Linux:* :* )
1069
+ kvx:Linux:* :* )
1070
+ GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
1071
+ ;;
1072
+ kvx:cos:* :* )
1073
+ GUESS=$UNAME_MACHINE -unknown-cos
1074
+ ;;
1075
+ kvx:mbr:* :* )
1076
+ GUESS=$UNAME_MACHINE -unknown-mbr
1077
+ ;;
1078
+ loongarch32:Linux:* :* | loongarch64:Linux:* :* )
1037
1079
GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
1038
1080
;;
1039
1081
m32r* :Linux:* :* )
@@ -1148,16 +1190,27 @@ EOF
1148
1190
;;
1149
1191
x86_64:Linux:* :* )
1150
1192
set_cc_for_build
1193
+ CPU=$UNAME_MACHINE
1151
1194
LIBCABI=$LIBC
1152
1195
if test " $CC_FOR_BUILD " ! = no_compiler_found; then
1153
- if (echo ' #ifdef __ILP32__' ; echo IS_X32; echo ' #endif' ) | \
1154
- (CCOPTS=" " $CC_FOR_BUILD -E - 2> /dev/null) | \
1155
- grep IS_X32 > /dev/null
1156
- then
1157
- LIBCABI=${LIBC} x32
1158
- fi
1196
+ ABI=64
1197
+ sed ' s/^ //' << EOF > "$dummy .c"
1198
+ #ifdef __i386__
1199
+ ABI=x86
1200
+ #else
1201
+ #ifdef __ILP32__
1202
+ ABI=x32
1203
+ #endif
1204
+ #endif
1205
+ EOF
1206
+ cc_set_abi=` $CC_FOR_BUILD -E " $dummy .c" 2> /dev/null | grep ' ^ABI' | sed ' s, ,,g' `
1207
+ eval " $cc_set_abi "
1208
+ case $ABI in
1209
+ x86) CPU=i686 ;;
1210
+ x32) LIBCABI=${LIBC} x32 ;;
1211
+ esac
1159
1212
fi
1160
- GUESS=$UNAME_MACHINE -pc-linux-$LIBCABI
1213
+ GUESS=$CPU -pc-linux-$LIBCABI
1161
1214
;;
1162
1215
xtensa* :Linux:* :* )
1163
1216
GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
@@ -1177,7 +1230,7 @@ EOF
1177
1230
GUESS=$UNAME_MACHINE -pc-sysv4.2uw$UNAME_VERSION
1178
1231
;;
1179
1232
i* 86:OS/2:* :* )
1180
- # If we were able to find ` uname', then EMX Unix compatibility
1233
+ # If we were able to find ' uname', then EMX Unix compatibility
1181
1234
# is probably installed.
1182
1235
GUESS=$UNAME_MACHINE -pc-os2-emx
1183
1236
;;
@@ -1318,7 +1371,7 @@ EOF
1318
1371
GUESS=ns32k-sni-sysv
1319
1372
fi
1320
1373
;;
1321
- PENTIUM:* :4.0* :* ) # Unisys ` ClearPath HMP IX 4000' SVR4/MP effort
1374
+ PENTIUM:* :4.0* :* ) # Unisys ' ClearPath HMP IX 4000' SVR4/MP effort
1322
1375
# says <Richard.M.Bartel@ccMail.Census.GOV>
1323
1376
GUESS=i586-unisys-sysv4
1324
1377
;;
@@ -1364,8 +1417,11 @@ EOF
1364
1417
BePC:Haiku:* :* ) # Haiku running on Intel PC compatible.
1365
1418
GUESS=i586-pc-haiku
1366
1419
;;
1367
- x86_64:Haiku:* :* )
1368
- GUESS=x86_64-unknown-haiku
1420
+ ppc:Haiku:* :* ) # Haiku running on Apple PowerPC
1421
+ GUESS=powerpc-apple-haiku
1422
+ ;;
1423
+ * :Haiku:* :* ) # Haiku modern gcc (not bound by BeOS compat)
1424
+ GUESS=$UNAME_MACHINE -unknown-haiku
1369
1425
;;
1370
1426
SX-4:SUPER-UX:* :* )
1371
1427
GUESS=sx4-nec-superux$UNAME_RELEASE
@@ -1522,6 +1578,9 @@ EOF
1522
1578
i* 86:rdos:* :* )
1523
1579
GUESS=$UNAME_MACHINE -pc-rdos
1524
1580
;;
1581
+ i* 86:Fiwix:* :* )
1582
+ GUESS=$UNAME_MACHINE -pc-fiwix
1583
+ ;;
1525
1584
* :AROS:* :* )
1526
1585
GUESS=$UNAME_MACHINE -unknown-aros
1527
1586
;;
0 commit comments