Testing out the PPD42 Air Quality Sensor, with an MSP430 Launchpad and graphing the data with GNUplot.
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.

1495 lines
45 KiB

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