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