3 # Configuration subroutine to validate and canonicalize a configuration type.
4 # Supply the specified configuration type as an argument.
5 # If it is invalid, we print an error message on stderr and exit with code 1.
6 # Otherwise, we print the canonical config type on stdout and succeed.
8 # This file is supposed to be the same for all GNU packages
9 # and recognize all the CPU types, system types and aliases
10 # that are meaningful with *any* GNU software.
11 # Each package is responsible for reporting which valid configurations
12 # it does not support. The user should be able to distinguish
13 # a failure to support a valid configuration from a meaningless
16 # decode aliases into canonical names
19 # cpu alone is a valid alias for cpu-none-none.
20 vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc | ns32k \
21 | alliant | arm | c1 | c2 | mips | pyramid | tron | a29k \
22 | rtpc | rs6000 | i960)
77 news | news700 | news800 | news900)
82 unixpc | safari | pc7300 | 3b1 | 7300 | 7300-att | att-7300)
87 delta | 3300 | motorola-3300 | motorola-delta \
88 | 3300-motorola | delta-motorola)
163 roadrunner | sun386 | sun386i)
198 hp300hpux | hpux | hp9k3[2-9][0-9])
203 hp9k31[0-9] | hp9k2[0-9][0-9])
238 bigmips | news-3600 | risc-news)
248 dec3100 | decstatn | decstation | decstation-3100 | pmax)
279 # not an alias. parse what we expect to be a canonical name.
281 cpu=`echo $1 | sed 's/-.*$//'`
283 if [ "${cpu}" = "$1" ] ; then
284 # no vendor so this is an invalid name.
285 echo '***' No vendor: configuration \`$1\' not recognized 1>&2
289 rest=`echo $1 | sed "s/${cpu}-//"`
290 vendor=`echo ${rest} | sed 's/-.*$//'`
292 if [ "${vendor}" = "${rest}" ] ; then
293 # a missing os is acceptable
296 os=`echo ${rest} | sed "s/${vendor}-//"`
302 # At this point we should have three parts of a canonical name in cpu,
305 # verify that the cpu is known.
308 vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc | ns32k \
309 | alliant | arm | c1 | c2 | mips | pyramid | tron | a29k \
310 | rtpc | rs6000 | i960)
313 echo '***' Invalid cpu \`${cpu}\': configuration \`$1\' not recognized 1>&2
318 # verify that the vendor is known.
321 none | convex | mips | dec | little | sony | ncr | convergent \
322 | altos | apollo | isi | hp | next | sco | ibm | sun \
323 | unicom | sequent | encore | motorola | att | sgi \
324 | utek | gould | wrs | intel | aout | bout | coff) ;;
326 echo '***' Invalid vendor \`${vendor}\': configuration \`$1\' not recognized 1>&2
331 # verify that the os is known, if it exists.
334 aix* | aout | bout | bsd* | coff | ctix* | dynix* | esix* | hpux* \
335 | isc* | mach* | newsos* | nindy* | none | osf* | osf* | sco* \
336 | sunos* | sysv* | ultrix* | unos* | v88r* | vms* | vxworks*)
339 echo '***' Invalid os \`${os}\': configuration \`$1\' not recognized 1>&2
344 echo ${cpu}-${vendor}-${os}