1
1
#! /bin/sh
2
2
#
3
- # Copyright (c) 2012, 2023 , Oracle and/or its affiliates. All rights reserved.
3
+ # Copyright (c) 2012, 2024 , Oracle and/or its affiliates. All rights reserved.
4
4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
5
#
6
6
# This code is free software; you can redistribute it and/or modify it
25
25
#
26
26
27
27
# Attempt to guess a canonical system name.
28
- # Copyright 1992-2022 Free Software Foundation, Inc.
28
+ # Copyright 1992-2024 Free Software Foundation, Inc.
29
29
30
30
# shellcheck disable=SC2006,SC2268 # see below for rationale
31
31
32
- timestamp=' 2022-09-17 '
32
+ timestamp=' 2024-01-01 '
33
33
34
34
# This file is free software; you can redistribute it and/or modify it
35
35
# under the terms of the GNU General Public License as published by
@@ -72,7 +72,7 @@ me=`echo "$0" | sed -e 's,.*/,,'`
72
72
usage=" \
73
73
Usage: $0 [OPTION]
74
74
75
- Output the configuration name of the system \` $me ' is run on.
75
+ Output the configuration name of the system ' $me ' is run on.
76
76
77
77
Options:
78
78
-h, --help print this help, then exit
@@ -85,13 +85,13 @@ version="\
85
85
GNU config.guess ($timestamp )
86
86
87
87
Originally written by Per Bothner.
88
- Copyright 1992-2022 Free Software Foundation, Inc.
88
+ Copyright 1992-2024 Free Software Foundation, Inc.
89
89
90
90
This is free software; see the source for copying conditions. There is NO
91
91
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
92
92
93
93
help="
94
- Try \` $me --help' for more information."
94
+ Try ' $me --help' for more information."
95
95
96
96
# Parse command line
97
97
while test $# -gt 0 ; do
@@ -127,8 +127,8 @@ GUESS=
127
127
# temporary files to be created and, as you can see below, it is a
128
128
# headache to deal with in a portable fashion.
129
129
130
- # Historically, ` CC_FOR_BUILD' used to be named ` HOST_CC'. We still
131
- # use ` HOST_CC' if defined, but it is deprecated.
130
+ # Historically, ' CC_FOR_BUILD' used to be named ' HOST_CC'. We still
131
+ # use ' HOST_CC' if defined, but it is deprecated.
132
132
133
133
# Portable tmp directory creation inspired by the Autoconf team.
134
134
@@ -180,20 +180,26 @@ Linux|GNU|GNU/*)
180
180
181
181
set_cc_for_build
182
182
cat << -EOF > "$dummy .c"
183
+ #if defined(__ANDROID__)
184
+ LIBC=android
185
+ #else
183
186
#include <features.h>
184
187
#if defined(__UCLIBC__)
185
188
LIBC=uclibc
186
189
#elif defined(__dietlibc__)
187
190
LIBC=dietlibc
188
191
#elif defined(__GLIBC__)
189
192
LIBC=gnu
193
+ #elif defined(__LLVM_LIBC__)
194
+ LIBC=llvm
190
195
#else
191
196
#include <stdarg.h>
192
197
/* First heuristic to detect musl libc. */
193
198
#ifdef __DEFINED_va_list
194
199
LIBC=musl
195
200
#endif
196
201
#endif
202
+ #endif
197
203
EOF
198
204
cc_set_libc=` $CC_FOR_BUILD -E " $dummy .c" 2> /dev/null | grep ' ^LIBC' | sed ' s, ,,g' `
199
205
eval " $cc_set_libc "
@@ -484,7 +490,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
484
490
UNAME_RELEASE=` uname -v`
485
491
;;
486
492
esac
487
- # Japanese Language versions have a version number like ` 4.1.3-JL'.
493
+ # Japanese Language versions have a version number like ' 4.1.3-JL'.
488
494
SUN_REL=` echo " $UNAME_RELEASE " | sed -e ' s/-/_/' `
489
495
GUESS=sparc-sun-sunos$SUN_REL
490
496
;;
929
935
fi
930
936
;;
931
937
* :FreeBSD:* :* )
932
- UNAME_PROCESSOR=` /usr/bin/ uname -p`
938
+ UNAME_PROCESSOR=` uname -p`
933
939
case $UNAME_PROCESSOR in
934
940
amd64)
935
941
UNAME_PROCESSOR=x86_64 ;;
@@ -1001,7 +1007,27 @@ EOF
1001
1007
GUESS=$UNAME_MACHINE -unknown-minix
1002
1008
;;
1003
1009
aarch64:Linux:* :* )
1004
- GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
1010
+ set_cc_for_build
1011
+ CPU=$UNAME_MACHINE
1012
+ LIBCABI=$LIBC
1013
+ if test " $CC_FOR_BUILD " ! = no_compiler_found; then
1014
+ ABI=64
1015
+ sed ' s/^ //' << EOF > "$dummy .c"
1016
+ #ifdef __ARM_EABI__
1017
+ #ifdef __ARM_PCS_VFP
1018
+ ABI=eabihf
1019
+ #else
1020
+ ABI=eabi
1021
+ #endif
1022
+ #endif
1023
+ EOF
1024
+ cc_set_abi=` $CC_FOR_BUILD -E " $dummy .c" 2> /dev/null | grep ' ^ABI' | sed ' s, ,,g' `
1025
+ eval " $cc_set_abi "
1026
+ case $ABI in
1027
+ eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
1028
+ esac
1029
+ fi
1030
+ GUESS=$CPU -unknown-linux-$LIBCABI
1005
1031
;;
1006
1032
aarch64_be:Linux:* :* )
1007
1033
UNAME_MACHINE=aarch64_be
@@ -1067,6 +1093,15 @@ EOF
1067
1093
k1om:Linux:* :* )
1068
1094
GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
1069
1095
;;
1096
+ kvx:Linux:* :* )
1097
+ GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
1098
+ ;;
1099
+ kvx:cos:* :* )
1100
+ GUESS=$UNAME_MACHINE -unknown-cos
1101
+ ;;
1102
+ kvx:mbr:* :* )
1103
+ GUESS=$UNAME_MACHINE -unknown-mbr
1104
+ ;;
1070
1105
loongarch32:Linux:* :* | loongarch64:Linux:* :* )
1071
1106
GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
1072
1107
;;
@@ -1222,7 +1257,7 @@ EOF
1222
1257
GUESS=$UNAME_MACHINE -pc-sysv4.2uw$UNAME_VERSION
1223
1258
;;
1224
1259
i* 86:OS/2:* :* )
1225
- # If we were able to find ` uname', then EMX Unix compatibility
1260
+ # If we were able to find ' uname', then EMX Unix compatibility
1226
1261
# is probably installed.
1227
1262
GUESS=$UNAME_MACHINE -pc-os2-emx
1228
1263
;;
@@ -1363,7 +1398,7 @@ EOF
1363
1398
GUESS=ns32k-sni-sysv
1364
1399
fi
1365
1400
;;
1366
- PENTIUM:* :4.0* :* ) # Unisys ` ClearPath HMP IX 4000' SVR4/MP effort
1401
+ PENTIUM:* :4.0* :* ) # Unisys ' ClearPath HMP IX 4000' SVR4/MP effort
1367
1402
1368
1403
GUESS=i586-unisys-sysv4
1369
1404
;;
@@ -1585,6 +1620,9 @@ EOF
1585
1620
* :Unleashed:* :* )
1586
1621
GUESS=$UNAME_MACHINE -unknown-unleashed$UNAME_RELEASE
1587
1622
;;
1623
+ * :Ironclad:* :* )
1624
+ GUESS=$UNAME_MACHINE -unknown-ironclad
1625
+ ;;
1588
1626
esac
1589
1627
1590
1628
# Do we have a guess based on uname results?
0 commit comments