config.guess 38 KB

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