Commit b9f6d1be authored by Alexandre Julliard's avatar Alexandre Julliard

tools: Upgrade the config.guess/config.sub scripts.

parent 4d2f2e80
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright 1992-2020 Free Software Foundation, Inc. # Copyright 1992-2021 Free Software Foundation, Inc.
timestamp='2020-07-10' # shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2021-08-14'
# 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
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
...@@ -33,7 +35,7 @@ timestamp='2020-07-10' ...@@ -33,7 +35,7 @@ timestamp='2020-07-10'
# Otherwise, we print the canonical config type on stdout and succeed. # Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from: # You can get the latest version of this script from:
# 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
# This file is supposed to be the same for all GNU packages # This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases # and recognize all the CPU types, system types and aliases
...@@ -50,6 +52,13 @@ timestamp='2020-07-10' ...@@ -50,6 +52,13 @@ timestamp='2020-07-10'
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification. # It is wrong to echo any other type of specification.
# The "shellcheck disable" line above the timestamp inhibits complaints
# about features and limitations of the classic Bourne shell that were
# superseded or lifted in POSIX. However, this script identifies a wide
# variety of pre-POSIX systems that do not have POSIX shells at all, and
# even some reasonably current systems (Solaris 10 as case-in-point) still
# have a pre-POSIX /bin/sh.
me=`echo "$0" | sed -e 's,.*/,,'` me=`echo "$0" | sed -e 's,.*/,,'`
usage="\ usage="\
...@@ -67,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>." ...@@ -67,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright 1992-2020 Free Software Foundation, Inc. Copyright 1992-2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
...@@ -112,9 +121,11 @@ esac ...@@ -112,9 +121,11 @@ esac
# Split fields of configuration type # Split fields of configuration type
# shellcheck disable=SC2162 # shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read field1 field2 field3 field4 <<EOF IFS="-" read field1 field2 field3 field4 <<EOF
$1 $1
EOF EOF
IFS=$saved_IFS
# Separate into logical components for further validation # Separate into logical components for further validation
case $1 in case $1 in
...@@ -163,6 +174,10 @@ case $1 in ...@@ -163,6 +174,10 @@ case $1 in
basic_machine=$field1 basic_machine=$field1
basic_os=$field2 basic_os=$field2
;; ;;
zephyr*)
basic_machine=$field1-unknown
basic_os=$field2
;;
# Manufacturers # Manufacturers
dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
...@@ -922,9 +937,11 @@ case $basic_machine in ...@@ -922,9 +937,11 @@ case $basic_machine in
*-*) *-*)
# shellcheck disable=SC2162 # shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read cpu vendor <<EOF IFS="-" read cpu vendor <<EOF
$basic_machine $basic_machine
EOF EOF
IFS=$saved_IFS
;; ;;
# We use `pc' rather than `unknown' # We use `pc' rather than `unknown'
# because (1) that's what they normally are, and # because (1) that's what they normally are, and
...@@ -1165,7 +1182,7 @@ case $cpu-$vendor in ...@@ -1165,7 +1182,7 @@ case $cpu-$vendor in
| alphapca5[67] | alpha64pca5[67] \ | alphapca5[67] | alpha64pca5[67] \
| am33_2.0 \ | am33_2.0 \
| amdgcn \ | amdgcn \
| arc | arceb \ | arc | arceb | arc32 | arc64 \
| arm | arm[lb]e | arme[lb] | armv* \ | arm | arm[lb]e | arme[lb] | armv* \
| avr | avr32 \ | avr | avr32 \
| asmjs \ | asmjs \
...@@ -1185,6 +1202,7 @@ case $cpu-$vendor in ...@@ -1185,6 +1202,7 @@ case $cpu-$vendor in
| k1om \ | k1om \
| le32 | le64 \ | le32 | le64 \
| lm32 \ | lm32 \
| loongarch32 | loongarch64 | loongarchx32 \
| m32c | m32r | m32rle \ | m32c | m32r | m32rle \
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
...@@ -1203,9 +1221,13 @@ case $cpu-$vendor in ...@@ -1203,9 +1221,13 @@ case $cpu-$vendor in
| mips64vr5900 | mips64vr5900el \ | mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \ | mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \ | mipsisa32r2 | mipsisa32r2el \
| mipsisa32r3 | mipsisa32r3el \
| mipsisa32r5 | mipsisa32r5el \
| mipsisa32r6 | mipsisa32r6el \ | mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \ | mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \ | mipsisa64r2 | mipsisa64r2el \
| mipsisa64r3 | mipsisa64r3el \
| mipsisa64r5 | mipsisa64r5el \
| mipsisa64r6 | mipsisa64r6el \ | mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \ | mipsisa64sr71k | mipsisa64sr71kel \
...@@ -1229,7 +1251,7 @@ case $cpu-$vendor in ...@@ -1229,7 +1251,7 @@ case $cpu-$vendor in
| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
| pru \ | pru \
| pyramid \ | pyramid \
| riscv | riscv32 | riscv64 \ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
| rl78 | romp | rs6000 | rx \ | rl78 | romp | rs6000 | rx \
| s390 | s390x \ | s390 | s390x \
| score \ | score \
...@@ -1241,6 +1263,7 @@ case $cpu-$vendor in ...@@ -1241,6 +1263,7 @@ case $cpu-$vendor in
| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
| spu \ | spu \
| tahoe \ | tahoe \
| thumbv7* \
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
| tron \ | tron \
| ubicom32 \ | ubicom32 \
...@@ -1278,7 +1301,7 @@ esac ...@@ -1278,7 +1301,7 @@ esac
# Decode manufacturer-specific aliases for certain operating systems. # Decode manufacturer-specific aliases for certain operating systems.
if [ x$basic_os != x ] if test x$basic_os != x
then then
# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just # First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
...@@ -1286,26 +1309,32 @@ then ...@@ -1286,26 +1309,32 @@ then
case $basic_os in case $basic_os in
gnu/linux*) gnu/linux*)
kernel=linux kernel=linux
os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'` os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
;;
os2-emx)
kernel=os2
os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
;; ;;
nto-qnx*) nto-qnx*)
kernel=nto kernel=nto
os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'` os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
;; ;;
*-*) *-*)
# shellcheck disable=SC2162 # shellcheck disable=SC2162
saved_IFS=$IFS
IFS="-" read kernel os <<EOF IFS="-" read kernel os <<EOF
$basic_os $basic_os
EOF EOF
IFS=$saved_IFS
;; ;;
# Default OS when just kernel was specified # Default OS when just kernel was specified
nto*) nto*)
kernel=nto kernel=nto
os=`echo $basic_os | sed -e 's|nto|qnx|'` os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
;; ;;
linux*) linux*)
kernel=linux kernel=linux
os=`echo $basic_os | sed -e 's|linux|gnu|'` os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
;; ;;
*) *)
kernel= kernel=
...@@ -1326,7 +1355,7 @@ case $os in ...@@ -1326,7 +1355,7 @@ case $os in
os=cnk os=cnk
;; ;;
solaris1 | solaris1.*) solaris1 | solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'` os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
;; ;;
solaris) solaris)
os=solaris2 os=solaris2
...@@ -1355,7 +1384,7 @@ case $os in ...@@ -1355,7 +1384,7 @@ case $os in
os=sco3.2v4 os=sco3.2v4
;; ;;
sco3.2.[4-9]*) sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
;; ;;
sco*v* | scout) sco*v* | scout)
# Don't match below # Don't match below
...@@ -1367,13 +1396,7 @@ case $os in ...@@ -1367,13 +1396,7 @@ case $os in
os=psos os=psos
;; ;;
qnx*) qnx*)
case $cpu in os=qnx
x86 | i*86)
;;
*)
os=nto-$os
;;
esac
;; ;;
hiux*) hiux*)
os=hiuxwe2 os=hiuxwe2
...@@ -1437,7 +1460,7 @@ case $os in ...@@ -1437,7 +1460,7 @@ case $os in
;; ;;
# Preserve the version number of sinix5. # Preserve the version number of sinix5.
sinix5.*) sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'` os=`echo "$os" | sed -e 's|sinix|sysv|'`
;; ;;
sinix*) sinix*)
os=sysv4 os=sysv4
...@@ -1683,11 +1706,14 @@ fi ...@@ -1683,11 +1706,14 @@ fi
# Now, validate our (potentially fixed-up) OS. # Now, validate our (potentially fixed-up) OS.
case $os in case $os in
# Sometimes we do "kernel-abi", so those need to count as OSes. # Sometimes we do "kernel-libc", so those need to count as OSes.
musl* | newlib* | uclibc*) musl* | newlib* | relibc* | uclibc*)
;;
# Likewise for "kernel-abi"
eabi* | gnueabi*)
;; ;;
# Likewise for "kernel-libc" # VxWorks passes extra cpu info in the 4th filed.
eabi | eabihf | gnueabi | gnueabihf) simlinux | simwindows | spe)
;; ;;
# Now accept the basic system types. # Now accept the basic system types.
# The portable systems comes first. # The portable systems comes first.
...@@ -1704,12 +1730,12 @@ case $os in ...@@ -1704,12 +1730,12 @@ case $os in
| nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
| clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
| mirbsd* | netbsd* | dicos* | openedition* | ose* \ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
| bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
| ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
| bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
| ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
| udi* | lites* | ieee* | go32* | aux* | hcos* \ | udi* | lites* | ieee* | go32* | aux* | hcos* \
| chorusrdb* | cegcc* | glidix* \ | chorusrdb* | cegcc* | glidix* | serenity* \
| cygwin* | msys* | pe* | moss* | proelf* | rtems* \ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
| midipix* | mingw32* | mingw64* | mint* \ | midipix* | mingw32* | mingw64* | mint* \
| uxpv* | beos* | mpeix* | udk* | moxiebox* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
...@@ -1722,7 +1748,7 @@ case $os in ...@@ -1722,7 +1748,7 @@ case $os in
| skyos* | haiku* | rdos* | toppers* | drops* | es* \ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
| nsk* | powerunix* | genode* | zvmoe* ) | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*)
;; ;;
# This one is extra strict with allowed versions # This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*) sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
...@@ -1739,9 +1765,12 @@ esac ...@@ -1739,9 +1765,12 @@ esac
# As a final step for OS-related things, validate the OS-kernel combination # As a final step for OS-related things, validate the OS-kernel combination
# (given a valid OS), if there is a kernel. # (given a valid OS), if there is a kernel.
case $kernel-$os in case $kernel-$os in
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
| linux-musl* | linux-relibc* | linux-uclibc* )
;; ;;
-dietlibc* | -newlib* | -musl* | -uclibc* ) uclinux-uclibc* )
;;
-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
# These are just libc implementations, not actual OSes, and thus # These are just libc implementations, not actual OSes, and thus
# require a kernel. # require a kernel.
echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
...@@ -1749,8 +1778,12 @@ case $kernel-$os in ...@@ -1749,8 +1778,12 @@ case $kernel-$os in
;; ;;
kfreebsd*-gnu* | kopensolaris*-gnu*) kfreebsd*-gnu* | kopensolaris*-gnu*)
;; ;;
vxworks-simlinux | vxworks-simwindows | vxworks-spe)
;;
nto-qnx*) nto-qnx*)
;; ;;
os2-emx)
;;
*-eabi* | *-gnueabi*) *-eabi* | *-gnueabi*)
;; ;;
-*) -*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment