Audio plugin host https://kx.studio/carla
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.

1372 lines
38KB

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