11#! /bin/sh
22# Attempt to guess a canonical system name.
3- # Copyright 1992-2022 Free Software Foundation, Inc.
3+ # Copyright 1992-2025 Free Software Foundation, Inc.
44
55# shellcheck disable=SC2006,SC2268 # see below for rationale
66
7- timestamp=' 2022-09-17 '
7+ timestamp=' 2025-07-10 '
88
99# This file is free software; you can redistribute it and/or modify it
1010# under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'`
4747usage=" \
4848Usage: $0 [OPTION]
4949
50- Output the configuration name of the system \` $me ' is run on.
50+ Output the configuration name of the system ' $me ' is run on.
5151
5252Options:
5353 -h, --help print this help, then exit
@@ -60,13 +60,13 @@ version="\
6060GNU config.guess ($timestamp )
6161
6262Originally written by Per Bothner.
63- Copyright 1992-2022 Free Software Foundation, Inc.
63+ Copyright 1992-2025 Free Software Foundation, Inc.
6464
6565This is free software; see the source for copying conditions. There is NO
6666warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6767
6868help="
69- Try \` $me --help' for more information."
69+ Try ' $me --help' for more information."
7070
7171# Parse command line
7272while test $# -gt 0 ; do
@@ -102,8 +102,8 @@ GUESS=
102102# temporary files to be created and, as you can see below, it is a
103103# headache to deal with in a portable fashion.
104104
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.
107107
108108# Portable tmp directory creation inspired by the Autoconf team.
109109
@@ -123,7 +123,7 @@ set_cc_for_build() {
123123 dummy=$tmp /dummy
124124 case ${CC_FOR_BUILD-} ,${HOST_CC-} ,${CC-} in
125125 ,,) echo " int x;" > " $dummy .c"
126- for driver in cc gcc c89 c99 ; do
126+ for driver in cc gcc c17 c99 c89 ; do
127127 if ($driver -c -o " $dummy .o" " $dummy .c" ) > /dev/null 2>&1 ; then
128128 CC_FOR_BUILD=$driver
129129 break
@@ -155,20 +155,26 @@ Linux|GNU|GNU/*)
155155
156156 set_cc_for_build
157157 cat << -EOF > "$dummy .c"
158+ #if defined(__ANDROID__)
159+ LIBC=android
160+ #else
158161 #include <features.h>
159162 #if defined(__UCLIBC__)
160163 LIBC=uclibc
161164 #elif defined(__dietlibc__)
162165 LIBC=dietlibc
163166 #elif defined(__GLIBC__)
164167 LIBC=gnu
168+ #elif defined(__LLVM_LIBC__)
169+ LIBC=llvm
165170 #else
166171 #include <stdarg.h>
167172 /* First heuristic to detect musl libc. */
168173 #ifdef __DEFINED_va_list
169174 LIBC=musl
170175 #endif
171176 #endif
177+ #endif
172178 EOF
173179 cc_set_libc=` $CC_FOR_BUILD -E " $dummy .c" 2> /dev/null | grep ' ^LIBC' | sed ' s, ,,g' `
174180 eval " $cc_set_libc "
@@ -459,7 +465,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
459465 UNAME_RELEASE=` uname -v`
460466 ;;
461467 esac
462- # Japanese Language versions have a version number like ` 4.1.3-JL'.
468+ # Japanese Language versions have a version number like ' 4.1.3-JL'.
463469 SUN_REL=` echo " $UNAME_RELEASE " | sed -e ' s/-/_/' `
464470 GUESS=sparc-sun-sunos$SUN_REL
465471 ;;
628634 sed ' s/^ //' << EOF > "$dummy .c"
629635 #include <sys/systemcfg.h>
630636
631- main()
637+ int
638+ main ()
632639 {
633640 if (!__power_pc())
634641 exit(1);
712719 #include <stdlib.h>
713720 #include <unistd.h>
714721
715- int main ()
722+ int
723+ main ()
716724 {
717725 #if defined(_SC_KERNEL_BITS)
718726 long bits = sysconf(_SC_KERNEL_BITS);
904912 fi
905913 ;;
906914 * :FreeBSD:* :* )
907- UNAME_PROCESSOR=` /usr/bin/ uname -p`
915+ UNAME_PROCESSOR=` uname -p`
908916 case $UNAME_PROCESSOR in
909917 amd64)
910918 UNAME_PROCESSOR=x86_64 ;;
976984 GUESS=$UNAME_MACHINE -unknown-minix
977985 ;;
978986 aarch64:Linux:* :* )
979- GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
987+ set_cc_for_build
988+ CPU=$UNAME_MACHINE
989+ LIBCABI=$LIBC
990+ if test " $CC_FOR_BUILD " ! = no_compiler_found; then
991+ ABI=64
992+ sed ' s/^ //' << EOF > "$dummy .c"
993+ #ifdef __ARM_EABI__
994+ #ifdef __ARM_PCS_VFP
995+ ABI=eabihf
996+ #else
997+ ABI=eabi
998+ #endif
999+ #endif
1000+ EOF
1001+ cc_set_abi=` $CC_FOR_BUILD -E " $dummy .c" 2> /dev/null | grep ' ^ABI' | sed ' s, ,,g' `
1002+ eval " $cc_set_abi "
1003+ case $ABI in
1004+ eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
1005+ esac
1006+ fi
1007+ GUESS=$CPU -unknown-linux-$LIBCABI
9801008 ;;
9811009 aarch64_be:Linux:* :* )
9821010 UNAME_MACHINE=aarch64_be
@@ -1042,6 +1070,15 @@ EOF
10421070 k1om:Linux:* :* )
10431071 GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
10441072 ;;
1073+ kvx:Linux:* :* )
1074+ GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
1075+ ;;
1076+ kvx:cos:* :* )
1077+ GUESS=$UNAME_MACHINE -unknown-cos
1078+ ;;
1079+ kvx:mbr:* :* )
1080+ GUESS=$UNAME_MACHINE -unknown-mbr
1081+ ;;
10451082 loongarch32:Linux:* :* | loongarch64:Linux:* :* )
10461083 GUESS=$UNAME_MACHINE -unknown-linux-$LIBC
10471084 ;;
@@ -1197,7 +1234,7 @@ EOF
11971234 GUESS=$UNAME_MACHINE -pc-sysv4.2uw$UNAME_VERSION
11981235 ;;
11991236 i* 86:OS/2:* :* )
1200- # If we were able to find ` uname', then EMX Unix compatibility
1237+ # If we were able to find ' uname', then EMX Unix compatibility
12011238 # is probably installed.
12021239 GUESS=$UNAME_MACHINE -pc-os2-emx
12031240 ;;
@@ -1338,7 +1375,7 @@ EOF
13381375 GUESS=ns32k-sni-sysv
13391376 fi
13401377 ;;
1341- PENTIUM:* :4.0* :* ) # Unisys ` ClearPath HMP IX 4000' SVR4/MP effort
1378+ PENTIUM:* :4.0* :* ) # Unisys ' ClearPath HMP IX 4000' SVR4/MP effort
1342137913431380 GUESS=i586-unisys-sysv4
13441381 ;;
@@ -1560,6 +1597,12 @@ EOF
15601597 * :Unleashed:* :* )
15611598 GUESS=$UNAME_MACHINE -unknown-unleashed$UNAME_RELEASE
15621599 ;;
1600+ x86_64:[Ii]ronclad:* :* |i? 86:[Ii]ronclad:* :* )
1601+ GUESS=$UNAME_MACHINE -pc-ironclad-mlibc
1602+ ;;
1603+ * :[Ii]ronclad:* :* )
1604+ GUESS=$UNAME_MACHINE -unknown-ironclad-mlibc
1605+ ;;
15631606esac
15641607
15651608# Do we have a guess based on uname results?
@@ -1583,6 +1626,7 @@ cat > "$dummy.c" <<EOF
15831626#endif
15841627#endif
15851628#endif
1629+ int
15861630main ()
15871631{
15881632#if defined (sony)
17671811exit 1
17681812
17691813# Local variables:
1770- # eval: (add-hook 'before-save-hook 'time-stamp)
1814+ # eval: (add-hook 'before-save-hook 'time-stamp nil t )
17711815# time-stamp-start: "timestamp='"
1772- # time-stamp-format: "%:y -%02m-%02d"
1816+ # time-stamp-format: "%Y -%02m-%02d"
17731817# time-stamp-end: "'"
17741818# End:
0 commit comments