config.guess 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285
  1. #! /bin/sh
  2. # Attempt to guess a canonical system name.
  3. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
  4. # Free Software Foundation, Inc.
  5. version='2000-07-18'
  6. # This file is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. #
  20. # As a special exception to the GNU General Public License, if you
  21. # distribute this file as part of a program that contains a
  22. # configuration script generated by Autoconf, you may include it under
  23. # the same distribution terms that you use for the rest of that program.
  24. # Written by Per Bothner <bothner@cygnus.com>.
  25. # Please send patches to <config-patches@gnu.org>.
  26. #
  27. # This script attempts to guess a canonical system name similar to
  28. # config.sub. If it succeeds, it prints the system name on stdout, and
  29. # exits with 0. Otherwise, it exits with 1.
  30. #
  31. # The plan is that this can be called by configure scripts if you
  32. # don't specify an explicit system type (host/target name).
  33. #
  34. # Only a few systems have been added to this list; please add others
  35. # (but try to keep the structure clean).
  36. #
  37. me=`echo "$0" | sed -e 's,.*/,,'`
  38. usage="\
  39. Usage: $0 [OPTION]
  40. Output the configuration name of this system.
  41. Operation modes:
  42. -h, --help print this help, then exit
  43. -V, --version print version number, then exit"
  44. help="
  45. Try \`$me --help' for more information."
  46. # Parse command line
  47. while test $# -gt 0 ; do
  48. case "$1" in
  49. --version | --vers* | -V )
  50. echo "$version" ; exit 0 ;;
  51. --help | --h* | -h )
  52. echo "$usage"; exit 0 ;;
  53. -- ) # Stop option processing
  54. shift; break ;;
  55. - ) # Use stdin as input.
  56. break ;;
  57. -* )
  58. exec >&2
  59. echo "$me: invalid option $1"
  60. echo "$help"
  61. exit 1 ;;
  62. * )
  63. break ;;
  64. esac
  65. done
  66. if test $# != 0; then
  67. echo "$me: too many arguments$help" >&2
  68. exit 1
  69. fi
  70. # Use $HOST_CC if defined. $CC may point to a cross-compiler
  71. if test x"$CC_FOR_BUILD" = x; then
  72. if test x"$HOST_CC" != x; then
  73. CC_FOR_BUILD="$HOST_CC"
  74. else
  75. if test x"$CC" != x; then
  76. CC_FOR_BUILD="$CC"
  77. else
  78. CC_FOR_BUILD=cc
  79. fi
  80. fi
  81. fi
  82. # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
  83. # (ghazi@noc.rutgers.edu 8/24/94.)
  84. if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
  85. PATH=$PATH:/.attbin ; export PATH
  86. fi
  87. UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  88. UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  89. UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  90. UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  91. dummy=dummy-$$
  92. trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
  93. # Note: order is significant - the case branches are not exclusive.
  94. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  95. *:NetBSD:*:*)
  96. # Netbsd (nbsd) targets should (where applicable) match one or
  97. # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
  98. # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
  99. # switched to ELF, *-*-netbsd* would select the old
  100. # object file format. This provides both forward
  101. # compatibility and a consistent mechanism for selecting the
  102. # object file format.
  103. # Determine the machine/vendor (is the vendor relevant).
  104. case "${UNAME_MACHINE}" in
  105. amiga) machine=m68k-cbm ;;
  106. arm32) machine=arm-unknown ;;
  107. atari*) machine=m68k-atari ;;
  108. sun3*) machine=m68k-sun ;;
  109. mac68k) machine=m68k-apple ;;
  110. macppc) machine=powerpc-apple ;;
  111. hp3[0-9][05]) machine=m68k-hp ;;
  112. ibmrt|romp-ibm) machine=romp-ibm ;;
  113. *) machine=${UNAME_MACHINE}-unknown ;;
  114. esac
  115. # The Operating System including object format.
  116. if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
  117. | grep __ELF__ >/dev/null
  118. then
  119. # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
  120. # Return netbsd for either. FIX?
  121. os=netbsd
  122. else
  123. os=netbsdelf
  124. fi
  125. # The OS release
  126. release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
  127. # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
  128. # contains redundant information, the shorter form:
  129. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
  130. echo "${machine}-${os}${release}"
  131. exit 0 ;;
  132. alpha:OSF1:*:*)
  133. if test $UNAME_RELEASE = "V4.0"; then
  134. UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
  135. fi
  136. # A Vn.n version is a released version.
  137. # A Tn.n version is a released field test version.
  138. # A Xn.n version is an unreleased experimental baselevel.
  139. # 1.2 uses "1.2" for uname -r.
  140. cat <<EOF >$dummy.s
  141. .data
  142. \$Lformat:
  143. .byte 37,100,45,37,120,10,0 # "%d-%x\n"
  144. .text
  145. .globl main
  146. .align 4
  147. .ent main
  148. main:
  149. .frame \$30,16,\$26,0
  150. ldgp \$29,0(\$27)
  151. .prologue 1
  152. .long 0x47e03d80 # implver \$0
  153. lda \$2,-1
  154. .long 0x47e20c21 # amask \$2,\$1
  155. lda \$16,\$Lformat
  156. mov \$0,\$17
  157. not \$1,\$18
  158. jsr \$26,printf
  159. ldgp \$29,0(\$26)
  160. mov 0,\$16
  161. jsr \$26,exit
  162. .end main
  163. EOF
  164. $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
  165. if test "$?" = 0 ; then
  166. case `./$dummy` in
  167. 0-0)
  168. UNAME_MACHINE="alpha"
  169. ;;
  170. 1-0)
  171. UNAME_MACHINE="alphaev5"
  172. ;;
  173. 1-1)
  174. UNAME_MACHINE="alphaev56"
  175. ;;
  176. 1-101)
  177. UNAME_MACHINE="alphapca56"
  178. ;;
  179. 2-303)
  180. UNAME_MACHINE="alphaev6"
  181. ;;
  182. 2-307)
  183. UNAME_MACHINE="alphaev67"
  184. ;;
  185. esac
  186. fi
  187. rm -f $dummy.s $dummy
  188. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  189. exit 0 ;;
  190. Alpha\ *:Windows_NT*:*)
  191. # How do we know it's Interix rather than the generic POSIX subsystem?
  192. # Should we change UNAME_MACHINE based on the output of uname instead
  193. # of the specific Alpha model?
  194. echo alpha-pc-interix
  195. exit 0 ;;
  196. 21064:Windows_NT:50:3)
  197. echo alpha-dec-winnt3.5
  198. exit 0 ;;
  199. Amiga*:UNIX_System_V:4.0:*)
  200. echo m68k-cbm-sysv4
  201. exit 0;;
  202. amiga:OpenBSD:*:*)
  203. echo m68k-unknown-openbsd${UNAME_RELEASE}
  204. exit 0 ;;
  205. *:[Aa]miga[Oo][Ss]:*:*)
  206. echo ${UNAME_MACHINE}-unknown-amigaos
  207. exit 0 ;;
  208. arc64:OpenBSD:*:*)
  209. echo mips64el-unknown-openbsd${UNAME_RELEASE}
  210. exit 0 ;;
  211. arc:OpenBSD:*:*)
  212. echo mipsel-unknown-openbsd${UNAME_RELEASE}
  213. exit 0 ;;
  214. hkmips:OpenBSD:*:*)
  215. echo mips-unknown-openbsd${UNAME_RELEASE}
  216. exit 0 ;;
  217. pmax:OpenBSD:*:*)
  218. echo mipsel-unknown-openbsd${UNAME_RELEASE}
  219. exit 0 ;;
  220. sgi:OpenBSD:*:*)
  221. echo mips-unknown-openbsd${UNAME_RELEASE}
  222. exit 0 ;;
  223. wgrisc:OpenBSD:*:*)
  224. echo mipsel-unknown-openbsd${UNAME_RELEASE}
  225. exit 0 ;;
  226. *:OS/390:*:*)
  227. echo i370-ibm-openedition
  228. exit 0 ;;
  229. arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  230. echo arm-acorn-riscix${UNAME_RELEASE}
  231. exit 0;;
  232. SR2?01:HI-UX/MPP:*:*)
  233. echo hppa1.1-hitachi-hiuxmpp
  234. exit 0;;
  235. Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
  236. # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
  237. if test "`(/bin/universe) 2>/dev/null`" = att ; then
  238. echo pyramid-pyramid-sysv3
  239. else
  240. echo pyramid-pyramid-bsd
  241. fi
  242. exit 0 ;;
  243. NILE*:*:*:dcosx)
  244. echo pyramid-pyramid-svr4
  245. exit 0 ;;
  246. sun4H:SunOS:5.*:*)
  247. echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  248. exit 0 ;;
  249. sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
  250. echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  251. exit 0 ;;
  252. i86pc:SunOS:5.*:*)
  253. echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  254. exit 0 ;;
  255. sun4*:SunOS:6*:*)
  256. # According to config.sub, this is the proper way to canonicalize
  257. # SunOS6. Hard to guess exactly what SunOS6 will be like, but
  258. # it's likely to be more like Solaris than SunOS4.
  259. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  260. exit 0 ;;
  261. sun4*:SunOS:*:*)
  262. case "`/usr/bin/arch -k`" in
  263. Series*|S4*)
  264. UNAME_RELEASE=`uname -v`
  265. ;;
  266. esac
  267. # Japanese Language versions have a version number like `4.1.3-JL'.
  268. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
  269. exit 0 ;;
  270. sun3*:SunOS:*:*)
  271. echo m68k-sun-sunos${UNAME_RELEASE}
  272. exit 0 ;;
  273. sun*:*:4.2BSD:*)
  274. UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
  275. test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
  276. case "`/bin/arch`" in
  277. sun3)
  278. echo m68k-sun-sunos${UNAME_RELEASE}
  279. ;;
  280. sun4)
  281. echo sparc-sun-sunos${UNAME_RELEASE}
  282. ;;
  283. esac
  284. exit 0 ;;
  285. aushp:SunOS:*:*)
  286. echo sparc-auspex-sunos${UNAME_RELEASE}
  287. exit 0 ;;
  288. atari*:OpenBSD:*:*)
  289. echo m68k-unknown-openbsd${UNAME_RELEASE}
  290. exit 0 ;;
  291. # The situation for MiNT is a little confusing. The machine name
  292. # can be virtually everything (everything which is not
  293. # "atarist" or "atariste" at least should have a processor
  294. # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
  295. # to the lowercase version "mint" (or "freemint"). Finally
  296. # the system name "TOS" denotes a system which is actually not
  297. # MiNT. But MiNT is downward compatible to TOS, so this should
  298. # be no problem.
  299. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
  300. echo m68k-atari-mint${UNAME_RELEASE}
  301. exit 0 ;;
  302. atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
  303. echo m68k-atari-mint${UNAME_RELEASE}
  304. exit 0 ;;
  305. *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
  306. echo m68k-atari-mint${UNAME_RELEASE}
  307. exit 0 ;;
  308. milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
  309. echo m68k-milan-mint${UNAME_RELEASE}
  310. exit 0 ;;
  311. hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
  312. echo m68k-hades-mint${UNAME_RELEASE}
  313. exit 0 ;;
  314. *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
  315. echo m68k-unknown-mint${UNAME_RELEASE}
  316. exit 0 ;;
  317. sun3*:OpenBSD:*:*)
  318. echo m68k-unknown-openbsd${UNAME_RELEASE}
  319. exit 0 ;;
  320. mac68k:OpenBSD:*:*)
  321. echo m68k-unknown-openbsd${UNAME_RELEASE}
  322. exit 0 ;;
  323. mvme68k:OpenBSD:*:*)
  324. echo m68k-unknown-openbsd${UNAME_RELEASE}
  325. exit 0 ;;
  326. mvme88k:OpenBSD:*:*)
  327. echo m88k-unknown-openbsd${UNAME_RELEASE}
  328. exit 0 ;;
  329. powerpc:machten:*:*)
  330. echo powerpc-apple-machten${UNAME_RELEASE}
  331. exit 0 ;;
  332. RISC*:Mach:*:*)
  333. echo mips-dec-mach_bsd4.3
  334. exit 0 ;;
  335. RISC*:ULTRIX:*:*)
  336. echo mips-dec-ultrix${UNAME_RELEASE}
  337. exit 0 ;;
  338. VAX*:ULTRIX*:*:*)
  339. echo vax-dec-ultrix${UNAME_RELEASE}
  340. exit 0 ;;
  341. 2020:CLIX:*:* | 2430:CLIX:*:*)
  342. echo clipper-intergraph-clix${UNAME_RELEASE}
  343. exit 0 ;;
  344. mips:*:*:UMIPS | mips:*:*:RISCos)
  345. sed 's/^ //' << EOF >$dummy.c
  346. #ifdef __cplusplus
  347. #include <stdio.h> /* for printf() prototype */
  348. int main (int argc, char *argv[]) {
  349. #else
  350. int main (argc, argv) int argc; char *argv[]; {
  351. #endif
  352. #if defined (host_mips) && defined (MIPSEB)
  353. #if defined (SYSTYPE_SYSV)
  354. printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
  355. #endif
  356. #if defined (SYSTYPE_SVR4)
  357. printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
  358. #endif
  359. #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
  360. printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
  361. #endif
  362. #endif
  363. exit (-1);
  364. }
  365. EOF
  366. $CC_FOR_BUILD $dummy.c -o $dummy \
  367. && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
  368. && rm $dummy.c $dummy && exit 0
  369. rm -f $dummy.c $dummy
  370. echo mips-mips-riscos${UNAME_RELEASE}
  371. exit 0 ;;
  372. Night_Hawk:Power_UNIX:*:*)
  373. echo powerpc-harris-powerunix
  374. exit 0 ;;
  375. m88k:CX/UX:7*:*)
  376. echo m88k-harris-cxux7
  377. exit 0 ;;
  378. m88k:*:4*:R4*)
  379. echo m88k-motorola-sysv4
  380. exit 0 ;;
  381. m88k:*:3*:R3*)
  382. echo m88k-motorola-sysv3
  383. exit 0 ;;
  384. AViiON:dgux:*:*)
  385. # DG/UX returns AViiON for all architectures
  386. UNAME_PROCESSOR=`/usr/bin/uname -p`
  387. if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
  388. then
  389. if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
  390. [ ${TARGET_BINARY_INTERFACE}x = x ]
  391. then
  392. echo m88k-dg-dgux${UNAME_RELEASE}
  393. else
  394. echo m88k-dg-dguxbcs${UNAME_RELEASE}
  395. fi
  396. else
  397. echo i586-dg-dgux${UNAME_RELEASE}
  398. fi
  399. exit 0 ;;
  400. M88*:DolphinOS:*:*) # DolphinOS (SVR3)
  401. echo m88k-dolphin-sysv3
  402. exit 0 ;;
  403. M88*:*:R3*:*)
  404. # Delta 88k system running SVR3
  405. echo m88k-motorola-sysv3
  406. exit 0 ;;
  407. XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  408. echo m88k-tektronix-sysv3
  409. exit 0 ;;
  410. Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  411. echo m68k-tektronix-bsd
  412. exit 0 ;;
  413. *:IRIX*:*:*)
  414. echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
  415. exit 0 ;;
  416. ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
  417. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
  418. exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
  419. i?86:AIX:*:*)
  420. echo i386-ibm-aix
  421. exit 0 ;;
  422. *:AIX:2:3)
  423. if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
  424. sed 's/^ //' << EOF >$dummy.c
  425. #include <sys/systemcfg.h>
  426. main()
  427. {
  428. if (!__power_pc())
  429. exit(1);
  430. puts("powerpc-ibm-aix3.2.5");
  431. exit(0);
  432. }
  433. EOF
  434. $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
  435. rm -f $dummy.c $dummy
  436. echo rs6000-ibm-aix3.2.5
  437. elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  438. echo rs6000-ibm-aix3.2.4
  439. else
  440. echo rs6000-ibm-aix3.2
  441. fi
  442. exit 0 ;;
  443. *:AIX:*:4)
  444. IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
  445. if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
  446. IBM_ARCH=rs6000
  447. else
  448. IBM_ARCH=powerpc
  449. fi
  450. if [ -x /usr/bin/oslevel ] ; then
  451. IBM_REV=`/usr/bin/oslevel`
  452. else
  453. IBM_REV=4.${UNAME_RELEASE}
  454. fi
  455. echo ${IBM_ARCH}-ibm-aix${IBM_REV}
  456. exit 0 ;;
  457. *:AIX:*:*)
  458. echo rs6000-ibm-aix
  459. exit 0 ;;
  460. ibmrt:4.4BSD:*|romp-ibm:BSD:*)
  461. echo romp-ibm-bsd4.4
  462. exit 0 ;;
  463. ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
  464. echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
  465. exit 0 ;; # report: romp-ibm BSD 4.3
  466. *:BOSX:*:*)
  467. echo rs6000-bull-bosx
  468. exit 0 ;;
  469. DPX/2?00:B.O.S.:*:*)
  470. echo m68k-bull-sysv3
  471. exit 0 ;;
  472. 9000/[34]??:4.3bsd:1.*:*)
  473. echo m68k-hp-bsd
  474. exit 0 ;;
  475. hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  476. echo m68k-hp-bsd4.4
  477. exit 0 ;;
  478. 9000/[34678]??:HP-UX:*:*)
  479. case "${UNAME_MACHINE}" in
  480. 9000/31? ) HP_ARCH=m68000 ;;
  481. 9000/[34]?? ) HP_ARCH=m68k ;;
  482. 9000/[678][0-9][0-9])
  483. sed 's/^ //' << EOF >$dummy.c
  484. #define _HPUX_SOURCE
  485. #include <stdlib.h>
  486. #include <unistd.h>
  487. int main ()
  488. {
  489. #if defined(_SC_KERNEL_BITS)
  490. long bits = sysconf(_SC_KERNEL_BITS);
  491. #endif
  492. long cpu = sysconf (_SC_CPU_VERSION);
  493. switch (cpu)
  494. {
  495. case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
  496. case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
  497. case CPU_PA_RISC2_0:
  498. #if defined(_SC_KERNEL_BITS)
  499. switch (bits)
  500. {
  501. case 64: puts ("hppa2.0w"); break;
  502. case 32: puts ("hppa2.0n"); break;
  503. default: puts ("hppa2.0"); break;
  504. } break;
  505. #else /* !defined(_SC_KERNEL_BITS) */
  506. puts ("hppa2.0"); break;
  507. #endif
  508. default: puts ("hppa1.0"); break;
  509. }
  510. exit (0);
  511. }
  512. EOF
  513. (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
  514. rm -f $dummy.c $dummy
  515. esac
  516. HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  517. echo ${HP_ARCH}-hp-hpux${HPUX_REV}
  518. exit 0 ;;
  519. 3050*:HI-UX:*:*)
  520. sed 's/^ //' << EOF >$dummy.c
  521. #include <unistd.h>
  522. int
  523. main ()
  524. {
  525. long cpu = sysconf (_SC_CPU_VERSION);
  526. /* The order matters, because CPU_IS_HP_MC68K erroneously returns
  527. true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
  528. results, however. */
  529. if (CPU_IS_PA_RISC (cpu))
  530. {
  531. switch (cpu)
  532. {
  533. case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  534. case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  535. case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  536. default: puts ("hppa-hitachi-hiuxwe2"); break;
  537. }
  538. }
  539. else if (CPU_IS_HP_MC68K (cpu))
  540. puts ("m68k-hitachi-hiuxwe2");
  541. else puts ("unknown-hitachi-hiuxwe2");
  542. exit (0);
  543. }
  544. EOF
  545. $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
  546. rm -f $dummy.c $dummy
  547. echo unknown-hitachi-hiuxwe2
  548. exit 0 ;;
  549. 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
  550. echo hppa1.1-hp-bsd
  551. exit 0 ;;
  552. 9000/8??:4.3bsd:*:*)
  553. echo hppa1.0-hp-bsd
  554. exit 0 ;;
  555. *9??*:MPE/iX:*:*)
  556. echo hppa1.0-hp-mpeix
  557. exit 0 ;;
  558. hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
  559. echo hppa1.1-hp-osf
  560. exit 0 ;;
  561. hp8??:OSF1:*:*)
  562. echo hppa1.0-hp-osf
  563. exit 0 ;;
  564. i?86:OSF1:*:*)
  565. if [ -x /usr/sbin/sysversion ] ; then
  566. echo ${UNAME_MACHINE}-unknown-osf1mk
  567. else
  568. echo ${UNAME_MACHINE}-unknown-osf1
  569. fi
  570. exit 0 ;;
  571. parisc*:Lites*:*:*)
  572. echo hppa1.1-hp-lites
  573. exit 0 ;;
  574. hppa*:OpenBSD:*:*)
  575. echo hppa-unknown-openbsd
  576. exit 0 ;;
  577. C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
  578. echo c1-convex-bsd
  579. exit 0 ;;
  580. C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
  581. if getsysinfo -f scalar_acc
  582. then echo c32-convex-bsd
  583. else echo c2-convex-bsd
  584. fi
  585. exit 0 ;;
  586. C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
  587. echo c34-convex-bsd
  588. exit 0 ;;
  589. C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
  590. echo c38-convex-bsd
  591. exit 0 ;;
  592. C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
  593. echo c4-convex-bsd
  594. exit 0 ;;
  595. CRAY*X-MP:*:*:*)
  596. echo xmp-cray-unicos
  597. exit 0 ;;
  598. CRAY*Y-MP:*:*:*)
  599. echo ymp-cray-unicos${UNAME_RELEASE}
  600. exit 0 ;;
  601. CRAY*[A-Z]90:*:*:*)
  602. echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
  603. | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
  604. -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
  605. exit 0 ;;
  606. CRAY*TS:*:*:*)
  607. echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  608. exit 0 ;;
  609. CRAY*T3E:*:*:*)
  610. echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  611. exit 0 ;;
  612. CRAY*SV1:*:*:*)
  613. echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  614. exit 0 ;;
  615. CRAY-2:*:*:*)
  616. echo cray2-cray-unicos
  617. exit 0 ;;
  618. F300:UNIX_System_V:*:*)
  619. FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
  620. FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
  621. echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
  622. exit 0 ;;
  623. F301:UNIX_System_V:*:*)
  624. echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
  625. exit 0 ;;
  626. hp300:OpenBSD:*:*)
  627. echo m68k-unknown-openbsd${UNAME_RELEASE}
  628. exit 0 ;;
  629. i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
  630. echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
  631. exit 0 ;;
  632. sparc*:BSD/OS:*:*)
  633. echo sparc-unknown-bsdi${UNAME_RELEASE}
  634. exit 0 ;;
  635. *:BSD/OS:*:*)
  636. echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
  637. exit 0 ;;
  638. *:FreeBSD:*:*)
  639. echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
  640. exit 0 ;;
  641. *:OpenBSD:*:*)
  642. echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
  643. exit 0 ;;
  644. i*:CYGWIN*:*)
  645. echo ${UNAME_MACHINE}-pc-cygwin
  646. exit 0 ;;
  647. i*:MINGW*:*)
  648. echo ${UNAME_MACHINE}-pc-mingw32
  649. exit 0 ;;
  650. i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
  651. # How do we know it's Interix rather than the generic POSIX subsystem?
  652. # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
  653. # UNAME_MACHINE based on the output of uname instead of i386?
  654. echo i386-pc-interix
  655. exit 0 ;;
  656. i*:UWIN*:*)
  657. echo ${UNAME_MACHINE}-pc-uwin
  658. exit 0 ;;
  659. p*:CYGWIN*:*)
  660. echo powerpcle-unknown-cygwin
  661. exit 0 ;;
  662. prep*:SunOS:5.*:*)
  663. echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  664. exit 0 ;;
  665. *:GNU:*:*)
  666. echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
  667. exit 0 ;;
  668. *:Linux:*:*)
  669. # The BFD linker knows what the default object file format is, so
  670. # first see if it will tell us. cd to the root directory to prevent
  671. # problems with other programs or directories called `ld' in the path.
  672. ld_help_string=`cd /; ld --help 2>&1`
  673. ld_supported_emulations=`echo $ld_help_string \
  674. | sed -ne '/supported emulations:/!d
  675. s/[ ][ ]*/ /g
  676. s/.*supported emulations: *//
  677. s/ .*//
  678. p'`
  679. case "$ld_supported_emulations" in
  680. *ia64)
  681. echo "${UNAME_MACHINE}-unknown-linux"
  682. exit 0
  683. ;;
  684. i?86linux)
  685. echo "${UNAME_MACHINE}-pc-linux-gnuaout"
  686. exit 0
  687. ;;
  688. elf_i?86)
  689. echo "${UNAME_MACHINE}-pc-linux"
  690. exit 0
  691. ;;
  692. i?86coff)
  693. echo "${UNAME_MACHINE}-pc-linux-gnucoff"
  694. exit 0
  695. ;;
  696. sparclinux)
  697. echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
  698. exit 0
  699. ;;
  700. armlinux)
  701. echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
  702. exit 0
  703. ;;
  704. elf32arm*)
  705. echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
  706. exit 0
  707. ;;
  708. armelf_linux*)
  709. echo "${UNAME_MACHINE}-unknown-linux-gnu"
  710. exit 0
  711. ;;
  712. m68klinux)
  713. echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
  714. exit 0
  715. ;;
  716. elf32ppc | elf32ppclinux)
  717. # Determine Lib Version
  718. cat >$dummy.c <<EOF
  719. #include <features.h>
  720. #if defined(__GLIBC__)
  721. extern char __libc_version[];
  722. extern char __libc_release[];
  723. #endif
  724. main(argc, argv)
  725. int argc;
  726. char *argv[];
  727. {
  728. #if defined(__GLIBC__)
  729. printf("%s %s\n", __libc_version, __libc_release);
  730. #else
  731. printf("unkown\n");
  732. #endif
  733. return 0;
  734. }
  735. EOF
  736. LIBC=""
  737. $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
  738. if test "$?" = 0 ; then
  739. ./$dummy | grep 1\.99 > /dev/null
  740. if test "$?" = 0 ; then
  741. LIBC="libc1"
  742. fi
  743. fi
  744. rm -f $dummy.c $dummy
  745. echo powerpc-unknown-linux-gnu${LIBC}
  746. exit 0
  747. ;;
  748. shelf_linux)
  749. echo "${UNAME_MACHINE}-unknown-linux-gnu"
  750. exit 0
  751. ;;
  752. esac
  753. if test "${UNAME_MACHINE}" = "alpha" ; then
  754. cat <<EOF >$dummy.s
  755. .data
  756. \$Lformat:
  757. .byte 37,100,45,37,120,10,0 # "%d-%x\n"
  758. .text
  759. .globl main
  760. .align 4
  761. .ent main
  762. main:
  763. .frame \$30,16,\$26,0
  764. ldgp \$29,0(\$27)
  765. .prologue 1
  766. .long 0x47e03d80 # implver \$0
  767. lda \$2,-1
  768. .long 0x47e20c21 # amask \$2,\$1
  769. lda \$16,\$Lformat
  770. mov \$0,\$17
  771. not \$1,\$18
  772. jsr \$26,printf
  773. ldgp \$29,0(\$26)
  774. mov 0,\$16
  775. jsr \$26,exit
  776. .end main
  777. EOF
  778. LIBC=""
  779. $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
  780. if test "$?" = 0 ; then
  781. case `./$dummy` in
  782. 0-0)
  783. UNAME_MACHINE="alpha"
  784. ;;
  785. 1-0)
  786. UNAME_MACHINE="alphaev5"
  787. ;;
  788. 1-1)
  789. UNAME_MACHINE="alphaev56"
  790. ;;
  791. 1-101)
  792. UNAME_MACHINE="alphapca56"
  793. ;;
  794. 2-303)
  795. UNAME_MACHINE="alphaev6"
  796. ;;
  797. 2-307)
  798. UNAME_MACHINE="alphaev67"
  799. ;;
  800. esac
  801. objdump --private-headers $dummy | \
  802. grep ld.so.1 > /dev/null
  803. if test "$?" = 0 ; then
  804. LIBC="libc1"
  805. fi
  806. fi
  807. rm -f $dummy.s $dummy
  808. echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
  809. elif test "${UNAME_MACHINE}" = "mips" ; then
  810. cat >$dummy.c <<EOF
  811. #ifdef __cplusplus
  812. #include <stdio.h> /* for printf() prototype */
  813. int main (int argc, char *argv[]) {
  814. #else
  815. int main (argc, argv) int argc; char *argv[]; {
  816. #endif
  817. #ifdef __MIPSEB__
  818. printf ("%s-unknown-linux-gnu\n", argv[1]);
  819. #endif
  820. #ifdef __MIPSEL__
  821. printf ("%sel-unknown-linux-gnu\n", argv[1]);
  822. #endif
  823. return 0;
  824. }
  825. EOF
  826. $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
  827. rm -f $dummy.c $dummy
  828. elif test "${UNAME_MACHINE}" = "s390"; then
  829. echo s390-ibm-linux && exit 0
  830. elif test "${UNAME_MACHINE}" = "parisc" -o "${UNAME_MACHINE}" = "hppa"; then
  831. # Look for CPU level
  832. case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  833. PA7*)
  834. echo hppa1.1-unknown-linux-gnu
  835. ;;
  836. PA8*)
  837. echo hppa2.0-unknown-linux-gnu
  838. ;;
  839. *)
  840. echo hppa-unknown-linux-gnu
  841. ;;
  842. esac
  843. exit 0;
  844. else
  845. # Either a pre-BFD a.out linker (linux-gnuoldld)
  846. # or one that does not give us useful --help.
  847. # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
  848. # If ld does not provide *any* "supported emulations:"
  849. # that means it is gnuoldld.
  850. echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
  851. test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
  852. case "${UNAME_MACHINE}" in
  853. i?86)
  854. VENDOR=pc;
  855. ;;
  856. *)
  857. VENDOR=unknown;
  858. ;;
  859. esac
  860. # Determine whether the default compiler is a.out or elf
  861. cat >$dummy.c <<EOF
  862. #include <features.h>
  863. #ifdef __cplusplus
  864. #include <stdio.h> /* for printf() prototype */
  865. int main (int argc, char *argv[]) {
  866. #else
  867. int main (argc, argv) int argc; char *argv[]; {
  868. #endif
  869. #ifdef __ELF__
  870. # ifdef __GLIBC__
  871. # if __GLIBC__ >= 2
  872. printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
  873. # else
  874. printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
  875. # endif
  876. # else
  877. printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
  878. # endif
  879. #else
  880. printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
  881. #endif
  882. return 0;
  883. }
  884. EOF
  885. $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
  886. rm -f $dummy.c $dummy
  887. fi ;;
  888. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
  889. # are messed up and put the nodename in both sysname and nodename.
  890. i?86:DYNIX/ptx:4*:*)
  891. echo i386-sequent-sysv4
  892. exit 0 ;;
  893. i?86:UNIX_SV:4.2MP:2.*)
  894. # Unixware is an offshoot of SVR4, but it has its own version
  895. # number series starting with 2...
  896. # I am not positive that other SVR4 systems won't match this,
  897. # I just have to hope. -- rms.
  898. # Use sysv4.2uw... so that sysv4* matches it.
  899. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
  900. exit 0 ;;
  901. i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
  902. UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
  903. if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  904. echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
  905. else
  906. echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
  907. fi
  908. exit 0 ;;
  909. i?86:*:5:7*)
  910. # Fixed at (any) Pentium or better
  911. UNAME_MACHINE=i586
  912. if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
  913. echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
  914. else
  915. echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
  916. fi
  917. exit 0 ;;
  918. i?86:*:3.2:*)
  919. if test -f /usr/options/cb.name; then
  920. UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  921. echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
  922. elif /bin/uname -X 2>/dev/null >/dev/null ; then
  923. UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
  924. (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
  925. (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
  926. && UNAME_MACHINE=i586
  927. (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
  928. && UNAME_MACHINE=i686
  929. (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
  930. && UNAME_MACHINE=i686
  931. echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
  932. else
  933. echo ${UNAME_MACHINE}-pc-sysv32
  934. fi
  935. exit 0 ;;
  936. i?86:*DOS:*:*)
  937. echo ${UNAME_MACHINE}-pc-msdosdjgpp
  938. exit 0 ;;
  939. pc:*:*:*)
  940. # Left here for compatibility:
  941. # uname -m prints for DJGPP always 'pc', but it prints nothing about
  942. # the processor, so we play safe by assuming i386.
  943. echo i386-pc-msdosdjgpp
  944. exit 0 ;;
  945. Intel:Mach:3*:*)
  946. echo i386-pc-mach3
  947. exit 0 ;;
  948. paragon:*:*:*)
  949. echo i860-intel-osf1
  950. exit 0 ;;
  951. i860:*:4.*:*) # i860-SVR4
  952. if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  953. echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
  954. else # Add other i860-SVR4 vendors below as they are discovered.
  955. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
  956. fi
  957. exit 0 ;;
  958. mini*:CTIX:SYS*5:*)
  959. # "miniframe"
  960. echo m68010-convergent-sysv
  961. exit 0 ;;
  962. M68*:*:R3V[567]*:*)
  963. test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
  964. 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
  965. OS_REL=''
  966. test -r /etc/.relid \
  967. && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  968. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  969. && echo i486-ncr-sysv4.3${OS_REL} && exit 0
  970. /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  971. && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
  972. 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  973. /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  974. && echo i486-ncr-sysv4 && exit 0 ;;
  975. m68*:LynxOS:2.*:*)
  976. echo m68k-unknown-lynxos${UNAME_RELEASE}
  977. exit 0 ;;
  978. mc68030:UNIX_System_V:4.*:*)
  979. echo m68k-atari-sysv4
  980. exit 0 ;;
  981. i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
  982. echo i386-unknown-lynxos${UNAME_RELEASE}
  983. exit 0 ;;
  984. TSUNAMI:LynxOS:2.*:*)
  985. echo sparc-unknown-lynxos${UNAME_RELEASE}
  986. exit 0 ;;
  987. rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
  988. echo rs6000-unknown-lynxos${UNAME_RELEASE}
  989. exit 0 ;;
  990. SM[BE]S:UNIX_SV:*:*)
  991. echo mips-dde-sysv${UNAME_RELEASE}
  992. exit 0 ;;
  993. RM*:ReliantUNIX-*:*:*)
  994. echo mips-sni-sysv4
  995. exit 0 ;;
  996. RM*:SINIX-*:*:*)
  997. echo mips-sni-sysv4
  998. exit 0 ;;
  999. *:SINIX-*:*:*)
  1000. if uname -p 2>/dev/null >/dev/null ; then
  1001. UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1002. echo ${UNAME_MACHINE}-sni-sysv4
  1003. else
  1004. echo ns32k-sni-sysv
  1005. fi
  1006. exit 0 ;;
  1007. PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  1008. # says <Richard.M.Bartel@ccMail.Census.GOV>
  1009. echo i586-unisys-sysv4
  1010. exit 0 ;;
  1011. *:UNIX_System_V:4*:FTX*)
  1012. # From Gerald Hewes <hewes@openmarket.com>.
  1013. # How about differentiating between stratus architectures? -djm
  1014. echo hppa1.1-stratus-sysv4
  1015. exit 0 ;;
  1016. *:*:*:FTX*)
  1017. # From seanf@swdc.stratus.com.
  1018. echo i860-stratus-sysv4
  1019. exit 0 ;;
  1020. mc68*:A/UX:*:*)
  1021. echo m68k-apple-aux${UNAME_RELEASE}
  1022. exit 0 ;;
  1023. news*:NEWS-OS:*:6*)
  1024. echo mips-sony-newsos6
  1025. exit 0 ;;
  1026. R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  1027. if [ -d /usr/nec ]; then
  1028. echo mips-nec-sysv${UNAME_RELEASE}
  1029. else
  1030. echo mips-unknown-sysv${UNAME_RELEASE}
  1031. fi
  1032. exit 0 ;;
  1033. BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
  1034. echo powerpc-be-beos
  1035. exit 0 ;;
  1036. BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
  1037. echo powerpc-apple-beos
  1038. exit 0 ;;
  1039. BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
  1040. echo i586-pc-beos
  1041. exit 0 ;;
  1042. SX-4:SUPER-UX:*:*)
  1043. echo sx4-nec-superux${UNAME_RELEASE}
  1044. exit 0 ;;
  1045. SX-5:SUPER-UX:*:*)
  1046. echo sx5-nec-superux${UNAME_RELEASE}
  1047. exit 0 ;;
  1048. Power*:Rhapsody:*:*)
  1049. echo powerpc-apple-rhapsody${UNAME_RELEASE}
  1050. exit 0 ;;
  1051. *:Rhapsody:*:*)
  1052. echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
  1053. exit 0 ;;
  1054. *:Darwin:*:*)
  1055. echo `uname -p`-apple-darwin${UNAME_RELEASE}
  1056. exit 0 ;;
  1057. *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1058. if test "${UNAME_MACHINE}" = "x86pc"; then
  1059. UNAME_MACHINE=pc
  1060. fi
  1061. echo `uname -p`-${UNAME_MACHINE}-nto-qnx
  1062. exit 0 ;;
  1063. *:QNX:*:4*)
  1064. echo i386-pc-qnx
  1065. exit 0 ;;
  1066. NSR-W:NONSTOP_KERNEL:*:*)
  1067. echo nsr-tandem-nsk${UNAME_RELEASE}
  1068. exit 0 ;;
  1069. BS2000:POSIX*:*:*)
  1070. echo bs2000-siemens-sysv
  1071. exit 0 ;;
  1072. DS/*:UNIX_System_V:*:*)
  1073. echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
  1074. exit 0 ;;
  1075. esac
  1076. #echo '(No uname command or uname output not recognized.)' 1>&2
  1077. #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  1078. cat >$dummy.c <<EOF
  1079. #ifdef _SEQUENT_
  1080. # include <sys/types.h>
  1081. # include <sys/utsname.h>
  1082. #endif
  1083. main ()
  1084. {
  1085. #if defined (sony)
  1086. #if defined (MIPSEB)
  1087. /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
  1088. I don't know.... */
  1089. printf ("mips-sony-bsd\n"); exit (0);
  1090. #else
  1091. #include <sys/param.h>
  1092. printf ("m68k-sony-newsos%s\n",
  1093. #ifdef NEWSOS4
  1094. "4"
  1095. #else
  1096. ""
  1097. #endif
  1098. ); exit (0);
  1099. #endif
  1100. #endif
  1101. #if defined (__arm) && defined (__acorn) && defined (__unix)
  1102. printf ("arm-acorn-riscix"); exit (0);
  1103. #endif
  1104. #if defined (hp300) && !defined (hpux)
  1105. printf ("m68k-hp-bsd\n"); exit (0);
  1106. #endif
  1107. #if defined (NeXT)
  1108. #if !defined (__ARCHITECTURE__)
  1109. #define __ARCHITECTURE__ "m68k"
  1110. #endif
  1111. int version;
  1112. version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  1113. if (version < 4)
  1114. printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
  1115. else
  1116. printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
  1117. exit (0);
  1118. #endif
  1119. #if defined (MULTIMAX) || defined (n16)
  1120. #if defined (UMAXV)
  1121. printf ("ns32k-encore-sysv\n"); exit (0);
  1122. #else
  1123. #if defined (CMU)
  1124. printf ("ns32k-encore-mach\n"); exit (0);
  1125. #else
  1126. printf ("ns32k-encore-bsd\n"); exit (0);
  1127. #endif
  1128. #endif
  1129. #endif
  1130. #if defined (__386BSD__)
  1131. printf ("i386-pc-bsd\n"); exit (0);
  1132. #endif
  1133. #if defined (sequent)
  1134. #if defined (i386)
  1135. printf ("i386-sequent-dynix\n"); exit (0);
  1136. #endif
  1137. #if defined (ns32000)
  1138. printf ("ns32k-sequent-dynix\n"); exit (0);
  1139. #endif
  1140. #endif
  1141. #if defined (_SEQUENT_)
  1142. struct utsname un;
  1143. uname(&un);
  1144. if (strncmp(un.version, "V2", 2) == 0) {
  1145. printf ("i386-sequent-ptx2\n"); exit (0);
  1146. }
  1147. if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
  1148. printf ("i386-sequent-ptx1\n"); exit (0);
  1149. }
  1150. printf ("i386-sequent-ptx\n"); exit (0);
  1151. #endif
  1152. #if defined (vax)
  1153. #if !defined (ultrix)
  1154. printf ("vax-dec-bsd\n"); exit (0);
  1155. #else
  1156. printf ("vax-dec-ultrix\n"); exit (0);
  1157. #endif
  1158. #endif
  1159. #if defined (alliant) && defined (i860)
  1160. printf ("i860-alliant-bsd\n"); exit (0);
  1161. #endif
  1162. exit (1);
  1163. }
  1164. EOF
  1165. $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
  1166. rm -f $dummy.c $dummy
  1167. # Apollos put the system type in the environment.
  1168. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
  1169. # Convex versions that predate uname can use getsysinfo(1)
  1170. if [ -x /usr/convex/getsysinfo ]
  1171. then
  1172. case `getsysinfo -f cpu_type` in
  1173. c1*)
  1174. echo c1-convex-bsd
  1175. exit 0 ;;
  1176. c2*)
  1177. if getsysinfo -f scalar_acc
  1178. then echo c32-convex-bsd
  1179. else echo c2-convex-bsd
  1180. fi
  1181. exit 0 ;;
  1182. c34*)
  1183. echo c34-convex-bsd
  1184. exit 0 ;;
  1185. c38*)
  1186. echo c38-convex-bsd
  1187. exit 0 ;;
  1188. c4*)
  1189. echo c4-convex-bsd
  1190. exit 0 ;;
  1191. esac
  1192. fi
  1193. cat >&2 <<EOF
  1194. $0: unable to guess system type
  1195. The $version version of this script cannot recognize your system type.
  1196. Please download the most up to date version of the config scripts:
  1197. ftp://ftp.gnu.org/pub/gnu/config/
  1198. If the version you run ($0) is already up to date, please
  1199. send the following data and any information you think might be
  1200. pertinent to <config-patches@gnu.org> in order to provide the needed
  1201. information to handle your system.
  1202. config.guess version = $version
  1203. uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1204. uname -r = `(uname -r) 2>/dev/null || echo unknown`
  1205. uname -s = `(uname -s) 2>/dev/null || echo unknown`
  1206. uname -v = `(uname -v) 2>/dev/null || echo unknown`
  1207. /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
  1208. /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
  1209. hostinfo = `(hostinfo) 2>/dev/null`
  1210. /bin/universe = `(/bin/universe) 2>/dev/null`
  1211. /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
  1212. /bin/arch = `(/bin/arch) 2>/dev/null`
  1213. /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
  1214. /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
  1215. UNAME_MACHINE = ${UNAME_MACHINE}
  1216. UNAME_RELEASE = ${UNAME_RELEASE}
  1217. UNAME_SYSTEM = ${UNAME_SYSTEM}
  1218. UNAME_VERSION = ${UNAME_VERSION}
  1219. EOF
  1220. exit 1
  1221. # Local variables:
  1222. # eval: (add-hook 'write-file-hooks 'time-stamp)
  1223. # time-stamp-start: "version='"
  1224. # time-stamp-format: "%:y-%02m-%02d"
  1225. # time-stamp-end: "'"
  1226. # End: