You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1005 lines
20 KiB

25 years ago
  1. #! /bin/sh
  2. # Configuration validation subroutine script, version 1.1.
  3. # Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
  4. # This file is (in principle) common to ALL GNU software.
  5. # The presence of a machine in this file suggests that SOME GNU software
  6. # can handle that machine. It does not imply ALL GNU software can.
  7. #
  8. # This file is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place - Suite 330,
  21. # Boston, MA 02111-1307, USA.
  22. # As a special exception to the GNU General Public License, if you
  23. # distribute this file as part of a program that contains a
  24. # configuration script generated by Autoconf, you may include it under
  25. # the same distribution terms that you use for the rest of that program.
  26. # Changed by Bruno Haible, 1 May 1999.
  27. # The master version of this file is in
  28. # ftp://ftp2.cons.org/pub/lisp/clisp/source/.
  29. # Configuration subroutine to validate and canonicalize a configuration type.
  30. # Supply the specified configuration type as an argument.
  31. # If it is invalid, we print an error message on stderr and exit with code 1.
  32. # Otherwise, we print the canonical config type on stdout and succeed.
  33. # This file is supposed to be the same for all GNU packages
  34. # and recognize all the CPU types, system types and aliases
  35. # that are meaningful with *any* GNU software.
  36. # Each package is responsible for reporting which valid configurations
  37. # it does not support. The user should be able to distinguish
  38. # a failure to support a valid configuration from a meaningless
  39. # configuration.
  40. # The goal of this file is to map all the various variations of a given
  41. # machine specification into a single specification in the form:
  42. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  43. # or in some cases, the newer four-part form:
  44. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM-GNUSTUFF
  45. # It is wrong to echo any other type of specification.
  46. if [ x$1 = x ]
  47. then
  48. echo Configuration name missing. 1>&2
  49. echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
  50. echo "or $0 ALIAS" 1>&2
  51. echo where ALIAS is a recognized configuration type. 1>&2
  52. exit 1
  53. fi
  54. # First pass through any local machine types.
  55. case $1 in
  56. *local*)
  57. echo $1
  58. exit 0
  59. ;;
  60. *)
  61. ;;
  62. esac
  63. # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
  64. # Here we must recognize all the valid KERNEL-OS combinations.
  65. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  66. case $maybe_os in
  67. linux-gnu*)
  68. os=-$maybe_os
  69. basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
  70. ;;
  71. *)
  72. basic_machine=`echo $1 | sed 's/-[^-]*$//'`
  73. if [ $basic_machine != $1 ]
  74. then os=`echo $1 | sed 's/.*-/-/'`
  75. else os=; fi
  76. ;;
  77. esac
  78. ### Let's recognize common machines as not being operating systems so
  79. ### that things like config.sub decstation-3100 work. We also
  80. ### recognize some manufacturers as not being operating systems, so we
  81. ### can provide default operating systems below.
  82. case $os in
  83. -sun*os*)
  84. # Prevent following clause from handling this invalid input.
  85. ;;
  86. -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  87. -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  88. -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
  89. -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  90. -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  91. -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
  92. -apple)
  93. os=
  94. basic_machine=$1
  95. ;;
  96. -hiux*)
  97. os=-hiuxwe2
  98. ;;
  99. -sco5)
  100. os=sco3.2v5
  101. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  102. ;;
  103. -sco4)
  104. os=-sco3.2v4
  105. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  106. ;;
  107. -sco3.2.[4-9]*)
  108. os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
  109. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  110. ;;
  111. -sco3.2v[4-9]*)
  112. # Don't forget version if it is 3.2v4 or newer.
  113. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  114. ;;
  115. -sco*)
  116. os=-sco3.2v2
  117. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  118. ;;
  119. -isc)
  120. os=-isc2.2
  121. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  122. ;;
  123. -clix*)
  124. basic_machine=clipper-intergraph
  125. ;;
  126. -isc*)
  127. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  128. ;;
  129. -lynx*)
  130. os=-lynxos
  131. ;;
  132. -ptx*)
  133. basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
  134. ;;
  135. -windowsnt*)
  136. os=`echo $os | sed -e 's/windowsnt/winnt/'`
  137. ;;
  138. -psos*)
  139. os=-psos
  140. ;;
  141. esac
  142. # Decode aliases for certain CPU-COMPANY combinations.
  143. case $basic_machine in
  144. # Recognize the basic CPU types without company name.
  145. # Some are omitted here because they have special meanings below.
  146. tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
  147. | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
  148. | 580 | i960 | h8300 \
  149. | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w \
  150. | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
  151. | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
  152. | 1750a | dsp16xx | pdp11 | mips64 | mipsel | mips64el \
  153. | mips64orion | mips64orionel | mipstx39 | mipstx39el \
  154. | sparc | sparclet | sparclite | sparc64 | v850)
  155. basic_machine=$basic_machine-unknown
  156. ;;
  157. # We use `pc' rather than `unknown'
  158. # because (1) that's what they normally are, and
  159. # (2) the word "unknown" tends to confuse beginning users.
  160. i[34567]86)
  161. basic_machine=$basic_machine-pc
  162. ;;
  163. # Object if more than one company name word.
  164. *-*-*)
  165. echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  166. exit 1
  167. ;;
  168. # Recognize the basic CPU types with company name.
  169. vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
  170. | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
  171. | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
  172. | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
  173. | xmp-* | ymp-* \
  174. | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
  175. | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67] \
  176. | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
  177. | clipper-* | orion-* \
  178. | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
  179. | sparc64-* | mips64-* | mipsel-* \
  180. | mips64el-* | mips64orion-* | mips64orionel-* \
  181. | mipstx39-* | mipstx39el-* \
  182. | f301-* | armv*-*)
  183. ;;
  184. # Recognize the various machine names and aliases which stand
  185. # for a CPU type and a company and sometimes even an OS.
  186. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
  187. basic_machine=m68000-att
  188. ;;
  189. 3b*)
  190. basic_machine=we32k-att
  191. ;;
  192. alliant | fx80)
  193. basic_machine=fx80-alliant
  194. ;;
  195. altos | altos3068)
  196. basic_machine=m68k-altos
  197. ;;
  198. am29k)
  199. basic_machine=a29k-none
  200. os=-bsd
  201. ;;
  202. amdahl)
  203. basic_machine=580-amdahl
  204. os=-sysv
  205. ;;
  206. amiga | amiga-*)
  207. basic_machine=m68k-cbm
  208. ;;
  209. amigaos | amigados)
  210. basic_machine=m68k-cbm
  211. os=-amigaos
  212. ;;
  213. amigaunix | amix)
  214. basic_machine=m68k-cbm
  215. os=-sysv4
  216. ;;
  217. apollo68)
  218. basic_machine=m68k-apollo
  219. os=-sysv
  220. ;;
  221. aux)
  222. basic_machine=m68k-apple
  223. os=-aux
  224. ;;
  225. balance)
  226. basic_machine=ns32k-sequent
  227. os=-dynix
  228. ;;
  229. convex-c1)
  230. basic_machine=c1-convex
  231. os=-bsd
  232. ;;
  233. convex-c2)
  234. basic_machine=c2-convex
  235. os=-bsd
  236. ;;
  237. convex-c32)
  238. basic_machine=c32-convex
  239. os=-bsd
  240. ;;
  241. convex-c34)
  242. basic_machine=c34-convex
  243. os=-bsd
  244. ;;
  245. convex-c38)
  246. basic_machine=c38-convex
  247. os=-bsd
  248. ;;
  249. cray | ymp)
  250. basic_machine=ymp-cray
  251. os=-unicos
  252. ;;
  253. cray2)
  254. basic_machine=cray2-cray
  255. os=-unicos
  256. ;;
  257. [ctj]90-cray)
  258. basic_machine=c90-cray
  259. os=-unicos
  260. ;;
  261. crds | unos)
  262. basic_machine=m68k-crds
  263. ;;
  264. da30 | da30-*)
  265. basic_machine=m68k-da30
  266. ;;
  267. decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
  268. basic_machine=mips-dec
  269. ;;
  270. delta | 3300 | motorola-3300 | motorola-delta \
  271. | 3300-motorola | delta-motorola)
  272. basic_machine=m68k-motorola
  273. ;;
  274. delta88)
  275. basic_machine=m88k-motorola
  276. os=-sysv3
  277. ;;
  278. dpx20 | dpx20-*)
  279. basic_machine=rs6000-bull
  280. os=-bosx
  281. ;;
  282. dpx2* | dpx2*-bull)
  283. basic_machine=m68k-bull
  284. os=-sysv3
  285. ;;
  286. ebmon29k)
  287. basic_machine=a29k-amd
  288. os=-ebmon
  289. ;;
  290. elxsi)
  291. basic_machine=elxsi-elxsi
  292. os=-bsd
  293. ;;
  294. encore | umax | mmax)
  295. basic_machine=ns32k-encore
  296. ;;
  297. fx2800)
  298. basic_machine=i860-alliant
  299. ;;
  300. genix)
  301. basic_machine=ns32k-ns
  302. ;;
  303. gmicro)
  304. basic_machine=tron-gmicro
  305. os=-sysv
  306. ;;
  307. h3050r* | hiux*)
  308. basic_machine=hppa1.1-hitachi
  309. os=-hiuxwe2
  310. ;;
  311. h8300hms)
  312. basic_machine=h8300-hitachi
  313. os=-hms
  314. ;;
  315. harris)
  316. basic_machine=m88k-harris
  317. os=-sysv3
  318. ;;
  319. hp300-*)
  320. basic_machine=m68k-hp
  321. ;;
  322. hp300bsd)
  323. basic_machine=m68k-hp
  324. os=-bsd
  325. ;;
  326. hp300hpux)
  327. basic_machine=m68k-hp
  328. os=-hpux
  329. ;;
  330. hp9k2[0-9][0-9] | hp9k31[0-9])
  331. basic_machine=m68000-hp
  332. ;;
  333. hp9k3[2-9][0-9] | hp9k4[0-9][0-9])
  334. basic_machine=m68k-hp
  335. ;;
  336. hp9k78[0-9] | hp78[0-9] | hp9k80[24] | hp80[24] | hp9k8[67]1 | hp8[67]1 | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
  337. basic_machine=hppa2.0-hp
  338. ;;
  339. hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9][13679] | hp8[0-9][13679] | hp9k892 | hp892)
  340. basic_machine=hppa1.1-hp
  341. ;;
  342. hp9k[68][0-9][0-9] | hp[68][0-9][0-9])
  343. basic_machine=hppa1.0-hp
  344. ;;
  345. hppa-next)
  346. os=-nextstep3
  347. ;;
  348. hp3k9[0-9][0-9] | hp9[0-9][0-9])
  349. basic_machine=hppa1.0-hp
  350. os=-mpeix
  351. ;;
  352. hp3k9[0-9][0-9] | hp9[0-9][0-9])
  353. basic_machine=hppa1.0-hp
  354. os=-mpeix
  355. ;;
  356. i370-ibm* | ibm*)
  357. basic_machine=i370-ibm
  358. os=-mvs
  359. ;;
  360. # I'm not sure what "Sysv32" means. Should this be sysv3.2?
  361. i[34567]86v32)
  362. basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  363. os=-sysv32
  364. ;;
  365. i[34567]86v4*)
  366. basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  367. os=-sysv4
  368. ;;
  369. i[34567]86v)
  370. basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  371. os=-sysv
  372. ;;
  373. i[34567]86sol2)
  374. basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  375. os=-solaris2
  376. ;;
  377. iris | iris4d)
  378. basic_machine=mips-sgi
  379. case $os in
  380. -irix*)
  381. ;;
  382. *)
  383. os=-irix4
  384. ;;
  385. esac
  386. ;;
  387. isi68 | isi)
  388. basic_machine=m68k-isi
  389. os=-sysv
  390. ;;
  391. m88k-omron*)
  392. basic_machine=m88k-omron
  393. ;;
  394. magnum | m3230)
  395. basic_machine=mips-mips
  396. os=-sysv
  397. ;;
  398. merlin)
  399. basic_machine=ns32k-utek
  400. os=-sysv
  401. ;;
  402. miniframe)
  403. basic_machine=m68000-convergent
  404. ;;
  405. mipsel*-linux*)
  406. basic_machine=mipsel-unknown
  407. os=-linux-gnu
  408. ;;
  409. mips*-linux*)
  410. basic_machine=mips-unknown
  411. os=-linux-gnu
  412. ;;
  413. mips3*-*)
  414. basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
  415. ;;
  416. mips3*)
  417. basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
  418. ;;
  419. ncr3000)
  420. basic_machine=i486-ncr
  421. os=-sysv4
  422. ;;
  423. netwinder)
  424. basic_machine=armv4l-corel
  425. os=-linux
  426. ;;
  427. news | news700 | news800 | news900)
  428. basic_machine=m68k-sony
  429. os=-newsos
  430. ;;
  431. news1000)
  432. basic_machine=m68030-sony
  433. os=-newsos
  434. ;;
  435. news-3600 | risc-news)
  436. basic_machine=mips-sony
  437. os=-newsos
  438. ;;
  439. next | m*-next )
  440. basic_machine=m68k-next
  441. case $os in
  442. -nextstep* )
  443. ;;
  444. -ns2*)
  445. os=-nextstep2
  446. ;;
  447. *)
  448. os=-nextstep3
  449. ;;
  450. esac
  451. ;;
  452. nh3000)
  453. basic_machine=m68k-harris
  454. os=-cxux
  455. ;;
  456. nh[45]000)
  457. basic_machine=m88k-harris
  458. os=-cxux
  459. ;;
  460. nindy960)
  461. basic_machine=i960-intel
  462. os=-nindy
  463. ;;
  464. np1)
  465. basic_machine=np1-gould
  466. ;;
  467. pa-hitachi)
  468. basic_machine=hppa1.1-hitachi
  469. os=-hiuxwe2
  470. ;;
  471. paragon)
  472. basic_machine=i860-intel
  473. os=-osf
  474. ;;
  475. pbd)
  476. basic_machine=sparc-tti
  477. ;;
  478. pbb)
  479. basic_machine=m68k-tti
  480. ;;
  481. pc532 | pc532-*)
  482. basic_machine=ns32k-pc532
  483. ;;
  484. pentium | p5 | k5 | nexen)
  485. basic_machine=i586-pc
  486. ;;
  487. pentiumpro | p6 | k6 | 6x86)
  488. basic_machine=i686-pc
  489. ;;
  490. pentiumii | pentium2)
  491. basic_machine=i786-pc
  492. ;;
  493. pentium-* | p5-* | k5-* | nexen-*)
  494. basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
  495. ;;
  496. pentiumpro-* | p6-* | k6-* | 6x86-*)
  497. basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
  498. ;;
  499. pentiumii-* | pentium2-*)
  500. basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
  501. ;;
  502. pn)
  503. basic_machine=pn-gould
  504. ;;
  505. power) basic_machine=rs6000-ibm
  506. ;;
  507. ppc) basic_machine=powerpc-unknown
  508. ;;
  509. ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
  510. ;;
  511. ppcle | powerpclittle | ppc-le | powerpc-little)
  512. basic_machine=powerpcle-unknown
  513. ;;
  514. ppcle-* | powerpclittle-*)
  515. basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
  516. ;;
  517. ps2)
  518. basic_machine=i386-ibm
  519. ;;
  520. rm[46]00)
  521. basic_machine=mips-siemens
  522. ;;
  523. rtpc | rtpc-*)
  524. basic_machine=romp-ibm
  525. ;;
  526. sequent)
  527. basic_machine=i386-sequent
  528. ;;
  529. sh)
  530. basic_machine=sh-hitachi
  531. os=-hms
  532. ;;
  533. sps7)
  534. basic_machine=m68k-bull
  535. os=-sysv2
  536. ;;
  537. spur)
  538. basic_machine=spur-unknown
  539. ;;
  540. sun2)
  541. basic_machine=m68000-sun
  542. ;;
  543. sun2os3)
  544. basic_machine=m68000-sun
  545. os=-sunos3
  546. ;;
  547. sun2os4)
  548. basic_machine=m68000-sun
  549. os=-sunos4
  550. ;;
  551. sun3os3)
  552. basic_machine=m68k-sun
  553. os=-sunos3
  554. ;;
  555. sun3os4)
  556. basic_machine=m68k-sun
  557. os=-sunos4
  558. ;;
  559. sun4os3)
  560. basic_machine=sparc-sun
  561. os=-sunos3
  562. ;;
  563. sun4os4)
  564. basic_machine=sparc-sun
  565. os=-sunos4
  566. ;;
  567. sun4sol2)
  568. basic_machine=sparc-sun
  569. os=-solaris2
  570. ;;
  571. sun3 | sun3-*)
  572. basic_machine=m68k-sun
  573. ;;
  574. sun4)
  575. basic_machine=sparc-sun
  576. ;;
  577. sun386 | sun386i | roadrunner)
  578. basic_machine=i386-sun
  579. ;;
  580. symmetry)
  581. basic_machine=i386-sequent
  582. os=-dynix
  583. ;;
  584. tx39)
  585. basic_machine=mipstx39-unknown
  586. ;;
  587. tx39el)
  588. basic_machine=mipstx39el-unknown
  589. ;;
  590. tower | tower-32)
  591. basic_machine=m68k-ncr
  592. ;;
  593. udi29k)
  594. basic_machine=a29k-amd
  595. os=-udi
  596. ;;
  597. ultra3)
  598. basic_machine=a29k-nyu
  599. os=-sym1
  600. ;;
  601. vaxv)
  602. basic_machine=vax-dec
  603. os=-sysv
  604. ;;
  605. vms)
  606. basic_machine=vax-dec
  607. os=-vms
  608. ;;
  609. vpp*|vx|vx-*)
  610. basic_machine=f301-fujitsu
  611. ;;
  612. vxworks960)
  613. basic_machine=i960-wrs
  614. os=-vxworks
  615. ;;
  616. vxworks68)
  617. basic_machine=m68k-wrs
  618. os=-vxworks
  619. ;;
  620. vxworks29k)
  621. basic_machine=a29k-wrs
  622. os=-vxworks
  623. ;;
  624. xmp)
  625. basic_machine=xmp-cray
  626. os=-unicos
  627. ;;
  628. xps | xps100)
  629. basic_machine=xps100-honeywell
  630. ;;
  631. *mint | *MiNT)
  632. basic_machine=m68k-atari
  633. os=-mint
  634. ;;
  635. none)
  636. basic_machine=none-none
  637. os=-none
  638. ;;
  639. # Here we handle the default manufacturer of certain CPU types. It is in
  640. # some cases the only manufacturer, in others, it is the most popular.
  641. mips)
  642. if [ x$os = x-linux-gnu ]; then
  643. basic_machine=mips-unknown
  644. else
  645. basic_machine=mips-mips
  646. fi
  647. ;;
  648. romp)
  649. basic_machine=romp-ibm
  650. ;;
  651. rs6000)
  652. basic_machine=rs6000-ibm
  653. ;;
  654. vax)
  655. basic_machine=vax-dec
  656. ;;
  657. pdp11)
  658. basic_machine=pdp11-dec
  659. ;;
  660. we32k)
  661. basic_machine=we32k-att
  662. ;;
  663. sparc)
  664. basic_machine=sparc-sun
  665. ;;
  666. cydra)
  667. basic_machine=cydra-cydrome
  668. ;;
  669. orion)
  670. basic_machine=orion-highlevel
  671. ;;
  672. orion105)
  673. basic_machine=clipper-highlevel
  674. ;;
  675. *)
  676. echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  677. exit 1
  678. ;;
  679. esac
  680. # Here we canonicalize certain aliases for manufacturers.
  681. case $basic_machine in
  682. *-digital*)
  683. basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
  684. ;;
  685. *-commodore*)
  686. basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
  687. ;;
  688. *)
  689. ;;
  690. esac
  691. # Decode manufacturer-specific aliases for certain operating systems.
  692. if [ x"$os" != x"" ]
  693. then
  694. case $os in
  695. # First match some system type aliases
  696. # that might get confused with valid system types.
  697. # -solaris* is a basic system type, with this one exception.
  698. -solaris1 | -solaris1.*)
  699. os=`echo $os | sed -e 's|solaris1|sunos4|'`
  700. ;;
  701. -solaris)
  702. os=-solaris2
  703. ;;
  704. -svr4*)
  705. os=-sysv4
  706. ;;
  707. -unixware*)
  708. os=-sysv4.2uw
  709. ;;
  710. -gnu/linux*)
  711. os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
  712. ;;
  713. # First accept the basic system types.
  714. # The portable systems comes first.
  715. # Each alternative MUST END IN A *, to match a version number.
  716. # -sysv* is not here because it comes later, after sysvr4.
  717. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  718. | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
  719. | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
  720. | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  721. | -aos* \
  722. | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  723. | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  724. | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
  725. | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
  726. | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  727. | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  728. | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  729. | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \
  730. | -openstep* | -mpeix* | -oskit*)
  731. # Remember, each alternative MUST END IN *, to match a version number.
  732. ;;
  733. -linux*)
  734. # To whom it may concern:
  735. # - The name of Linux is Linux.
  736. # - The kernel of the GNU system is the Hurd. This is stated
  737. # in the documentation of the GNU C preprocessor, section
  738. # "Assertions". Hence Linux is not a GNU system.
  739. #os=`echo $os | sed -e 's|linux|linux-gnu|'`
  740. ;;
  741. -sunos5*)
  742. os=`echo $os | sed -e 's|sunos5|solaris2|'`
  743. ;;
  744. -sunos6*)
  745. os=`echo $os | sed -e 's|sunos6|solaris3|'`
  746. ;;
  747. -osfrose*)
  748. os=-osfrose
  749. ;;
  750. -osf*)
  751. os=-osf
  752. ;;
  753. -utek*)
  754. os=-bsd
  755. ;;
  756. -dynix*)
  757. os=-bsd
  758. ;;
  759. -acis*)
  760. os=-aos
  761. ;;
  762. -ctix* | -uts*)
  763. os=-sysv
  764. ;;
  765. -ns2 )
  766. os=-nextstep2
  767. ;;
  768. # Preserve the version number of sinix5.
  769. -sinix5.*)
  770. os=`echo $os | sed -e 's|sinix|sysv|'`
  771. ;;
  772. -sinix*)
  773. os=-sysv4
  774. ;;
  775. -triton*)
  776. os=-sysv3
  777. ;;
  778. -oss*)
  779. os=-sysv3
  780. ;;
  781. -svr4)
  782. os=-sysv4
  783. ;;
  784. -svr3)
  785. os=-sysv3
  786. ;;
  787. -sysvr4)
  788. os=-sysv4
  789. ;;
  790. # This must come after -sysvr4.
  791. -sysv*)
  792. ;;
  793. -xenix)
  794. os=-xenix
  795. ;;
  796. -*mint | -*MiNT)
  797. os=-mint
  798. ;;
  799. -none)
  800. ;;
  801. *)
  802. # Get rid of the `-' at the beginning of $os.
  803. os=`echo $os | sed 's/[^-]*-//'`
  804. echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
  805. exit 1
  806. ;;
  807. esac
  808. else
  809. # Here we handle the default operating systems that come with various machines.
  810. # The value should be what the vendor currently ships out the door with their
  811. # machine or put another way, the most popular os provided with the machine.
  812. # Note that if you're going to try to match "-MANUFACTURER" here (say,
  813. # "-sun"), then you have to tell the case statement up towards the top
  814. # that MANUFACTURER isn't an operating system. Otherwise, code above
  815. # will signal an error saying that MANUFACTURER isn't an operating
  816. # system, and we'll never get to this point.
  817. case $basic_machine in
  818. *-acorn)
  819. os=-riscix1.2
  820. ;;
  821. arm*-corel)
  822. os=-linux
  823. ;;
  824. arm*-semi)
  825. os=-aout
  826. ;;
  827. pdp11-*)
  828. os=-none
  829. ;;
  830. *-dec | vax-*)
  831. os=-ultrix4.2
  832. ;;
  833. m68*-apollo)
  834. os=-domain
  835. ;;
  836. i386-sun)
  837. os=-sunos4.0.2
  838. ;;
  839. m68000-sun)
  840. os=-sunos3
  841. # This also exists in the configure program, but was not the
  842. # default.
  843. # os=-sunos4
  844. ;;
  845. *-tti) # must be before sparc entry or we get the wrong os.
  846. os=-sysv3
  847. ;;
  848. sparc-* | *-sun)
  849. os=-sunos4.1.1
  850. ;;
  851. *-be)
  852. os=-beos
  853. ;;
  854. *-ibm)
  855. os=-aix
  856. ;;
  857. *-hp)
  858. os=-hpux
  859. ;;
  860. *-hitachi)
  861. os=-hiux
  862. ;;
  863. i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  864. os=-sysv
  865. ;;
  866. *-cbm)
  867. os=-amigaos
  868. ;;
  869. *-dg)
  870. os=-dgux
  871. ;;
  872. *-dolphin)
  873. os=-sysv3
  874. ;;
  875. m68k-ccur)
  876. os=-rtu
  877. ;;
  878. m88k-omron*)
  879. os=-luna
  880. ;;
  881. *-next )
  882. os=-nextstep
  883. ;;
  884. *-sequent)
  885. os=-ptx
  886. ;;
  887. *-crds)
  888. os=-unos
  889. ;;
  890. *-ns)
  891. os=-genix
  892. ;;
  893. i370-*)
  894. os=-mvs
  895. ;;
  896. *-next)
  897. os=-nextstep3
  898. ;;
  899. *-gould)
  900. os=-sysv
  901. ;;
  902. *-highlevel)
  903. os=-bsd
  904. ;;
  905. *-encore)
  906. os=-bsd
  907. ;;
  908. *-sgi)
  909. os=-irix
  910. ;;
  911. *-siemens)
  912. os=-sysv4
  913. ;;
  914. *-masscomp)
  915. os=-rtu
  916. ;;
  917. f301-fujitsu)
  918. os=-uxpv
  919. ;;
  920. *-atari*)
  921. os=-mint
  922. ;;
  923. *)
  924. os=-none
  925. ;;
  926. esac
  927. fi
  928. # Here we handle the case where we know the os, and the CPU type, but not the
  929. # manufacturer. We pick the logical manufacturer.
  930. vendor=unknown
  931. case $basic_machine in
  932. *-unknown)
  933. case $os in
  934. -riscix*)
  935. vendor=acorn
  936. ;;
  937. -sunos*)
  938. vendor=sun
  939. ;;
  940. -aix*)
  941. vendor=ibm
  942. ;;
  943. -hpux*)
  944. vendor=hp
  945. ;;
  946. -mpeix*)
  947. vendor=hp
  948. ;;
  949. -mpeix*)
  950. vendor=hp
  951. ;;
  952. -hiux*)
  953. vendor=hitachi
  954. ;;
  955. -unos*)
  956. vendor=crds
  957. ;;
  958. -dgux*)
  959. vendor=dg
  960. ;;
  961. -luna*)
  962. vendor=omron
  963. ;;
  964. -genix*)
  965. vendor=ns
  966. ;;
  967. -mvs*)
  968. vendor=ibm
  969. ;;
  970. -ptx*)
  971. vendor=sequent
  972. ;;
  973. -vxsim* | -vxworks*)
  974. vendor=wrs
  975. ;;
  976. -aux*)
  977. vendor=apple
  978. ;;
  979. -*mint | -*MiNT)
  980. vendor=atari
  981. ;;
  982. esac
  983. basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
  984. ;;
  985. esac
  986. echo $basic_machine$os