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

1319 lines
37 KiB

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