92
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
94
# CC_FOR_BUILD -- compiler used by this script.
96
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
97
# compiler to aid in system detection is discouraged as it requires
98
# temporary files to be created and, as you can see below, it is a
99
# headache to deal with in a portable fashion.
95
101
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
96
102
# use `HOST_CC' if defined, but it is deprecated.
104
# Portable tmp directory creation inspired by the Autoconf team.
107
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
108
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
110
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
111
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
112
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
113
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
115
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
98
116
case $CC_FOR_BUILD,$HOST_CC,$CC in
99
,,) echo "int dummy(){}" > $dummy.c
100
for c in cc gcc c89 ; do
101
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
102
if test $? = 0 ; then
103
CC_FOR_BUILD="$c"; break
106
rm -f $dummy.c $dummy.o $dummy.rel
117
,,) echo "int x;" > $dummy.c ;
118
for c in cc gcc c89 c99 ; do
119
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
120
CC_FOR_BUILD="$c"; break ;
107
123
if test x"$CC_FOR_BUILD" = x ; then
108
CC_FOR_BUILD=no_compiler_found
124
CC_FOR_BUILD=no_compiler_found ;
111
127
,,*) CC_FOR_BUILD=$CC ;;
112
128
,*,*) CC_FOR_BUILD=$HOST_CC ;;
129
esac ; set_cc_for_build= ;'
115
131
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
116
# (ghazi@noc.rutgers.edu 8/24/94.)
132
# (ghazi@noc.rutgers.edu 1994-08-24)
117
133
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
118
134
PATH=$PATH:/.attbin ; export PATH
128
144
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
130
# Netbsd (nbsd) targets should (where applicable) match one or
146
# NetBSD (nbsd) targets should (where applicable) match one or
131
147
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
132
148
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
133
149
# switched to ELF, *-*-netbsd* would select the old
134
150
# object file format. This provides both forward
135
151
# compatibility and a consistent mechanism for selecting the
136
152
# object file format.
137
# Determine the machine/vendor (is the vendor relevant).
138
case "${UNAME_MACHINE}" in
139
amiga) machine=m68k-unknown ;;
140
arm32) machine=arm-unknown ;;
141
atari*) machine=m68k-atari ;;
142
sun3*) machine=m68k-sun ;;
143
mac68k) machine=m68k-apple ;;
144
macppc) machine=powerpc-apple ;;
145
hp3[0-9][05]) machine=m68k-hp ;;
146
ibmrt|romp-ibm) machine=romp-ibm ;;
147
*) machine=${UNAME_MACHINE}-unknown ;;
154
# Note: NetBSD doesn't particularly care about the vendor
155
# portion of the name. We always set it to "unknown".
156
sysctl="sysctl -n hw.machine_arch"
157
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
158
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
159
case "${UNAME_MACHINE_ARCH}" in
160
armeb) machine=armeb-unknown ;;
161
arm*) machine=arm-unknown ;;
162
sh3el) machine=shl-unknown ;;
163
sh3eb) machine=sh-unknown ;;
164
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
149
166
# The Operating System including object format, if it has switched
150
167
# to ELF recently, or will in the future.
151
case "${UNAME_MACHINE}" in
152
i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
168
case "${UNAME_MACHINE_ARCH}" in
169
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170
eval $set_cc_for_build
153
171
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
154
172
| grep __ELF__ >/dev/null
168
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
186
# Debian GNU/NetBSD machines have a different userland, and
187
# thus, need a distinct triplet. However, they do not need
188
# kernel version information, so it can be replaced with a
189
# suitable tag, in the style of linux-gnu.
190
case "${UNAME_VERSION}" in
195
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
169
198
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
170
199
# contains redundant information, the shorter form:
171
200
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
172
201
echo "${machine}-${os}${release}"
204
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
205
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
208
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
211
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
214
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
217
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
175
if test $UNAME_RELEASE = "V4.0"; then
220
case $UNAME_RELEASE in
176
222
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
225
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
228
# According to Compaq, /usr/sbin/psrinfo has been available on
229
# OSF/1 and Tru64 systems produced since 1995. I hope that
230
# covers most systems running today. This code pipes the CPU
231
# types through head -n 1, so we only detect the type of CPU 0.
232
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
233
case "$ALPHA_CPU_TYPE" in
235
UNAME_MACHINE="alpha" ;;
237
UNAME_MACHINE="alpha" ;;
238
"LCA4 (21066/21068)")
239
UNAME_MACHINE="alpha" ;;
241
UNAME_MACHINE="alphaev5" ;;
243
UNAME_MACHINE="alphaev56" ;;
245
UNAME_MACHINE="alphapca56" ;;
247
UNAME_MACHINE="alphapca57" ;;
249
UNAME_MACHINE="alphaev6" ;;
251
UNAME_MACHINE="alphaev67" ;;
253
UNAME_MACHINE="alphaev68" ;;
255
UNAME_MACHINE="alphaev68" ;;
257
UNAME_MACHINE="alphaev68" ;;
258
"EV6.9A (21264/EV69A)")
259
UNAME_MACHINE="alphaev69" ;;
261
UNAME_MACHINE="alphaev7" ;;
263
UNAME_MACHINE="alphaev79" ;;
265
# A Pn.n version is a patched version.
178
266
# A Vn.n version is a released version.
179
267
# A Tn.n version is a released field test version.
180
268
# A Xn.n version is an unreleased experimental baselevel.
181
269
# 1.2 uses "1.2" for uname -r.
185
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
192
.frame \$30,16,\$26,0
195
.long 0x47e03d80 # implver \$0
197
.long 0x47e20c21 # amask \$2,\$1
207
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
208
if test "$?" = 0 ; then
211
UNAME_MACHINE="alpha"
214
UNAME_MACHINE="alphaev5"
217
UNAME_MACHINE="alphaev56"
220
UNAME_MACHINE="alphapca56"
223
UNAME_MACHINE="alphaev6"
226
UNAME_MACHINE="alphaev67"
230
rm -f $dummy.s $dummy
231
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
270
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
233
272
Alpha\ *:Windows_NT*:*)
234
273
# How do we know it's Interix rather than the generic POSIX subsystem?
235
274
# Should we change UNAME_MACHINE based on the output of uname instead
236
275
# of the specific Alpha model?
237
276
echo alpha-pc-interix
239
278
21064:Windows_NT:50:3)
240
279
echo alpha-dec-winnt3.5
242
281
Amiga*:UNIX_System_V:4.0:*)
243
282
echo m68k-unknown-sysv4
246
echo m68k-unknown-openbsd${UNAME_RELEASE}
248
284
*:[Aa]miga[Oo][Ss]:*:*)
249
285
echo ${UNAME_MACHINE}-unknown-amigaos
252
echo mips64el-unknown-openbsd${UNAME_RELEASE}
255
echo mipsel-unknown-openbsd${UNAME_RELEASE}
258
echo mips-unknown-openbsd${UNAME_RELEASE}
261
echo mipsel-unknown-openbsd${UNAME_RELEASE}
264
echo mips-unknown-openbsd${UNAME_RELEASE}
267
echo mipsel-unknown-openbsd${UNAME_RELEASE}
287
*:[Mm]orph[Oo][Ss]:*:*)
288
echo ${UNAME_MACHINE}-unknown-morphos
270
291
echo i370-ibm-openedition
297
echo powerpc-ibm-os400
272
299
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
273
300
echo arm-acorn-riscix${UNAME_RELEASE}
302
arm:riscos:*:*|arm:RISCOS:*:*)
303
echo arm-unknown-riscos
275
305
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
276
306
echo hppa1.1-hitachi-hiuxmpp
278
308
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
279
309
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
280
310
if test "`(/bin/universe) 2>/dev/null`" = att ; then
342
376
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
343
377
echo m68k-atari-mint${UNAME_RELEASE}
345
379
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
346
380
echo m68k-atari-mint${UNAME_RELEASE}
348
382
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
349
383
echo m68k-atari-mint${UNAME_RELEASE}
351
385
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
352
386
echo m68k-milan-mint${UNAME_RELEASE}
354
388
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
355
389
echo m68k-hades-mint${UNAME_RELEASE}
357
391
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
358
392
echo m68k-unknown-mint${UNAME_RELEASE}
361
echo m68k-unknown-openbsd${UNAME_RELEASE}
364
echo m68k-unknown-openbsd${UNAME_RELEASE}
367
echo m68k-unknown-openbsd${UNAME_RELEASE}
370
echo m88k-unknown-openbsd${UNAME_RELEASE}
395
echo m68k-apple-machten${UNAME_RELEASE}
372
397
powerpc:machten:*:*)
373
398
echo powerpc-apple-machten${UNAME_RELEASE}
376
401
echo mips-dec-mach_bsd4.3
378
403
RISC*:ULTRIX:*:*)
379
404
echo mips-dec-ultrix${UNAME_RELEASE}
381
406
VAX*:ULTRIX*:*:*)
382
407
echo vax-dec-ultrix${UNAME_RELEASE}
384
409
2020:CLIX:*:* | 2430:CLIX:*:*)
385
410
echo clipper-intergraph-clix${UNAME_RELEASE}
387
412
mips:*:*:UMIPS | mips:*:*:RISCos)
413
eval $set_cc_for_build
388
414
sed 's/^ //' << EOF >$dummy.c
389
415
#ifdef __cplusplus
390
416
#include <stdio.h> /* for printf() prototype */
626
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
627
rm -f $dummy.c $dummy
682
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
683
{ echo "$SYSTEM_NAME"; exit; }
628
684
echo unknown-hitachi-hiuxwe2
630
686
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
631
687
echo hppa1.1-hp-bsd
633
689
9000/8??:4.3bsd:*:*)
634
690
echo hppa1.0-hp-bsd
692
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
637
693
echo hppa1.0-hp-mpeix
639
695
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
640
696
echo hppa1.1-hp-osf
643
699
echo hppa1.0-hp-osf
646
702
if [ -x /usr/sbin/sysversion ] ; then
647
703
echo ${UNAME_MACHINE}-unknown-osf1mk
649
705
echo ${UNAME_MACHINE}-unknown-osf1
652
708
parisc*:Lites*:*:*)
653
709
echo hppa1.1-hp-lites
656
echo hppa-unknown-openbsd
658
711
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
659
712
echo c1-convex-bsd
661
714
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
662
715
if getsysinfo -f scalar_acc
663
716
then echo c32-convex-bsd
664
717
else echo c2-convex-bsd
667
720
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
668
721
echo c34-convex-bsd
670
723
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
671
724
echo c38-convex-bsd
673
726
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
674
727
echo c4-convex-bsd
680
echo ymp-cray-unicos${UNAME_RELEASE}
730
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
682
732
CRAY*[A-Z]90:*:*:*)
683
733
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
684
734
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
685
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
735
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
688
739
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
691
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
694
742
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
697
745
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
700
echo cray2-cray-unicos
748
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
702
750
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
703
751
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
704
752
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
705
753
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
706
754
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
709
echo m68k-unknown-openbsd${UNAME_RELEASE}
756
5000:UNIX_System_V:4.*:*)
757
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
758
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
759
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
711
761
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
712
762
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
714
764
sparc*:BSD/OS:*:*)
715
765
echo sparc-unknown-bsdi${UNAME_RELEASE}
718
768
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
721
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
724
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
771
case ${UNAME_MACHINE} in
773
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
775
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
777
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
727
781
echo ${UNAME_MACHINE}-pc-cygwin
730
784
echo ${UNAME_MACHINE}-pc-mingw32
787
# uname -m includes "-pc" on this system.
788
echo ${UNAME_MACHINE}-mingw32
733
791
echo ${UNAME_MACHINE}-pc-pw32
793
x86:Interix*:[3456]*)
794
echo i586-pc-interix${UNAME_RELEASE}
796
EM64T:Interix*:[3456]*)
797
echo x86_64-unknown-interix${UNAME_RELEASE}
799
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
800
echo i${UNAME_MACHINE}-pc-mks
735
802
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
736
803
# How do we know it's Interix rather than the generic POSIX subsystem?
737
804
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
738
805
# UNAME_MACHINE based on the output of uname instead of i386?
742
809
echo ${UNAME_MACHINE}-pc-uwin
811
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
812
echo x86_64-unknown-cygwin
745
815
echo powerpcle-unknown-cygwin
747
817
prep*:SunOS:5.*:*)
748
818
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
751
822
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
825
# other systems with GNU libc and userland
826
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
754
829
echo ${UNAME_MACHINE}-pc-minix
757
832
echo ${UNAME_MACHINE}-unknown-linux-gnu
835
echo ${UNAME_MACHINE}-unknown-linux-gnu
838
echo cris-axis-linux-gnu
841
echo crisv32-axis-linux-gnu
844
echo frv-unknown-linux-gnu
760
echo ${UNAME_MACHINE}-unknown-linux
847
echo ${UNAME_MACHINE}-unknown-linux-gnu
850
echo ${UNAME_MACHINE}-unknown-linux-gnu
763
853
echo ${UNAME_MACHINE}-unknown-linux-gnu
768
#include <stdio.h> /* for printf() prototype */
769
int main (int argc, char *argv[]) {
771
int main (argc, argv) int argc; char *argv[]; {
774
printf ("%s-unknown-linux-gnu\n", argv[1]);
777
printf ("%sel-unknown-linux-gnu\n", argv[1]);
782
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
783
rm -f $dummy.c $dummy
856
eval $set_cc_for_build
857
sed 's/^ //' << EOF >$dummy.c
861
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
864
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
871
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
876
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
879
eval $set_cc_for_build
880
sed 's/^ //' << EOF >$dummy.c
884
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
887
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
894
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
899
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
902
echo or32-unknown-linux-gnu
786
# Determine Lib Version
788
#include <features.h>
789
#if defined(__GLIBC__)
790
extern char __libc_version[];
791
extern char __libc_release[];
797
#if defined(__GLIBC__)
798
printf("%s %s\n", __libc_version, __libc_release);
806
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
807
if test "$?" = 0 ; then
808
./$dummy | grep 1\.99 > /dev/null
809
if test "$?" = 0 ; then LIBC="libc1" ; fi
811
rm -f $dummy.c $dummy
812
echo powerpc-unknown-linux-gnu${LIBC}
905
echo powerpc-unknown-linux-gnu
908
echo powerpc64-unknown-linux-gnu
818
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
824
.frame \$30,16,\$26,0
827
.long 0x47e03d80 # implver \$0
829
.long 0x47e20c21 # amask \$2,\$1
840
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
841
if test "$?" = 0 ; then
843
0-0) UNAME_MACHINE="alpha" ;;
844
1-0) UNAME_MACHINE="alphaev5" ;;
845
1-1) UNAME_MACHINE="alphaev56" ;;
846
1-101) UNAME_MACHINE="alphapca56" ;;
847
2-303) UNAME_MACHINE="alphaev6" ;;
848
2-307) UNAME_MACHINE="alphaev67" ;;
850
objdump --private-headers $dummy | \
851
grep ld.so.1 > /dev/null
852
if test "$?" = 0 ; then
856
rm -f $dummy.s $dummy
911
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
912
EV5) UNAME_MACHINE=alphaev5 ;;
913
EV56) UNAME_MACHINE=alphaev56 ;;
914
PCA56) UNAME_MACHINE=alphapca56 ;;
915
PCA57) UNAME_MACHINE=alphapca56 ;;
916
EV6) UNAME_MACHINE=alphaev6 ;;
917
EV67) UNAME_MACHINE=alphaev67 ;;
918
EV68*) UNAME_MACHINE=alphaev68 ;;
920
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
921
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
857
922
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
859
924
parisc:Linux:*:* | hppa:Linux:*:*)
860
925
# Look for CPU level
861
926
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
863
928
PA8*) echo hppa2.0-unknown-linux-gnu ;;
864
929
*) echo hppa-unknown-linux-gnu ;;
867
932
parisc64:Linux:*:* | hppa64:Linux:*:*)
868
933
echo hppa64-unknown-linux-gnu
870
935
s390:Linux:*:* | s390x:Linux:*:*)
871
936
echo ${UNAME_MACHINE}-ibm-linux
939
echo ${UNAME_MACHINE}-unknown-linux-gnu
874
942
echo ${UNAME_MACHINE}-unknown-linux-gnu
876
944
sparc:Linux:*:* | sparc64:Linux:*:*)
877
945
echo ${UNAME_MACHINE}-unknown-linux-gnu
948
echo ${UNAME_MACHINE}-dec-linux-gnu
879
950
x86_64:Linux:*:*)
880
951
echo x86_64-unknown-linux-gnu
883
954
# The BFD linker knows what the default object file format is, so
884
955
# first see if it will tell us. cd to the root directory to prevent
885
956
# problems with other programs or directories called `ld' in the path.
886
ld_supported_emulations=`cd /; ld --help 2>&1 \
887
| sed -ne '/supported emulations:/!d
957
# Set LC_ALL=C to ensure ld outputs messages in English.
958
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
959
| sed -ne '/supported targets:/!d
889
s/.*supported emulations: *//
961
s/.*supported targets: *//
892
case "$ld_supported_emulations" in
964
case "$ld_supported_targets" in
966
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
894
969
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
898
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
901
972
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
905
# Either a pre-BFD a.out linker (linux-gnuoldld)
906
# or one that does not give us useful --help.
907
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
908
# If ld does not provide *any* "supported emulations:"
909
# that means it is gnuoldld.
910
test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
911
case "${UNAME_MACHINE}" in
975
# Either a pre-BFD a.out linker (linux-gnuoldld) or
976
# one that does not give us useful --help.
977
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
919
980
# Determine whether the default compiler is a.out or elf
921
#include <features.h>
923
#include <stdio.h> /* for printf() prototype */
924
int main (int argc, char *argv[]) {
926
int main (argc, argv) int argc; char *argv[]; {
931
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
933
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
936
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
939
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
981
eval $set_cc_for_build
982
sed 's/^ //' << EOF >$dummy.c
983
#include <features.h>
995
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
944
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
945
rm -f $dummy.c $dummy
946
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
1005
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1010
test x"${LIBC}" != x && {
1011
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1014
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
948
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
949
# are messed up and put the nodename in both sysname and nodename.
950
1016
i*86:DYNIX/ptx:4*:*)
1017
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1018
# earlier versions are messed up and put the nodename in both
1019
# sysname and nodename.
951
1020
echo i386-sequent-sysv4
953
1022
i*86:UNIX_SV:4.2MP:2.*)
954
1023
# Unixware is an offshoot of SVR4, but it has its own version
955
1024
# number series starting with 2...
966
1055
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
970
# Fixed at (any) Pentium or better
972
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
973
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
975
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
1059
# UnixWare 7.x, OpenUNIX and OpenServer 6.
1060
case `/bin/uname -X | grep "^Machine"` in
1061
*486*) UNAME_MACHINE=i486 ;;
1062
*Pentium) UNAME_MACHINE=i586 ;;
1063
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1065
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
979
1068
if test -f /usr/options/cb.name; then
980
1069
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
981
1070
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
982
1071
elif /bin/uname -X 2>/dev/null >/dev/null ; then
983
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
984
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
985
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
1072
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1073
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1074
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
986
1075
&& UNAME_MACHINE=i586
987
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
1076
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
988
1077
&& UNAME_MACHINE=i686
989
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
1078
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
990
1079
&& UNAME_MACHINE=i686
991
1080
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
993
1082
echo ${UNAME_MACHINE}-pc-sysv32
997
echo ${UNAME_MACHINE}-pc-msdosdjgpp
1000
1086
# Left here for compatibility:
1001
1087
# uname -m prints for DJGPP always 'pc', but it prints nothing about
1002
1088
# the processor, so we play safe by assuming i386.
1003
1089
echo i386-pc-msdosdjgpp
1005
1091
Intel:Mach:3*:*)
1006
1092
echo i386-pc-mach3
1009
1095
echo i860-intel-osf1
1011
1097
i860:*:4.*:*) # i860-SVR4
1012
1098
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1013
1099
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1014
1100
else # Add other i860-SVR4 vendors below as they are discovered.
1015
1101
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1018
1104
mini*:CTIX:SYS*5:*)
1020
1106
echo m68010-convergent-sysv
1023
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1024
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
1108
mc68k:UNIX:SYSTEM5:3.51m)
1109
echo m68k-convergent-sysv
1114
M68*:*:R3V[5678]*:*)
1115
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1116
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)
1026
1118
test -r /etc/.relid \
1027
1119
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1028
1120
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1029
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
1121
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1030
1122
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1031
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
1123
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1032
1124
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1033
1125
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1034
&& echo i486-ncr-sysv4 && exit 0 ;;
1126
&& { echo i486-ncr-sysv4; exit; } ;;
1035
1127
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1036
1128
echo m68k-unknown-lynxos${UNAME_RELEASE}
1038
1130
mc68030:UNIX_System_V:4.*:*)
1039
1131
echo m68k-atari-sysv4
1041
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1042
echo i386-unknown-lynxos${UNAME_RELEASE}
1044
1133
TSUNAMI:LynxOS:2.*:*)
1045
1134
echo sparc-unknown-lynxos${UNAME_RELEASE}
1047
1136
rs6000:LynxOS:2.*:*)
1048
1137
echo rs6000-unknown-lynxos${UNAME_RELEASE}
1050
1139
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1051
1140
echo powerpc-unknown-lynxos${UNAME_RELEASE}
1053
1142
SM[BE]S:UNIX_SV:*:*)
1054
1143
echo mips-dde-sysv${UNAME_RELEASE}
1056
1145
RM*:ReliantUNIX-*:*:*)
1057
1146
echo mips-sni-sysv4
1059
1148
RM*:SINIX-*:*:*)
1060
1149
echo mips-sni-sysv4
1063
1152
if uname -p 2>/dev/null >/dev/null ; then
1064
1153
UNAME_MACHINE=`(uname -p) 2>/dev/null`
1067
1156
echo ns32k-sni-sysv
1070
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1071
# says <Richard.M.Bartel@ccMail.Census.GOV>
1159
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1160
# says <Richard.M.Bartel@ccMail.Census.GOV>
1072
1161
echo i586-unisys-sysv4
1074
1163
*:UNIX_System_V:4*:FTX*)
1075
1164
# From Gerald Hewes <hewes@openmarket.com>.
1076
1165
# How about differentiating between stratus architectures? -djm
1077
1166
echo hppa1.1-stratus-sysv4
1080
1169
# From seanf@swdc.stratus.com.
1081
1170
echo i860-stratus-sysv4
1173
# From Paul.Green@stratus.com.
1174
echo ${UNAME_MACHINE}-stratus-vos
1177
# From Paul.Green@stratus.com.
1178
echo hppa1.1-stratus-vos
1083
1180
mc68*:A/UX:*:*)
1084
1181
echo m68k-apple-aux${UNAME_RELEASE}
1086
1183
news*:NEWS-OS:6*:*)
1087
1184
echo mips-sony-newsos6
1089
1186
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1090
1187
if [ -d /usr/nec ]; then
1091
1188
echo mips-nec-sysv${UNAME_RELEASE}
1093
1190
echo mips-unknown-sysv${UNAME_RELEASE}
1096
1193
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1097
1194
echo powerpc-be-beos
1099
1196
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1100
1197
echo powerpc-apple-beos
1102
1199
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1103
1200
echo i586-pc-beos
1105
1202
SX-4:SUPER-UX:*:*)
1106
1203
echo sx4-nec-superux${UNAME_RELEASE}
1108
1205
SX-5:SUPER-UX:*:*)
1109
1206
echo sx5-nec-superux${UNAME_RELEASE}
1209
echo sx6-nec-superux${UNAME_RELEASE}
1111
1211
Power*:Rhapsody:*:*)
1112
1212
echo powerpc-apple-rhapsody${UNAME_RELEASE}
1114
1214
*:Rhapsody:*:*)
1115
1215
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1118
echo `uname -p`-apple-darwin${UNAME_RELEASE}
1218
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1219
case $UNAME_PROCESSOR in
1220
unknown) UNAME_PROCESSOR=powerpc ;;
1222
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1120
1224
*:procnto*:*:* | *:QNX:[0123456789]*:*)
1121
if test "${UNAME_MACHINE}" = "x86pc"; then
1225
UNAME_PROCESSOR=`uname -p`
1226
if test "$UNAME_PROCESSOR" = "x86"; then
1227
UNAME_PROCESSOR=i386
1122
1228
UNAME_MACHINE=pc
1124
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1230
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1127
1233
echo i386-pc-qnx
1129
NSR-[KW]:NONSTOP_KERNEL:*:*)
1235
NSE-?:NONSTOP_KERNEL:*:*)
1236
echo nse-tandem-nsk${UNAME_RELEASE}
1238
NSR-?:NONSTOP_KERNEL:*:*)
1130
1239
echo nsr-tandem-nsk${UNAME_RELEASE}
1132
1241
*:NonStop-UX:*:*)
1133
1242
echo mips-compaq-nonstopux
1135
1244
BS2000:POSIX*:*:*)
1136
1245
echo bs2000-siemens-sysv
1138
1247
DS/*:UNIX_System_V:*:*)
1139
1248
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1142
1251
# "uname -m" is not consistent, so use $cputype instead. 386
1143
1252
# is converted to i386 for consistency with other x86