config.guess 35 KB

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