mirror of
git://git.savannah.gnu.org/config.git
synced 2025-05-29 02:26:36 +12:00
* config.sub: Properly recognise configuration types with four
components. Re-work the old logic to simplify the shell code. Signed-off-by: Ben Elliston <bje@gnu.org>
This commit is contained in:
parent
642dd8df5e
commit
50a0413a5b
@ -1,3 +1,8 @@
|
|||||||
|
2018-05-05 John Ericson <john.ericson@obsidian.systems>
|
||||||
|
|
||||||
|
* config.sub: Properly recognise configuration types with four
|
||||||
|
components. Re-work the old logic to simplify the shell code.
|
||||||
|
|
||||||
2018-05-04 Ben Elliston <bje@gnu.org>
|
2018-05-04 Ben Elliston <bje@gnu.org>
|
||||||
|
|
||||||
* Makefile (shellcheck): New.
|
* Makefile (shellcheck): New.
|
||||||
|
51
config.sub
vendored
51
config.sub
vendored
@ -2,7 +2,7 @@
|
|||||||
# Configuration validation subroutine script.
|
# Configuration validation subroutine script.
|
||||||
# Copyright 1992-2018 Free Software Foundation, Inc.
|
# Copyright 1992-2018 Free Software Foundation, Inc.
|
||||||
|
|
||||||
timestamp='2018-05-03'
|
timestamp='2018-05-05'
|
||||||
|
|
||||||
# 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
|
||||||
@ -110,33 +110,48 @@ case $# in
|
|||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
# Spilt fields of configuration type
|
||||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
IFS="-" read field1 field2 field3 field4 <<EOF
|
||||||
maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
$1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Separate into logical components for further validation
|
||||||
|
case $1 in
|
||||||
|
*-*-*-*)
|
||||||
|
basic_machine=$field1-$field2
|
||||||
|
os=-$field3-$field4
|
||||||
|
;;
|
||||||
|
*-*-*)
|
||||||
|
# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
|
||||||
|
# parts
|
||||||
|
maybe_os=$field2-$field3
|
||||||
case $maybe_os in
|
case $maybe_os in
|
||||||
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
|
||||||
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
| linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
|
||||||
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
|
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
|
||||||
kopensolaris*-gnu* | cloudabi*-eabi* | \
|
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
|
||||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
| storm-chaos* | os2-emx* | rtmk-nova*)
|
||||||
|
basic_machine=$field1
|
||||||
os=-$maybe_os
|
os=-$maybe_os
|
||||||
basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
|
||||||
;;
|
;;
|
||||||
android-linux)
|
android-linux)
|
||||||
|
basic_machine=$field1-unknown
|
||||||
os=-linux-android
|
os=-linux-android
|
||||||
basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
|
basic_machine=$field1-$field2
|
||||||
case $1 in
|
os=-$field3
|
||||||
*-*)
|
|
||||||
os=`echo "$1" | sed 's/.*-/-/'`
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
os=
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
*-*)
|
||||||
|
basic_machine=$field1
|
||||||
|
os=-$field2
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
basic_machine=$1
|
||||||
|
os=
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
### Let's recognize common machines as not being operating systems so
|
### Let's recognize common machines as not being operating systems so
|
||||||
|
Loading…
x
Reference in New Issue
Block a user