From ca138e34d06eeccaff2096ba60bed9dcae74da33 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 23 May 2018 11:30:06 +1000 Subject: [PATCH] * config.sub: Cordon off two-component aliases. Instead of just catching manufacturers as OSes across the board, catch them just as the second of two components. This prevents nonsense like: $ ./config.sub amd64-unknown-ibm x86_64-unknown-ibm-aix Signed-off-by: Ben Elliston --- ChangeLog | 4 ++++ config.sub | 45 +++++++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index f21c330..7a5d4fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2018-05-23 John Ericson + + * config.sub: Cordon off two-component aliases. + 2018-05-21 John Ericson * testsuite/config-sub.data: Add clipper-clix and m68k-mint tests. diff --git a/config.sub b/config.sub index f38250f..bf8e94a 100755 --- a/config.sub +++ b/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2018-05-19' +timestamp='2018-05-23' # 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 @@ -149,8 +149,30 @@ case $1 in esac ;; *-*) - basic_machine=$field1 - os=$field2 + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* \ + | c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* \ + | harris | dolphin | highlevel | gould | cbm | ns | masscomp \ + | apple | axis | knuth | cray | microblaze* \ + | sim | cisco | oki | wec | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac ;; *) # Convert single-component short-hands not valid as part of @@ -545,26 +567,9 @@ esac ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in - sun*os*) - # Prevent following clause from handling this invalid input. - ;; - dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* | \ - att* | 7300* | 3300* | delta* | motorola* | sun[234]* | \ - unicom* | ibm* | next | hp | isi* | apollo | altos* | \ - convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* |\ - c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* | \ - harris | dolphin | highlevel | gould | cbm | ns | masscomp | \ - apple | axis | knuth | cray | microblaze*) - os= - basic_machine=$1 - ;; bluegene*) os=cnk ;; - sim | cisco | oki | wec | winbond) - os= - basic_machine=$1 - ;; scout) ;; wrs)