config.guess 36 KB

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