|
|
1 |
#! /bin/sh |
|
|
2 |
# Configuration validation subroutine script. |
|
|
3 |
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
|
|
4 |
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
|
|
5 |
|
|
|
6 |
timestamp='2005-07-08' |
|
|
7 |
|
|
|
8 |
# This file is (in principle) common to ALL GNU software. |
|
|
9 |
# The presence of a machine in this file suggests that SOME GNU software |
|
|
10 |
# can handle that machine. It does not imply ALL GNU software can. |
|
|
11 |
# |
|
|
12 |
# This file is free software; you can redistribute it and/or modify |
|
|
13 |
# it under the terms of the GNU General Public License as published by |
|
|
14 |
# the Free Software Foundation; either version 2 of the License, or |
|
|
15 |
# (at your option) any later version. |
|
|
16 |
# |
|
|
17 |
# This program is distributed in the hope that it will be useful, |
|
|
18 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
19 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
20 |
# GNU General Public License for more details. |
|
|
21 |
# |
|
|
22 |
# You should have received a copy of the GNU General Public License |
|
|
23 |
# along with this program; if not, write to the Free Software |
|
|
24 |
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA |
|
|
25 |
# 02110-1301, USA. |
|
|
26 |
# |
|
|
27 |
# As a special exception to the GNU General Public License, if you |
|
|
28 |
# distribute this file as part of a program that contains a |
|
|
29 |
# configuration script generated by Autoconf, you may include it under |
|
|
30 |
# the same distribution terms that you use for the rest of that program. |
|
|
31 |
|
|
|
32 |
|
|
|
33 |
# Please send patches to <config-patches@gnu.org>. Submit a context |
|
|
34 |
# diff and a properly formatted ChangeLog entry. |
|
|
35 |
# |
|
|
36 |
# Configuration subroutine to validate and canonicalize a configuration type. |
|
|
37 |
# Supply the specified configuration type as an argument. |
|
|
38 |
# If it is invalid, we print an error message on stderr and exit with code 1. |
|
|
39 |
# Otherwise, we print the canonical config type on stdout and succeed. |
|
|
40 |
|
|
|
41 |
# This file is supposed to be the same for all GNU packages |
|
|
42 |
# and recognize all the CPU types, system types and aliases |
|
|
43 |
# that are meaningful with *any* GNU software. |
|
|
44 |
# Each package is responsible for reporting which valid configurations |
|
|
45 |
# it does not support. The user should be able to distinguish |
|
|
46 |
# a failure to support a valid configuration from a meaningless |
|
|
47 |
# configuration. |
|
|
48 |
|
|
|
49 |
# The goal of this file is to map all the various variations of a given |
|
|
50 |
# machine specification into a single specification in the form: |
|
|
51 |
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM |
|
|
52 |
# or in some cases, the newer four-part form: |
|
|
53 |
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM |
|
|
54 |
# It is wrong to echo any other type of specification. |
|
|
55 |
|
|
|
56 |
me=`echo "$0" | sed -e 's,.*/,,'` |
|
|
57 |
|
|
|
58 |
usage="\ |
|
|
59 |
Usage: $0 [OPTION] CPU-MFR-OPSYS |
|
|
60 |
$0 [OPTION] ALIAS |
|
|
61 |
|
|
|
62 |
Canonicalize a configuration name. |
|
|
63 |
|
|
|
64 |
Operation modes: |
|
|
65 |
-h, --help print this help, then exit |
|
|
66 |
-t, --time-stamp print date of last modification, then exit |
|
|
67 |
-v, --version print version number, then exit |
|
|
68 |
|
|
|
69 |
Report bugs and patches to <config-patches@gnu.org>." |
|
|
70 |
|
|
|
71 |
version="\ |
|
|
72 |
GNU config.sub ($timestamp) |
|
|
73 |
|
|
|
74 |
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 |
|
|
75 |
Free Software Foundation, Inc. |
|
|
76 |
|
|
|
77 |
This is free software; see the source for copying conditions. There is NO |
|
|
78 |
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
|
|
79 |
|
|
|
80 |
help=" |
|
|
81 |
Try \`$me --help' for more information." |
|
|
82 |
|
|
|
83 |
# Parse command line |
|
|
84 |
while test $# -gt 0 ; do |
|
|
85 |
case $1 in |
|
|
86 |
--time-stamp | --time* | -t ) |
|
|
87 |
echo "$timestamp" ; exit ;; |
|
|
88 |
--version | -v ) |
|
|
89 |
echo "$version" ; exit ;; |
|
|
90 |
--help | --h* | -h ) |
|
|
91 |
echo "$usage"; exit ;; |
|
|
92 |
-- ) # Stop option processing |
|
|
93 |
shift; break ;; |
|
|
94 |
- ) # Use stdin as input. |
|
|
95 |
break ;; |
|
|
96 |
-* ) |
|
|
97 |
echo "$me: invalid option $1$help" |
|
|
98 |
exit 1 ;; |
|
|
99 |
|
|
|
100 |
*local*) |
|
|
101 |
# First pass through any local machine types. |
|
|
102 |
echo $1 |
|
|
103 |
exit ;; |
|
|
104 |
|
|
|
105 |
* ) |
|
|
106 |
break ;; |
|
|
107 |
esac |
|
|
108 |
done |
|
|
109 |
|
|
|
110 |
case $# in |
|
|
111 |
0) echo "$me: missing argument$help" >&2 |
|
|
112 |
exit 1;; |
|
|
113 |
1) ;; |
|
|
114 |
*) echo "$me: too many arguments$help" >&2 |
|
|
115 |
exit 1;; |
|
|
116 |
esac |
|
|
117 |
|
|
|
118 |
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). |
|
|
119 |
# Here we must recognize all the valid KERNEL-OS combinations. |
|
|
120 |
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` |
|
|
121 |
case $maybe_os in |
|
|
122 |
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ |
|
|
123 |
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) |
|
|
124 |
os=-$maybe_os |
|
|
125 |
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` |
|
|
126 |
;; |
|
|
127 |
*) |
|
|
128 |
basic_machine=`echo $1 | sed 's/-[^-]*$//'` |
|
|
129 |
if [ $basic_machine != $1 ] |
|
|
130 |
then os=`echo $1 | sed 's/.*-/-/'` |
|
|
131 |
else os=; fi |
|
|
132 |
;; |
|
|
133 |
esac |
|
|
134 |
|
|
|
135 |
### Let's recognize common machines as not being operating systems so |
|
|
136 |
### that things like config.sub decstation-3100 work. We also |
|
|
137 |
### recognize some manufacturers as not being operating systems, so we |
|
|
138 |
### can provide default operating systems below. |
|
|
139 |
case $os in |
|
|
140 |
-sun*os*) |
|
|
141 |
# Prevent following clause from handling this invalid input. |
|
|
142 |
;; |
|
|
143 |
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ |
|
|
144 |
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ |
|
|
145 |
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ |
|
|
146 |
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ |
|
|
147 |
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ |
|
|
148 |
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ |
|
|
149 |
-apple | -axis | -knuth | -cray) |
|
|
150 |
os= |
|
|
151 |
basic_machine=$1 |
|
|
152 |
;; |
|
|
153 |
-sim | -cisco | -oki | -wec | -winbond) |
|
|
154 |
os= |
|
|
155 |
basic_machine=$1 |
|
|
156 |
;; |
|
|
157 |
-scout) |
|
|
158 |
;; |
|
|
159 |
-wrs) |
|
|
160 |
os=-vxworks |
|
|
161 |
basic_machine=$1 |
|
|
162 |
;; |
|
|
163 |
-chorusos*) |
|
|
164 |
os=-chorusos |
|
|
165 |
basic_machine=$1 |
|
|
166 |
;; |
|
|
167 |
-chorusrdb) |
|
|
168 |
os=-chorusrdb |
|
|
169 |
basic_machine=$1 |
|
|
170 |
;; |
|
|
171 |
-hiux*) |
|
|
172 |
os=-hiuxwe2 |
|
|
173 |
;; |
|
|
174 |
-sco5) |
|
|
175 |
os=-sco3.2v5 |
|
|
176 |
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
|
|
177 |
;; |
|
|
178 |
-sco4) |
|
|
179 |
os=-sco3.2v4 |
|
|
180 |
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
|
|
181 |
;; |
|
|
182 |
-sco3.2.[4-9]*) |
|
|
183 |
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` |
|
|
184 |
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
|
|
185 |
;; |
|
|
186 |
-sco3.2v[4-9]*) |
|
|
187 |
# Don't forget version if it is 3.2v4 or newer. |
|
|
188 |
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
|
|
189 |
;; |
|
|
190 |
-sco*) |
|
|
191 |
os=-sco3.2v2 |
|
|
192 |
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
|
|
193 |
;; |
|
|
194 |
-udk*) |
|
|
195 |
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
|
|
196 |
;; |
|
|
197 |
-isc) |
|
|
198 |
os=-isc2.2 |
|
|
199 |
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
|
|
200 |
;; |
|
|
201 |
-clix*) |
|
|
202 |
basic_machine=clipper-intergraph |
|
|
203 |
;; |
|
|
204 |
-isc*) |
|
|
205 |
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` |
|
|
206 |
;; |
|
|
207 |
-lynx*) |
|
|
208 |
os=-lynxos |
|
|
209 |
;; |
|
|
210 |
-ptx*) |
|
|
211 |
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` |
|
|
212 |
;; |
|
|
213 |
-windowsnt*) |
|
|
214 |
os=`echo $os | sed -e 's/windowsnt/winnt/'` |
|
|
215 |
;; |
|
|
216 |
-psos*) |
|
|
217 |
os=-psos |
|
|
218 |
;; |
|
|
219 |
-mint | -mint[0-9]*) |
|
|
220 |
basic_machine=m68k-atari |
|
|
221 |
os=-mint |
|
|
222 |
;; |
|
|
223 |
esac |
|
|
224 |
|
|
|
225 |
# Decode aliases for certain CPU-COMPANY combinations. |
|
|
226 |
case $basic_machine in |
|
|
227 |
# Recognize the basic CPU types without company name. |
|
|
228 |
# Some are omitted here because they have special meanings below. |
|
|
229 |
1750a | 580 \ |
|
|
230 |
| a29k \ |
|
|
231 |
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ |
|
|
232 |
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ |
|
|
233 |
| am33_2.0 \ |
|
|
234 |
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ |
|
|
|