1 |
158 |
chris |
#! /bin/sh
|
2 |
|
|
# Attempt to guess a canonical system name.
|
3 |
|
|
# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
|
4 |
|
|
#
|
5 |
|
|
# This file is free software; you can redistribute it and/or modify it
|
6 |
|
|
# under the terms of the GNU General Public License as published by
|
7 |
|
|
# the Free Software Foundation; either version 2 of the License, or
|
8 |
|
|
# (at your option) any later version.
|
9 |
|
|
#
|
10 |
|
|
# This program is distributed in the hope that it will be useful, but
|
11 |
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13 |
|
|
# General Public License for more details.
|
14 |
|
|
#
|
15 |
|
|
# You should have received a copy of the GNU General Public License
|
16 |
|
|
# along with this program; if not, write to the Free Software
|
17 |
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
18 |
|
|
#
|
19 |
|
|
# As a special exception to the GNU General Public License, if you
|
20 |
|
|
# distribute this file as part of a program that contains a
|
21 |
|
|
# configuration script generated by Autoconf, you may include it under
|
22 |
|
|
# the same distribution terms that you use for the rest of that program.
|
23 |
|
|
|
24 |
|
|
# Written by Per Bothner .
|
25 |
|
|
# The master version of this file is at the FSF in /home/gd/gnu/lib.
|
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 system type (host/target name).
|
33 |
|
|
#
|
34 |
|
|
# Only a few systems have been added to this list; please add others
|
35 |
|
|
# (but try to keep the structure clean).
|
36 |
|
|
#
|
37 |
208 |
chris |
# $Id: config.guess,v 1.2 2001-09-27 11:59:04 chris Exp $
|
38 |
158 |
chris |
#
|
39 |
|
|
|
40 |
|
|
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
41 |
|
|
# (ghazi@noc.rutgers.edu 8/24/94.)
|
42 |
|
|
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
|
43 |
|
|
PATH=$PATH:/.attbin ; export PATH
|
44 |
|
|
fi
|
45 |
|
|
|
46 |
|
|
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
|
47 |
|
|
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
48 |
|
|
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
49 |
|
|
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
50 |
|
|
|
51 |
|
|
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
|
52 |
|
|
|
53 |
|
|
# Note: order is significant - the case branches are not exclusive.
|
54 |
|
|
|
55 |
|
|
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
56 |
|
|
alpha:OSF1:*:*)
|
57 |
|
|
# A Vn.n version is a released version.
|
58 |
|
|
# A Tn.n version is a released field test version.
|
59 |
|
|
# A Xn.n version is an unreleased experimental baselevel.
|
60 |
|
|
# 1.2 uses "1.2" for uname -r.
|
61 |
|
|
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
|
62 |
|
|
exit 0 ;;
|
63 |
|
|
21064:Windows_NT:50:3)
|
64 |
|
|
echo alpha-dec-winnt3.5
|
65 |
|
|
exit 0 ;;
|
66 |
|
|
Amiga*:UNIX_System_V:4.0:*)
|
67 |
|
|
echo m68k-cbm-sysv4
|
68 |
|
|
exit 0;;
|
69 |
|
|
amiga:NetBSD:*:*)
|
70 |
|
|
echo m68k-cbm-netbsd${UNAME_RELEASE}
|
71 |
|
|
exit 0 ;;
|
72 |
|
|
amiga:OpenBSD:*:*)
|
73 |
|
|
echo m68k-cbm-openbsd${UNAME_RELEASE}
|
74 |
|
|
exit 0 ;;
|
75 |
|
|
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
76 |
|
|
echo arm-acorn-riscix${UNAME_RELEASE}
|
77 |
|
|
exit 0;;
|
78 |
|
|
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
|
79 |
|
|
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
|
80 |
|
|
if test "`(/bin/universe) 2>/dev/null`" = att ; then
|
81 |
|
|
echo pyramid-pyramid-sysv3
|
82 |
|
|
else
|
83 |
|
|
echo pyramid-pyramid-bsd
|
84 |
|
|
fi
|
85 |
|
|
exit 0 ;;
|
86 |
|
|
NILE:*:*:dcosx)
|
87 |
|
|
echo pyramid-pyramid-svr4
|
88 |
|
|
exit 0 ;;
|
89 |
|
|
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
90 |
|
|
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
91 |
|
|
exit 0 ;;
|
92 |
|
|
i86pc:SunOS:5.*:*)
|
93 |
|
|
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
94 |
|
|
exit 0 ;;
|
95 |
|
|
sun4*:SunOS:6*:*)
|
96 |
|
|
# According to config.sub, this is the proper way to canonicalize
|
97 |
|
|
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
|
98 |
|
|
# it's likely to be more like Solaris than SunOS4.
|
99 |
|
|
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
100 |
|
|
exit 0 ;;
|
101 |
|
|
sun4*:SunOS:*:*)
|
102 |
|
|
case "`/usr/bin/arch -k`" in
|
103 |
|
|
Series*|S4*)
|
104 |
|
|
UNAME_RELEASE=`uname -v`
|
105 |
|
|
;;
|
106 |
|
|
esac
|
107 |
|
|
# Japanese Language versions have a version number like `4.1.3-JL'.
|
108 |
|
|
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
|
109 |
|
|
exit 0 ;;
|
110 |
|
|
sun3*:SunOS:*:*)
|
111 |
|
|
echo m68k-sun-sunos${UNAME_RELEASE}
|
112 |
|
|
exit 0 ;;
|
113 |
|
|
aushp:SunOS:*:*)
|
114 |
|
|
echo sparc-auspex-sunos${UNAME_RELEASE}
|
115 |
|
|
exit 0 ;;
|
116 |
|
|
atari*:NetBSD:*:*)
|
117 |
|
|
echo m68k-atari-netbsd${UNAME_RELEASE}
|
118 |
|
|
exit 0 ;;
|
119 |
|
|
atari*:OpenBSD:*:*)
|
120 |
|
|
echo m68k-atari-openbsd${UNAME_RELEASE}
|
121 |
|
|
exit 0 ;;
|
122 |
|
|
sun3*:NetBSD:*:*)
|
123 |
|
|
echo m68k-sun-netbsd${UNAME_RELEASE}
|
124 |
|
|
exit 0 ;;
|
125 |
|
|
sun3*:OpenBSD:*:*)
|
126 |
|
|
echo m68k-sun-openbsd${UNAME_RELEASE}
|
127 |
|
|
exit 0 ;;
|
128 |
|
|
mac68k:NetBSD:*:*)
|
129 |
|
|
echo m68k-apple-netbsd${UNAME_RELEASE}
|
130 |
|
|
exit 0 ;;
|
131 |
|
|
mac68k:OpenBSD:*:*)
|
132 |
|
|
echo m68k-apple-openbsd${UNAME_RELEASE}
|
133 |
|
|
exit 0 ;;
|
134 |
|
|
powerpc:machten:*:*)
|
135 |
|
|
echo powerpc-apple-machten${UNAME_RELEASE}
|
136 |
|
|
exit 0 ;;
|
137 |
|
|
RISC*:Mach:*:*)
|
138 |
|
|
echo mips-dec-mach_bsd4.3
|
139 |
|
|
exit 0 ;;
|
140 |
|
|
RISC*:ULTRIX:*:*)
|
141 |
|
|
echo mips-dec-ultrix${UNAME_RELEASE}
|
142 |
|
|
exit 0 ;;
|
143 |
|
|
VAX*:ULTRIX*:*:*)
|
144 |
|
|
echo vax-dec-ultrix${UNAME_RELEASE}
|
145 |
|
|
exit 0 ;;
|
146 |
|
|
mips:*:*:UMIPS | mips:*:*:RISCos)
|
147 |
|
|
sed 's/^ //' << EOF >dummy.c
|
148 |
|
|
int main (argc, argv) int argc; char **argv; {
|
149 |
|
|
#if defined (host_mips) && defined (MIPSEB)
|
150 |
|
|
#if defined (SYSTYPE_SYSV)
|
151 |
|
|
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
|
152 |
|
|
#endif
|
153 |
|
|
#if defined (SYSTYPE_SVR4)
|
154 |
|
|
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
|
155 |
|
|
#endif
|
156 |
|
|
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
|
157 |
|
|
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
|
158 |
|
|
#endif
|
159 |
|
|
#endif
|
160 |
|
|
exit (-1);
|
161 |
|
|
}
|
162 |
|
|
EOF
|
163 |
|
|
${CC-cc} dummy.c -o dummy \
|
164 |
|
|
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
165 |
|
|
&& rm dummy.c dummy && exit 0
|
166 |
|
|
rm -f dummy.c dummy
|
167 |
|
|
echo mips-mips-riscos${UNAME_RELEASE}
|
168 |
|
|
exit 0 ;;
|
169 |
|
|
Night_Hawk:Power_UNIX:*:*)
|
170 |
|
|
echo powerpc-harris-powerunix
|
171 |
|
|
exit 0 ;;
|
172 |
|
|
m88k:CX/UX:7*:*)
|
173 |
|
|
echo m88k-harris-cxux7
|
174 |
|
|
exit 0 ;;
|
175 |
|
|
m88k:*:4*:R4*)
|
176 |
|
|
echo m88k-motorola-sysv4
|
177 |
|
|
exit 0 ;;
|
178 |
|
|
m88k:*:3*:R3*)
|
179 |
|
|
echo m88k-motorola-sysv3
|
180 |
|
|
exit 0 ;;
|
181 |
|
|
AViiON:dgux:*:*)
|
182 |
|
|
# DG/UX returns AViiON for all architectures
|
183 |
|
|
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
184 |
|
|
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
|
185 |
|
|
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
|
186 |
|
|
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
|
187 |
|
|
echo m88k-dg-dgux${UNAME_RELEASE}
|
188 |
|
|
else
|
189 |
|
|
echo m88k-dg-dguxbcs${UNAME_RELEASE}
|
190 |
|
|
fi
|
191 |
|
|
else echo i586-dg-dgux${UNAME_RELEASE}
|
192 |
|
|
fi
|
193 |
|
|
exit 0 ;;
|
194 |
|
|
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
|
195 |
|
|
echo m88k-dolphin-sysv3
|
196 |
|
|
exit 0 ;;
|
197 |
|
|
M88*:*:R3*:*)
|
198 |
|
|
# Delta 88k system running SVR3
|
199 |
|
|
echo m88k-motorola-sysv3
|
200 |
|
|
exit 0 ;;
|
201 |
|
|
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
|
202 |
|
|
echo m88k-tektronix-sysv3
|
203 |
|
|
exit 0 ;;
|
204 |
|
|
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
|
205 |
|
|
echo m68k-tektronix-bsd
|
206 |
|
|
exit 0 ;;
|
207 |
|
|
*:IRIX*:*:*)
|
208 |
|
|
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
|
209 |
|
|
exit 0 ;;
|
210 |
|
|
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
|
211 |
|
|
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
|
212 |
|
|
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
|
213 |
|
|
i?86:AIX:*:*)
|
214 |
|
|
echo i386-ibm-aix
|
215 |
|
|
exit 0 ;;
|
216 |
|
|
*:AIX:2:3)
|
217 |
|
|
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
|
218 |
|
|
sed 's/^ //' << EOF >dummy.c
|
219 |
|
|
#include
|
220 |
|
|
|
221 |
|
|
main()
|
222 |
|
|
{
|
223 |
|
|
if (!__power_pc())
|
224 |
|
|
exit(1);
|
225 |
|
|
puts("powerpc-ibm-aix3.2.5");
|
226 |
|
|
exit(0);
|
227 |
|
|
}
|
228 |
|
|
EOF
|
229 |
|
|
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
230 |
|
|
rm -f dummy.c dummy
|
231 |
|
|
echo rs6000-ibm-aix3.2.5
|
232 |
|
|
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
233 |
|
|
echo rs6000-ibm-aix3.2.4
|
234 |
|
|
else
|
235 |
|
|
echo rs6000-ibm-aix3.2
|
236 |
|
|
fi
|
237 |
|
|
exit 0 ;;
|
238 |
|
|
*:AIX:*:4)
|
239 |
|
|
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
|
240 |
|
|
IBM_ARCH=rs6000
|
241 |
|
|
else
|
242 |
|
|
IBM_ARCH=powerpc
|
243 |
|
|
fi
|
244 |
|
|
if [ -x /usr/bin/oslevel ] ; then
|
245 |
|
|
IBM_REV=`/usr/bin/oslevel`
|
246 |
|
|
else
|
247 |
|
|
IBM_REV=4.${UNAME_RELEASE}
|
248 |
|
|
fi
|
249 |
|
|
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
|
250 |
|
|
exit 0 ;;
|
251 |
|
|
*:AIX:*:*)
|
252 |
|
|
echo rs6000-ibm-aix
|
253 |
|
|
exit 0 ;;
|
254 |
|
|
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
|
255 |
|
|
echo romp-ibm-bsd4.4
|
256 |
|
|
exit 0 ;;
|
257 |
|
|
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
|
258 |
|
|
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
|
259 |
|
|
exit 0 ;; # report: romp-ibm BSD 4.3
|
260 |
|
|
*:BOSX:*:*)
|
261 |
|
|
echo rs6000-bull-bosx
|
262 |
|
|
exit 0 ;;
|
263 |
|
|
DPX/2?00:B.O.S.:*:*)
|
264 |
|
|
echo m68k-bull-sysv3
|
265 |
|
|
exit 0 ;;
|
266 |
|
|
9000/[34]??:4.3bsd:1.*:*)
|
267 |
|
|
echo m68k-hp-bsd
|
268 |
|
|
exit 0 ;;
|
269 |
|
|
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
|
270 |
|
|
echo m68k-hp-bsd4.4
|
271 |
|
|
exit 0 ;;
|
272 |
|
|
9000/[3478]??:HP-UX:*:*)
|
273 |
|
|
case "${UNAME_MACHINE}" in
|
274 |
|
|
9000/31? ) HP_ARCH=m68000 ;;
|
275 |
|
|
9000/[34]?? ) HP_ARCH=m68k ;;
|
276 |
|
|
9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
|
277 |
|
|
9000/8?? ) HP_ARCH=hppa1.0 ;;
|
278 |
|
|
esac
|
279 |
|
|
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
280 |
|
|
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
281 |
|
|
exit 0 ;;
|
282 |
|
|
3050*:HI-UX:*:*)
|
283 |
|
|
sed 's/^ //' << EOF >dummy.c
|
284 |
|
|
#include
|
285 |
|
|
int
|
286 |
|
|
main ()
|
287 |
|
|
{
|
288 |
|
|
long cpu = sysconf (_SC_CPU_VERSION);
|
289 |
|
|
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
|
290 |
|
|
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
|
291 |
|
|
results, however. */
|
292 |
|
|
if (CPU_IS_PA_RISC (cpu))
|
293 |
|
|
{
|
294 |
|
|
switch (cpu)
|
295 |
|
|
{
|
296 |
|
|
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
|
297 |
|
|
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
|
298 |
|
|
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
|
299 |
|
|
default: puts ("hppa-hitachi-hiuxwe2"); break;
|
300 |
|
|
}
|
301 |
|
|
}
|
302 |
|
|
else if (CPU_IS_HP_MC68K (cpu))
|
303 |
|
|
puts ("m68k-hitachi-hiuxwe2");
|
304 |
|
|
else puts ("unknown-hitachi-hiuxwe2");
|
305 |
|
|
exit (0);
|
306 |
|
|
}
|
307 |
|
|
EOF
|
308 |
|
|
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
309 |
|
|
rm -f dummy.c dummy
|
310 |
|
|
echo unknown-hitachi-hiuxwe2
|
311 |
|
|
exit 0 ;;
|
312 |
|
|
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
313 |
|
|
echo hppa1.1-hp-bsd
|
314 |
|
|
exit 0 ;;
|
315 |
|
|
9000/8??:4.3bsd:*:*)
|
316 |
|
|
echo hppa1.0-hp-bsd
|
317 |
|
|
exit 0 ;;
|
318 |
|
|
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
|
319 |
|
|
echo hppa1.1-hp-osf
|
320 |
|
|
exit 0 ;;
|
321 |
|
|
hp8??:OSF1:*:*)
|
322 |
|
|
echo hppa1.0-hp-osf
|
323 |
|
|
exit 0 ;;
|
324 |
|
|
i?86:OSF1:*:*)
|
325 |
|
|
if [ -x /usr/sbin/sysversion ] ; then
|
326 |
|
|
echo ${UNAME_MACHINE}-unknown-osf1mk
|
327 |
|
|
else
|
328 |
|
|
echo ${UNAME_MACHINE}-unknown-osf1
|
329 |
|
|
fi
|
330 |
|
|
exit 0 ;;
|
331 |
|
|
parisc*:Lites*:*:*)
|
332 |
|
|
echo hppa1.1-hp-lites
|
333 |
|
|
exit 0 ;;
|
334 |
|
|
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
335 |
|
|
echo c1-convex-bsd
|
336 |
|
|
exit 0 ;;
|
337 |
|
|
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
|
338 |
|
|
if getsysinfo -f scalar_acc
|
339 |
|
|
then echo c32-convex-bsd
|
340 |
|
|
else echo c2-convex-bsd
|
341 |
|
|
fi
|
342 |
|
|
exit 0 ;;
|
343 |
|
|
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
|
344 |
|
|
echo c34-convex-bsd
|
345 |
|
|
exit 0 ;;
|
346 |
|
|
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
|
347 |
|
|
echo c38-convex-bsd
|
348 |
|
|
exit 0 ;;
|
349 |
|
|
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
350 |
|
|
echo c4-convex-bsd
|
351 |
|
|
exit 0 ;;
|
352 |
|
|
CRAY*X-MP:*:*:*)
|
353 |
|
|
echo xmp-cray-unicos
|
354 |
|
|
exit 0 ;;
|
355 |
|
|
CRAY*Y-MP:*:*:*)
|
356 |
|
|
echo ymp-cray-unicos${UNAME_RELEASE}
|
357 |
|
|
exit 0 ;;
|
358 |
|
|
CRAY*[A-Z]90:*:*:*)
|
359 |
|
|
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
|
360 |
|
|
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
|
361 |
|
|
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
362 |
|
|
exit 0 ;;
|
363 |
|
|
CRAY*TS:*:*:*)
|
364 |
|
|
echo t90-cray-unicos${UNAME_RELEASE}
|
365 |
|
|
exit 0 ;;
|
366 |
|
|
CRAY-2:*:*:*)
|
367 |
|
|
echo cray2-cray-unicos
|
368 |
|
|
exit 0 ;;
|
369 |
|
|
F300:UNIX_System_V:*:*)
|
370 |
|
|
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
|
371 |
|
|
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
372 |
|
|
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
373 |
|
|
exit 0 ;;
|
374 |
|
|
F301:UNIX_System_V:*:*)
|
375 |
|
|
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
|
376 |
|
|
exit 0 ;;
|
377 |
|
|
hp3[0-9][05]:NetBSD:*:*)
|
378 |
|
|
echo m68k-hp-netbsd${UNAME_RELEASE}
|
379 |
|
|
exit 0 ;;
|
380 |
|
|
hp3[0-9][05]:OpenBSD:*:*)
|
381 |
|
|
echo m68k-hp-openbsd${UNAME_RELEASE}
|
382 |
|
|
exit 0 ;;
|
383 |
|
|
i?86:BSD/386:*:* | *:BSD/OS:*:*)
|
384 |
|
|
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
385 |
|
|
exit 0 ;;
|
386 |
|
|
*:FreeBSD:*:*)
|
387 |
|
|
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
388 |
|
|
exit 0 ;;
|
389 |
|
|
*:NetBSD:*:*)
|
390 |
|
|
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
391 |
|
|
exit 0 ;;
|
392 |
|
|
*:OpenBSD:*:*)
|
393 |
|
|
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
394 |
|
|
exit 0 ;;
|
395 |
|
|
i*:CYGWIN*:*)
|
396 |
|
|
echo i386-pc-cygwin32
|
397 |
|
|
exit 0 ;;
|
398 |
|
|
p*:CYGWIN*:*)
|
399 |
|
|
echo powerpcle-unknown-cygwin32
|
400 |
|
|
exit 0 ;;
|
401 |
|
|
prep*:SunOS:5.*:*)
|
402 |
|
|
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
403 |
|
|
exit 0 ;;
|
404 |
|
|
*:GNU:*:*)
|
405 |
|
|
echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
406 |
|
|
exit 0 ;;
|
407 |
|
|
*:Linux:*:*)
|
408 |
|
|
# The BFD linker knows what the default object file format is, so
|
409 |
|
|
# first see if it will tell us.
|
410 |
|
|
ld_help_string=`ld --help 2>&1`
|
411 |
|
|
if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
|
412 |
|
|
echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
|
413 |
|
|
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
|
414 |
|
|
echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
|
415 |
|
|
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
|
416 |
|
|
echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
|
417 |
|
|
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
|
418 |
|
|
echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
|
419 |
|
|
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
|
420 |
|
|
echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
|
421 |
|
|
elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
|
422 |
|
|
echo "powerpc-unknown-linux-gnu" ; exit 0
|
423 |
|
|
elif test "${UNAME_MACHINE}" = "alpha" ; then
|
424 |
|
|
echo alpha-unknown-linux-gnu ; exit 0
|
425 |
|
|
elif test "${UNAME_MACHINE}" = "sparc" ; then
|
426 |
|
|
echo sparc-unknown-linux-gnu ; exit 0
|
427 |
|
|
else
|
428 |
|
|
# Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
|
429 |
|
|
# useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
|
430 |
|
|
test ! -d /usr/lib/ldscripts/. \
|
431 |
|
|
&& echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
|
432 |
|
|
# Determine whether the default compiler is a.out or elf
|
433 |
|
|
cat >dummy.c <
|
434 |
|
|
main(argc, argv)
|
435 |
|
|
int argc;
|
436 |
|
|
char *argv[];
|
437 |
|
|
{
|
438 |
|
|
#ifdef __ELF__
|
439 |
|
|
printf ("%s-pc-linux-gnu\n", argv[1]);
|
440 |
|
|
#else
|
441 |
|
|
printf ("%s-pc-linux-gnuaout\n", argv[1]);
|
442 |
|
|
#endif
|
443 |
|
|
return 0;
|
444 |
|
|
}
|
445 |
|
|
EOF
|
446 |
|
|
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
|
447 |
|
|
rm -f dummy.c dummy
|
448 |
|
|
fi ;;
|
449 |
|
|
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
|
450 |
|
|
# are messed up and put the nodename in both sysname and nodename.
|
451 |
|
|
i?86:DYNIX/ptx:4*:*)
|
452 |
|
|
echo i386-sequent-sysv4
|
453 |
|
|
exit 0 ;;
|
454 |
|
|
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
|
455 |
|
|
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
456 |
|
|
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
|
457 |
|
|
else
|
458 |
|
|
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
459 |
|
|
fi
|
460 |
|
|
exit 0 ;;
|
461 |
|
|
i?86:*:3.2:*)
|
462 |
|
|
if test -f /usr/options/cb.name; then
|
463 |
|
|
UNAME_REL=`sed -n 's/.*Version //p'
|
464 |
|
|
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
|
465 |
|
|
elif /bin/uname -X 2>/dev/null >/dev/null ; then
|
466 |
|
|
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
467 |
|
|
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
468 |
|
|
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
469 |
|
|
&& UNAME_MACHINE=i586
|
470 |
|
|
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
|
471 |
|
|
else
|
472 |
|
|
echo ${UNAME_MACHINE}-pc-sysv32
|
473 |
|
|
fi
|
474 |
|
|
exit 0 ;;
|
475 |
|
|
Intel:Mach:3*:*)
|
476 |
|
|
echo i386-pc-mach3
|
477 |
|
|
exit 0 ;;
|
478 |
|
|
paragon:*:*:*)
|
479 |
|
|
echo i860-intel-osf1
|
480 |
|
|
exit 0 ;;
|
481 |
|
|
i860:*:4.*:*) # i860-SVR4
|
482 |
|
|
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
|
483 |
|
|
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
|
484 |
|
|
else # Add other i860-SVR4 vendors below as they are discovered.
|
485 |
|
|
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
|
486 |
|
|
fi
|
487 |
|
|
exit 0 ;;
|
488 |
|
|
mini*:CTIX:SYS*5:*)
|
489 |
|
|
# "miniframe"
|
490 |
|
|
echo m68010-convergent-sysv
|
491 |
|
|
exit 0 ;;
|
492 |
|
|
M68*:*:R3V[567]*:*)
|
493 |
|
|
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
494 |
|
|
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
|
495 |
|
|
OS_REL=''
|
496 |
|
|
test -r /etc/.relid \
|
497 |
|
|
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
498 |
|
|
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
499 |
|
|
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
|
500 |
|
|
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
501 |
|
|
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
|
502 |
|
|
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
503 |
|
|
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
504 |
|
|
&& echo i486-ncr-sysv4 && exit 0 ;;
|
505 |
|
|
m68*:LynxOS:2.*:*)
|
506 |
|
|
echo m68k-unknown-lynxos${UNAME_RELEASE}
|
507 |
|
|
exit 0 ;;
|
508 |
|
|
mc68030:UNIX_System_V:4.*:*)
|
509 |
|
|
echo m68k-atari-sysv4
|
510 |
|
|
exit 0 ;;
|
511 |
|
|
i?86:LynxOS:2.*:*)
|
512 |
|
|
echo i386-unknown-lynxos${UNAME_RELEASE}
|
513 |
|
|
exit 0 ;;
|
514 |
|
|
TSUNAMI:LynxOS:2.*:*)
|
515 |
|
|
echo sparc-unknown-lynxos${UNAME_RELEASE}
|
516 |
|
|
exit 0 ;;
|
517 |
|
|
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
|
518 |
|
|
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
519 |
|
|
exit 0 ;;
|
520 |
|
|
SM[BE]S:UNIX_SV:*:*)
|
521 |
|
|
echo mips-dde-sysv${UNAME_RELEASE}
|
522 |
|
|
exit 0 ;;
|
523 |
|
|
RM*:SINIX-*:*:*)
|
524 |
|
|
echo mips-sni-sysv4
|
525 |
|
|
exit 0 ;;
|
526 |
|
|
*:SINIX-*:*:*)
|
527 |
|
|
if uname -p 2>/dev/null >/dev/null ; then
|
528 |
|
|
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
529 |
|
|
echo ${UNAME_MACHINE}-sni-sysv4
|
530 |
|
|
else
|
531 |
|
|
echo ns32k-sni-sysv
|
532 |
|
|
fi
|
533 |
|
|
exit 0 ;;
|
534 |
|
|
*:UNIX_System_V:4*:FTX*)
|
535 |
|
|
# From Gerald Hewes .
|
536 |
|
|
# How about differentiating between stratus architectures? -djm
|
537 |
|
|
echo hppa1.1-stratus-sysv4
|
538 |
|
|
exit 0 ;;
|
539 |
|
|
*:*:*:FTX*)
|
540 |
|
|
# From seanf@swdc.stratus.com.
|
541 |
|
|
echo i860-stratus-sysv4
|
542 |
|
|
exit 0 ;;
|
543 |
|
|
mc68*:A/UX:*:*)
|
544 |
|
|
echo m68k-apple-aux${UNAME_RELEASE}
|
545 |
|
|
exit 0 ;;
|
546 |
|
|
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
|
547 |
|
|
if [ -d /usr/nec ]; then
|
548 |
|
|
echo mips-nec-sysv${UNAME_RELEASE}
|
549 |
|
|
else
|
550 |
|
|
echo mips-unknown-sysv${UNAME_RELEASE}
|
551 |
|
|
fi
|
552 |
|
|
exit 0 ;;
|
553 |
|
|
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
554 |
|
|
# says
|
555 |
|
|
echo i586-unisys-sysv4
|
556 |
|
|
exit 0 ;;
|
557 |
|
|
esac
|
558 |
|
|
|
559 |
|
|
#echo '(No uname command or uname output not recognized.)' 1>&2
|
560 |
|
|
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
561 |
|
|
|
562 |
|
|
cat >dummy.c <
|
563 |
|
|
#ifdef _SEQUENT_
|
564 |
|
|
# include
|
565 |
|
|
# include
|
566 |
|
|
#endif
|
567 |
|
|
main ()
|
568 |
|
|
{
|
569 |
|
|
#if defined (sony)
|
570 |
|
|
#if defined (MIPSEB)
|
571 |
|
|
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
|
572 |
|
|
I don't know.... */
|
573 |
|
|
printf ("mips-sony-bsd\n"); exit (0);
|
574 |
|
|
#else
|
575 |
|
|
#include
|
576 |
|
|
printf ("m68k-sony-newsos%s\n",
|
577 |
|
|
#ifdef NEWSOS4
|
578 |
|
|
"4"
|
579 |
|
|
#else
|
580 |
|
|
""
|
581 |
|
|
#endif
|
582 |
|
|
); exit (0);
|
583 |
|
|
#endif
|
584 |
|
|
#endif
|
585 |
|
|
|
586 |
|
|
#if defined (__arm) && defined (__acorn) && defined (__unix)
|
587 |
|
|
printf ("arm-acorn-riscix"); exit (0);
|
588 |
|
|
#endif
|
589 |
|
|
|
590 |
|
|
#if defined (hp300) && !defined (hpux)
|
591 |
|
|
printf ("m68k-hp-bsd\n"); exit (0);
|
592 |
|
|
#endif
|
593 |
|
|
|
594 |
|
|
#if defined (NeXT)
|
595 |
|
|
#if !defined (__ARCHITECTURE__)
|
596 |
|
|
#define __ARCHITECTURE__ "m68k"
|
597 |
|
|
#endif
|
598 |
|
|
int version;
|
599 |
|
|
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
600 |
|
|
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
601 |
|
|
exit (0);
|
602 |
|
|
#endif
|
603 |
|
|
|
604 |
|
|
#if defined (MULTIMAX) || defined (n16)
|
605 |
|
|
#if defined (UMAXV)
|
606 |
|
|
printf ("ns32k-encore-sysv\n"); exit (0);
|
607 |
|
|
#else
|
608 |
|
|
#if defined (CMU)
|
609 |
|
|
printf ("ns32k-encore-mach\n"); exit (0);
|
610 |
|
|
#else
|
611 |
|
|
printf ("ns32k-encore-bsd\n"); exit (0);
|
612 |
|
|
#endif
|
613 |
|
|
#endif
|
614 |
|
|
#endif
|
615 |
|
|
|
616 |
|
|
#if defined (__386BSD__)
|
617 |
|
|
printf ("i386-pc-bsd\n"); exit (0);
|
618 |
|
|
#endif
|
619 |
|
|
|
620 |
|
|
#if defined (sequent)
|
621 |
|
|
#if defined (i386)
|
622 |
|
|
printf ("i386-sequent-dynix\n"); exit (0);
|
623 |
|
|
#endif
|
624 |
|
|
#if defined (ns32000)
|
625 |
|
|
printf ("ns32k-sequent-dynix\n"); exit (0);
|
626 |
|
|
#endif
|
627 |
|
|
#endif
|
628 |
|
|
|
629 |
|
|
#if defined (_SEQUENT_)
|
630 |
|
|
struct utsname un;
|
631 |
|
|
|
632 |
|
|
uname(&un);
|
633 |
|
|
|
634 |
|
|
if (strncmp(un.version, "V2", 2) == 0) {
|
635 |
|
|
printf ("i386-sequent-ptx2\n"); exit (0);
|
636 |
|
|
}
|
637 |
|
|
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
|
638 |
|
|
printf ("i386-sequent-ptx1\n"); exit (0);
|
639 |
|
|
}
|
640 |
|
|
printf ("i386-sequent-ptx\n"); exit (0);
|
641 |
|
|
|
642 |
|
|
#endif
|
643 |
|
|
|
644 |
|
|
#if defined (vax)
|
645 |
|
|
#if !defined (ultrix)
|
646 |
|
|
printf ("vax-dec-bsd\n"); exit (0);
|
647 |
|
|
#else
|
648 |
|
|
printf ("vax-dec-ultrix\n"); exit (0);
|
649 |
|
|
#endif
|
650 |
|
|
#endif
|
651 |
|
|
|
652 |
|
|
#if defined (alliant) && defined (i860)
|
653 |
|
|
printf ("i860-alliant-bsd\n"); exit (0);
|
654 |
|
|
#endif
|
655 |
|
|
|
656 |
|
|
exit (1);
|
657 |
|
|
}
|
658 |
|
|
EOF
|
659 |
|
|
|
660 |
|
|
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
|
661 |
|
|
rm -f dummy.c dummy
|
662 |
|
|
|
663 |
|
|
# Apollos put the system type in the environment.
|
664 |
|
|
|
665 |
|
|
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
|
666 |
|
|
|
667 |
|
|
# Convex versions that predate uname can use getsysinfo(1)
|
668 |
|
|
|
669 |
|
|
if [ -x /usr/convex/getsysinfo ]
|
670 |
|
|
then
|
671 |
|
|
case `getsysinfo -f cpu_type` in
|
672 |
|
|
c1*)
|
673 |
|
|
echo c1-convex-bsd
|
674 |
|
|
exit 0 ;;
|
675 |
|
|
c2*)
|
676 |
|
|
if getsysinfo -f scalar_acc
|
677 |
|
|
then echo c32-convex-bsd
|
678 |
|
|
else echo c2-convex-bsd
|
679 |
|
|
fi
|
680 |
|
|
exit 0 ;;
|
681 |
|
|
c34*)
|
682 |
|
|
echo c34-convex-bsd
|
683 |
|
|
exit 0 ;;
|
684 |
|
|
c38*)
|
685 |
|
|
echo c38-convex-bsd
|
686 |
|
|
exit 0 ;;
|
687 |
|
|
c4*)
|
688 |
|
|
echo c4-convex-bsd
|
689 |
|
|
exit 0 ;;
|
690 |
|
|
esac
|
691 |
|
|
fi
|
692 |
|
|
|
693 |
|
|
#echo '(Unable to guess system type)' 1>&2
|
694 |
|
|
|
695 |
|
|
exit 1
|