2 |
# Attempt to guess a canonical system name. |
# Attempt to guess a canonical system name. |
3 |
# Copyright 1992-2020 Free Software Foundation, Inc. |
# Copyright 1992-2020 Free Software Foundation, Inc. |
4 |
|
|
5 |
timestamp='2020-11-07' |
timestamp='2020-12-22' |
6 |
|
|
7 |
# This file is free software; you can redistribute it and/or modify it |
# This file is free software; you can redistribute it and/or modify it |
8 |
# under the terms of the GNU General Public License as published by |
# under the terms of the GNU General Public License as published by |
27 |
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. |
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. |
28 |
# |
# |
29 |
# You can get the latest version of this script from: |
# You can get the latest version of this script from: |
30 |
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess |
# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess |
31 |
# |
# |
32 |
# Please send patches to <config-patches@gnu.org>. |
# Please send patches to <config-patches@gnu.org>. |
33 |
|
|
138 |
|
|
139 |
case "$UNAME_SYSTEM" in |
case "$UNAME_SYSTEM" in |
140 |
Linux|GNU|GNU/*) |
Linux|GNU|GNU/*) |
141 |
# If the system lacks a compiler, then just pick glibc. |
LIBC=unknown |
|
# We could probably try harder. |
|
|
LIBC=gnu |
|
142 |
|
|
143 |
set_cc_for_build |
set_cc_for_build |
144 |
cat <<-EOF > "$dummy.c" |
cat <<-EOF > "$dummy.c" |
147 |
LIBC=uclibc |
LIBC=uclibc |
148 |
#elif defined(__dietlibc__) |
#elif defined(__dietlibc__) |
149 |
LIBC=dietlibc |
LIBC=dietlibc |
150 |
|
#elif defined(__GLIBC__) |
151 |
|
LIBC=gnu |
152 |
#else |
#else |
153 |
#include <stdarg.h> |
#include <stdarg.h> |
154 |
|
/* First heuristic to detect musl libc. */ |
155 |
#ifdef __DEFINED_va_list |
#ifdef __DEFINED_va_list |
156 |
LIBC=musl |
LIBC=musl |
|
#else |
|
|
LIBC=gnu |
|
157 |
#endif |
#endif |
158 |
#endif |
#endif |
159 |
EOF |
EOF |
160 |
eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" |
eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" |
161 |
|
|
162 |
|
# Second heuristic to detect musl libc. |
163 |
|
if [ "$LIBC" = unknown ] && |
164 |
|
command -v ldd >/dev/null && |
165 |
|
ldd --version 2>&1 | grep -q ^musl; then |
166 |
|
LIBC=musl |
167 |
|
fi |
168 |
|
|
169 |
|
# If the system lacks a compiler, then just pick glibc. |
170 |
|
# We could probably try harder. |
171 |
|
if [ "$LIBC" = unknown ]; then |
172 |
|
LIBC=gnu |
173 |
|
fi |
174 |
;; |
;; |
175 |
esac |
esac |
176 |
|
|
996 |
k1om:Linux:*:*) |
k1om:Linux:*:*) |
997 |
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
998 |
exit ;; |
exit ;; |
999 |
|
loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) |
1000 |
|
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
1001 |
|
exit ;; |
1002 |
m32r*:Linux:*:*) |
m32r*:Linux:*:*) |
1003 |
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" |
1004 |
exit ;; |
exit ;; |
1653 |
operating system you are using. If your script is old, overwrite *all* |
operating system you are using. If your script is old, overwrite *all* |
1654 |
copies of config.guess and config.sub with the latest versions from: |
copies of config.guess and config.sub with the latest versions from: |
1655 |
|
|
1656 |
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess |
https://git.savannah.gnu.org/cgit/config.git/plain/config.guess |
1657 |
and |
and |
1658 |
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub |
https://git.savannah.gnu.org/cgit/config.git/plain/config.sub |
1659 |
EOF |
EOF |
1660 |
|
|
1661 |
year=$(echo $timestamp | sed 's,-.*,,') |
year=$(echo $timestamp | sed 's,-.*,,') |