This contains my bachelors thesis and associated tex files, code snippets and maybe more. Topic: Data Movement in Heterogeneous Memories with Intel Data Streaming Accelerator
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.

1400 lines
40 KiB

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