22
24
# configuration script generated by Autoconf, you may include it under
23
25
# the same distribution terms that you use for the rest of that program.
25
# Written by Per Bothner <bothner@cygnus.com>.
26
# Please send patches to <config-patches@gnu.org>.
27
#####################################################################
28
# This file contains changes for Apache, clearly marked below.
29
# These changes are hereby donated to the public domain.
30
#####################################################################
32
# Originally written by Per Bothner <per@bothner.com>.
33
# Please send patches to <config-patches@gnu.org>. Submit a context
34
# diff and a properly formatted ChangeLog entry.
28
36
# This script attempts to guess a canonical system name similar to
29
37
# config.sub. If it succeeds, it prints the system name on stdout, and
30
38
# exits with 0. Otherwise, it exits with 1.
32
40
# The plan is that this can be called by configure scripts if you
33
# don't specify an explicit system type (host/target name).
35
# Only a few systems have been added to this list; please add others
36
# (but try to keep the structure clean).
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"
44
if test x"$CC" != x; then
41
# don't specify an explicit build system type.
43
me=`echo "$0" | sed -e 's,.*/,,'`
48
Output the configuration name of the system \`$me' is run on.
51
-h, --help print this help, then exit
52
-t, --time-stamp print date of last modification, then exit
53
-v, --version print version number, then exit
55
Report bugs and patches to <config-patches@gnu.org>."
58
GNU config.guess ($timestamp)
60
Originally written by Per Bothner.
61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
62
Free Software Foundation, Inc.
64
This is free software; see the source for copying conditions. There is NO
65
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
68
Try \`$me --help' for more information."
71
while test $# -gt 0 ; do
73
--time-stamp | --time* | -t )
74
echo "$timestamp" ; exit 0 ;;
76
echo "$version" ; exit 0 ;;
78
echo "$usage"; exit 0 ;;
79
-- ) # Stop option processing
81
- ) # Use stdin as input.
84
echo "$me: invalid option $1$help" >&2
92
echo "$me: too many arguments$help" >&2
98
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
100
# CC_FOR_BUILD -- compiler used by this script.
101
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
102
# use `HOST_CC' if defined, but it is deprecated.
104
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
105
,,) echo "int dummy(){}" > $dummy.c ;
106
for c in cc gcc c89 c99 ; do
107
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
108
if test $? = 0 ; then
109
CC_FOR_BUILD="$c"; break ;
112
rm -f $dummy.c $dummy.o $dummy.rel ;
113
if test x"$CC_FOR_BUILD" = x ; then
114
CC_FOR_BUILD=no_compiler_found ;
117
,,*) CC_FOR_BUILD=$CC ;;
118
,*,*) CC_FOR_BUILD=$HOST_CC ;;
53
121
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
54
# (ghazi@noc.rutgers.edu 8/24/94.)
122
# (ghazi@noc.rutgers.edu 1994-08-24)
55
123
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
56
124
PATH=$PATH:/.attbin ; export PATH
59
127
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
60
128
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
61
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
129
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
62
130
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
65
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
67
132
# Note: order is significant - the case branches are not exclusive.
69
134
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
71
# Netbsd (nbsd) targets should (where applicable) match one or
136
# NetBSD (nbsd) targets should (where applicable) match one or
72
137
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
73
138
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
74
139
# switched to ELF, *-*-netbsd* would select the old
75
140
# object file format. This provides both forward
76
141
# compatibility and a consistent mechanism for selecting the
77
142
# object file format.
78
# Determine the machine/vendor (is the vendor relevant).
79
case "${UNAME_MACHINE}" in
80
amiga) machine=m68k-cbm ;;
81
arm32) machine=arm-unknown ;;
82
atari*) machine=m68k-atari ;;
83
sun3*) machine=m68k-sun ;;
84
mac68k) machine=m68k-apple ;;
85
macppc) machine=powerpc-apple ;;
86
hp3[0-9][05]) machine=m68k-hp ;;
87
ibmrt|romp-ibm) machine=romp-ibm ;;
88
*) machine=${UNAME_MACHINE}-unknown ;;
90
# The Operating System including object format.
91
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
92
| grep __ELF__ >/dev/null
94
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
95
# Return netbsd for either. FIX?
144
# Note: NetBSD doesn't particularly care about the vendor
145
# portion of the name. We always set it to "unknown".
146
sysctl="sysctl -n hw.machine_arch"
147
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
148
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
149
case "${UNAME_MACHINE_ARCH}" in
150
arm*) machine=arm-unknown ;;
151
sh3el) machine=shl-unknown ;;
152
sh3eb) machine=sh-unknown ;;
153
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
155
# The Operating System including object format, if it has switched
156
# to ELF recently, or will in the future.
157
case "${UNAME_MACHINE_ARCH}" in
158
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
159
eval $set_cc_for_build
160
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
161
| grep __ELF__ >/dev/null
163
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
164
# Return netbsd for either. FIX?
101
175
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
102
176
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
572
707
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
573
708
echo c4-convex-bsd
579
echo ymp-cray-unicos${UNAME_RELEASE}
711
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
581
713
CRAY*[A-Z]90:*:*:*)
582
714
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
583
715
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
584
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
716
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
587
720
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
723
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
590
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
726
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
593
729
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
596
echo cray2-cray-unicos
598
F300:UNIX_System_V:*:*)
731
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
732
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
599
733
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
600
734
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
601
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
735
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
603
F301:UNIX_System_V:*:*)
604
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
607
echo m68k-unknown-openbsd${UNAME_RELEASE}
609
i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
737
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
610
738
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
612
740
sparc*:BSD/OS:*:*)
646
777
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
780
echo ${UNAME_MACHINE}-pc-minix
783
echo ${UNAME_MACHINE}-unknown-linux-gnu
786
echo ${UNAME_MACHINE}-unknown-linux-gnu
789
echo ${UNAME_MACHINE}-unknown-linux-gnu
792
eval $set_cc_for_build
793
sed 's/^ //' << EOF >$dummy.c
797
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
800
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
807
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
809
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
812
echo powerpc-unknown-linux-gnu
815
echo powerpc64-unknown-linux-gnu
818
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
819
EV5) UNAME_MACHINE=alphaev5 ;;
820
EV56) UNAME_MACHINE=alphaev56 ;;
821
PCA56) UNAME_MACHINE=alphapca56 ;;
822
PCA57) UNAME_MACHINE=alphapca56 ;;
823
EV6) UNAME_MACHINE=alphaev6 ;;
824
EV67) UNAME_MACHINE=alphaev67 ;;
825
EV68*) UNAME_MACHINE=alphaev68 ;;
827
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
828
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
829
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
831
parisc:Linux:*:* | hppa:Linux:*:*)
833
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
834
PA7*) echo hppa1.1-unknown-linux-gnu ;;
835
PA8*) echo hppa2.0-unknown-linux-gnu ;;
836
*) echo hppa-unknown-linux-gnu ;;
839
parisc64:Linux:*:* | hppa64:Linux:*:*)
840
echo hppa64-unknown-linux-gnu
842
s390:Linux:*:* | s390x:Linux:*:*)
843
echo ${UNAME_MACHINE}-ibm-linux
846
echo ${UNAME_MACHINE}-unknown-linux-gnu
848
sparc:Linux:*:* | sparc64:Linux:*:*)
849
echo ${UNAME_MACHINE}-unknown-linux-gnu
852
echo x86_64-unknown-linux-gnu
650
855
# The BFD linker knows what the default object file format is, so
651
856
# first see if it will tell us. cd to the root directory to prevent
652
857
# problems with other programs or directories called `ld' in the path.
653
ld_help_string=`cd /; ld --help 2>&1`
654
ld_supported_emulations=`echo $ld_help_string \
655
| sed -ne '/supported emulations:/!d
858
# Set LC_ALL=C to ensure ld outputs messages in English.
859
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
860
| sed -ne '/supported targets:/!d
657
s/.*supported emulations: *//
862
s/.*supported targets: *//
660
case "$ld_supported_emulations" in
662
echo "${UNAME_MACHINE}-unknown-linux"
865
case "$ld_supported_targets" in
867
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
666
870
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
670
echo "${UNAME_MACHINE}-pc-linux"
674
873
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
678
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
682
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
686
echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
690
echo "${UNAME_MACHINE}-unknown-linux-gnu"
694
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
697
elf32ppc | elf32ppclinux)
698
# Determine Lib Version
700
#include <features.h>
701
#if defined(__GLIBC__)
702
extern char __libc_version[];
703
extern char __libc_release[];
709
#if defined(__GLIBC__)
710
printf("%s %s\n", __libc_version, __libc_release);
718
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
719
if test "$?" = 0 ; then
720
./$dummy | grep 1\.99 > /dev/null
721
if test "$?" = 0 ; then
725
rm -f $dummy.c $dummy
726
echo powerpc-unknown-linux-gnu${LIBC}
876
# Either a pre-BFD a.out linker (linux-gnuoldld) or
877
# one that does not give us useful --help.
878
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
731
if test "${UNAME_MACHINE}" = "alpha" ; then
735
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
742
.frame \$30,16,\$26,0
745
.long 0x47e03d80 # implver \$0
747
.long 0x47e20c21 # amask \$2,\$1
758
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
759
if test "$?" = 0 ; then
762
UNAME_MACHINE="alpha"
765
UNAME_MACHINE="alphaev5"
768
UNAME_MACHINE="alphaev56"
771
UNAME_MACHINE="alphapca56"
774
UNAME_MACHINE="alphaev6"
777
UNAME_MACHINE="alphaev67"
781
objdump --private-headers $dummy | \
782
grep ld.so.1 > /dev/null
783
if test "$?" = 0 ; then
787
rm -f $dummy.s $dummy
788
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
789
elif test "${UNAME_MACHINE}" = "mips" ; then
792
#include <stdio.h> /* for printf() prototype */
793
int main (int argc, char *argv[]) {
795
int main (argc, argv) int argc; char *argv[]; {
798
printf ("%s-unknown-linux-gnu\n", argv[1]);
801
printf ("%sel-unknown-linux-gnu\n", argv[1]);
806
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
807
rm -f $dummy.c $dummy
808
elif test "${UNAME_MACHINE}" = "s390"; then
809
echo s390-ibm-linux && exit 0
811
# Either a pre-BFD a.out linker (linux-gnuoldld)
812
# or one that does not give us useful --help.
813
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
814
# If ld does not provide *any* "supported emulations:"
815
# that means it is gnuoldld.
816
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
817
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
819
case "${UNAME_MACHINE}" in
827
# Determine whether the default compiler is a.out or elf
829
#include <features.h>
831
#include <stdio.h> /* for printf() prototype */
832
int main (int argc, char *argv[]) {
834
int main (argc, argv) int argc; char *argv[]; {
839
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
841
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
844
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
847
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
852
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
853
rm -f $dummy.c $dummy
855
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
856
# are messed up and put the nodename in both sysname and nodename.
881
# Determine whether the default compiler is a.out or elf
882
eval $set_cc_for_build
883
sed 's/^ //' << EOF >$dummy.c
884
#include <features.h>
896
#ifdef __INTEL_COMPILER
903
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
905
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
906
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
909
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
910
# earlier versions are messed up and put the nodename in both
911
# sysname and nodename.
858
912
echo i386-sequent-sysv4
860
i?86:UNIX_SV:4.2MP:2.*)
914
i*86:UNIX_SV:4.2MP:2.*)
861
915
# Unixware is an offshoot of SVR4, but it has its own version
862
916
# number series starting with 2...
863
917
# I am not positive that other SVR4 systems won't match this,
1022
1082
echo `uname -p`-apple-darwin${UNAME_RELEASE}
1024
1084
*:procnto*:*:* | *:QNX:[0123456789]*:*)
1025
if test "${UNAME_MACHINE}" = "x86pc"; then
1085
UNAME_PROCESSOR=`uname -p`
1086
if test "$UNAME_PROCESSOR" = "x86"; then
1087
UNAME_PROCESSOR=i386
1026
1088
UNAME_MACHINE=pc
1028
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1090
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1031
1093
echo i386-pc-qnx
1033
NSR-W:NONSTOP_KERNEL:*:*)
1095
NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
1034
1096
echo nsr-tandem-nsk${UNAME_RELEASE}
1099
echo mips-compaq-nonstopux
1036
1101
BS2000:POSIX*:*:*)
1037
1102
echo bs2000-siemens-sysv
1039
1104
DS/*:UNIX_System_V:*:*)
1040
1105
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1108
# "uname -m" is not consistent, so use $cputype instead. 386
1109
# is converted to i386 for consistency with other x86
1110
# operating systems.
1111
if test "$cputype" = "386"; then
1114
UNAME_MACHINE="$cputype"
1116
echo ${UNAME_MACHINE}-unknown-plan9
1119
# If we were able to find `uname', then EMX Unix compatibility
1120
# is probably installed.
1121
echo ${UNAME_MACHINE}-pc-os2-emx
1124
echo pdp10-unknown-tops10
1127
echo pdp10-unknown-tenex
1129
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1130
echo pdp10-dec-tops20
1132
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1133
echo pdp10-xkl-tops20
1136
echo pdp10-unknown-tops20
1139
echo pdp10-unknown-its
1141
i*86:XTS-300:*:STOP)
1142
echo ${UNAME_MACHINE}-unknown-stop
1145
echo ${UNAME_MACHINE}-unknown-atheos
1044
1149
#echo '(No uname command or uname output not recognized.)' 1>&2
1045
1150
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1152
eval $set_cc_for_build
1047
1153
cat >$dummy.c <<EOF
1048
1154
#ifdef _SEQUENT_
1049
1155
# include <sys/types.h>
1181
#echo '(Unable to guess system type)' 1>&2
1301
$0: unable to guess system type
1303
This script, last modified $timestamp, has failed to recognize
1304
the operating system you are using. It is advised that you
1305
download the most up to date version of the config scripts from
1307
ftp://ftp.gnu.org/pub/gnu/config/
1309
If the version you run ($0) is already up to date, please
1310
send the following data and any information you think might be
1311
pertinent to <config-patches@gnu.org> in order to provide the needed
1312
information to handle your system.
1314
config.guess timestamp = $timestamp
1316
uname -m = `(uname -m) 2>/dev/null || echo unknown`
1317
uname -r = `(uname -r) 2>/dev/null || echo unknown`
1318
uname -s = `(uname -s) 2>/dev/null || echo unknown`
1319
uname -v = `(uname -v) 2>/dev/null || echo unknown`
1321
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1322
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1324
hostinfo = `(hostinfo) 2>/dev/null`
1325
/bin/universe = `(/bin/universe) 2>/dev/null`
1326
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1327
/bin/arch = `(/bin/arch) 2>/dev/null`
1328
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1329
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1331
UNAME_MACHINE = ${UNAME_MACHINE}
1332
UNAME_RELEASE = ${UNAME_RELEASE}
1333
UNAME_SYSTEM = ${UNAME_SYSTEM}
1334
UNAME_VERSION = ${UNAME_VERSION}
1340
# eval: (add-hook 'write-file-hooks 'time-stamp)
1341
# time-stamp-start: "timestamp='"
1342
# time-stamp-format: "%:y-%02m-%02d"
1343
# time-stamp-end: "'"