xref: /minix3/crypto/external/bsd/openssl/dist/config (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ebfedea0SLionel Sambuc#!/bin/sh
2ebfedea0SLionel Sambuc#
3ebfedea0SLionel Sambuc# OpenSSL config: determine the operating system and run ./Configure
4ebfedea0SLionel Sambuc#
5ebfedea0SLionel Sambuc# "config -h" for usage information.
6ebfedea0SLionel Sambuc#
7ebfedea0SLionel Sambuc#          this is a merge of minarch and GuessOS from the Apache Group.
8ebfedea0SLionel Sambuc#          Originally written by Tim Hudson <tjh@cryptsoft.com>.
9ebfedea0SLionel Sambuc
10ebfedea0SLionel Sambuc# Original Apache Group comments on GuessOS
11ebfedea0SLionel Sambuc
12ebfedea0SLionel Sambuc# Simple OS/Platform guesser. Similar to config.guess but
13ebfedea0SLionel Sambuc# much, much smaller. Since it was developed for use with
14ebfedea0SLionel Sambuc# Apache, it follows under Apache's regular licensing
15ebfedea0SLionel Sambuc# with one specific addition: Any changes or additions
16ebfedea0SLionel Sambuc# to this script should be Emailed to the Apache
17ebfedea0SLionel Sambuc# group (apache@apache.org) in general and to
18ebfedea0SLionel Sambuc# Jim Jagielski (jim@jaguNET.com) in specific.
19ebfedea0SLionel Sambuc#
20ebfedea0SLionel Sambuc# Be as similar to the output of config.guess/config.sub
21ebfedea0SLionel Sambuc# as possible.
22ebfedea0SLionel Sambuc
23ebfedea0SLionel SambucPREFIX=""
24ebfedea0SLionel SambucSUFFIX=""
25ebfedea0SLionel SambucTEST="false"
26ebfedea0SLionel SambucEXE=""
27ebfedea0SLionel Sambuc
28ebfedea0SLionel Sambuc# pick up any command line args to config
29ebfedea0SLionel Sambucfor i
30ebfedea0SLionel Sambucdo
31ebfedea0SLionel Sambuccase "$i" in
32ebfedea0SLionel Sambuc-d*) PREFIX="debug-";;
33ebfedea0SLionel Sambuc-t*) TEST="true";;
34ebfedea0SLionel Sambuc-h*) TEST="true"; cat <<EOF
35ebfedea0SLionel SambucUsage: config [options]
36ebfedea0SLionel Sambuc -d	Add a debug- prefix to machine choice.
37ebfedea0SLionel Sambuc -t	Test mode, do not run the Configure perl script.
38ebfedea0SLionel Sambuc -h	This help.
39ebfedea0SLionel Sambuc
40ebfedea0SLionel SambucAny other text will be passed to the Configure perl script.
41ebfedea0SLionel SambucSee INSTALL for instructions.
42ebfedea0SLionel Sambuc
43ebfedea0SLionel SambucEOF
44ebfedea0SLionel Sambuc;;
45ebfedea0SLionel Sambuc*) options=$options" $i" ;;
46ebfedea0SLionel Sambucesac
47ebfedea0SLionel Sambucdone
48ebfedea0SLionel Sambuc
49ebfedea0SLionel Sambuc# First get uname entries that we use below
50ebfedea0SLionel Sambuc
51ebfedea0SLionel Sambuc[ "$MACHINE" ] || MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
52ebfedea0SLionel Sambuc[ "$RELEASE" ] || RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
53ebfedea0SLionel Sambuc[ "$SYSTEM" ] || SYSTEM=`(uname -s) 2>/dev/null`  || SYSTEM="unknown"
54ebfedea0SLionel Sambuc[ "$BUILD" ] || VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
55ebfedea0SLionel Sambuc
56ebfedea0SLionel Sambuc
57ebfedea0SLionel Sambuc# Now test for ISC and SCO, since it is has a braindamaged uname.
58ebfedea0SLionel Sambuc#
59ebfedea0SLionel Sambuc# We need to work around FreeBSD 1.1.5.1
60ebfedea0SLionel Sambuc(
61ebfedea0SLionel SambucXREL=`uname -X 2>/dev/null | grep "^Release" | awk '{print $3}'`
62ebfedea0SLionel Sambucif [ "x$XREL" != "x" ]; then
63ebfedea0SLionel Sambuc    if [ -f /etc/kconfig ]; then
64ebfedea0SLionel Sambuc	case "$XREL" in
65ebfedea0SLionel Sambuc	    4.0|4.1)
66ebfedea0SLionel Sambuc		    echo "${MACHINE}-whatever-isc4"; exit 0
67ebfedea0SLionel Sambuc		;;
68ebfedea0SLionel Sambuc	esac
69ebfedea0SLionel Sambuc    else
70ebfedea0SLionel Sambuc	case "$XREL" in
71ebfedea0SLionel Sambuc	    3.2v4.2)
72ebfedea0SLionel Sambuc		echo "whatever-whatever-sco3"; exit 0
73ebfedea0SLionel Sambuc		;;
74ebfedea0SLionel Sambuc	    3.2v5.0*)
75ebfedea0SLionel Sambuc		echo "whatever-whatever-sco5"; exit 0
76ebfedea0SLionel Sambuc		;;
77ebfedea0SLionel Sambuc	    4.2MP)
78ebfedea0SLionel Sambuc		case "x${VERSION}" in
79ebfedea0SLionel Sambuc		    x2.0*) echo "whatever-whatever-unixware20"; exit 0 ;;
80ebfedea0SLionel Sambuc		    x2.1*) echo "whatever-whatever-unixware21"; exit 0 ;;
81ebfedea0SLionel Sambuc		    x2*)   echo "whatever-whatever-unixware2";  exit 0 ;;
82ebfedea0SLionel Sambuc		esac
83ebfedea0SLionel Sambuc		;;
84ebfedea0SLionel Sambuc	    4.2)
85ebfedea0SLionel Sambuc		echo "whatever-whatever-unixware1"; exit 0
86ebfedea0SLionel Sambuc		;;
87ebfedea0SLionel Sambuc	    5*)
88ebfedea0SLionel Sambuc		case "x${VERSION}" in
89ebfedea0SLionel Sambuc		    # We hardcode i586 in place of ${MACHINE} for the
90ebfedea0SLionel Sambuc		    # following reason. The catch is that even though Pentium
91ebfedea0SLionel Sambuc		    # is minimum requirement for platforms in question,
92ebfedea0SLionel Sambuc		    # ${MACHINE} gets always assigned to i386. Now, problem
93ebfedea0SLionel Sambuc		    # with i386 is that it makes ./config pass 386 to
94ebfedea0SLionel Sambuc		    # ./Configure, which in turn makes make generate
95ebfedea0SLionel Sambuc		    # inefficient SHA-1 (for this moment) code.
96ebfedea0SLionel Sambuc		    x[678]*)  echo "i586-sco-unixware7"; exit 0 ;;
97ebfedea0SLionel Sambuc		esac
98ebfedea0SLionel Sambuc		;;
99ebfedea0SLionel Sambuc	esac
100ebfedea0SLionel Sambuc    fi
101ebfedea0SLionel Sambucfi
102ebfedea0SLionel Sambuc# Now we simply scan though... In most cases, the SYSTEM info is enough
103ebfedea0SLionel Sambuc#
104ebfedea0SLionel Sambuccase "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
105ebfedea0SLionel Sambuc    MPE/iX:*)
106ebfedea0SLionel Sambuc	MACHINE=`echo "$MACHINE" | sed -e 's/-/_/g'`
107ebfedea0SLionel Sambuc	echo "parisc-hp-MPE/iX"; exit 0
108ebfedea0SLionel Sambuc	;;
109ebfedea0SLionel Sambuc    A/UX:*)
110ebfedea0SLionel Sambuc	echo "m68k-apple-aux3"; exit 0
111ebfedea0SLionel Sambuc	;;
112ebfedea0SLionel Sambuc
113ebfedea0SLionel Sambuc    AIX:[3-9]:4:*)
114ebfedea0SLionel Sambuc	echo "${MACHINE}-ibm-aix"; exit 0
115ebfedea0SLionel Sambuc	;;
116ebfedea0SLionel Sambuc
117ebfedea0SLionel Sambuc    AIX:*:[5-9]:*)
118ebfedea0SLionel Sambuc	echo "${MACHINE}-ibm-aix"; exit 0
119ebfedea0SLionel Sambuc	;;
120ebfedea0SLionel Sambuc
121ebfedea0SLionel Sambuc    AIX:*)
122ebfedea0SLionel Sambuc	echo "${MACHINE}-ibm-aix3"; exit 0
123ebfedea0SLionel Sambuc	;;
124ebfedea0SLionel Sambuc
125ebfedea0SLionel Sambuc    BeOS:*:BePC)
126ebfedea0SLionel Sambuc    if [ -e /boot/develop/headers/be/bone ]; then
127ebfedea0SLionel Sambuc		echo "beos-x86-bone"; exit 0
128ebfedea0SLionel Sambuc	else
129ebfedea0SLionel Sambuc		echo "beos-x86-r5"; exit 0
130ebfedea0SLionel Sambuc	fi
131ebfedea0SLionel Sambuc	;;
132ebfedea0SLionel Sambuc
133ebfedea0SLionel Sambuc    dgux:*)
134ebfedea0SLionel Sambuc	echo "${MACHINE}-dg-dgux"; exit 0
135ebfedea0SLionel Sambuc	;;
136ebfedea0SLionel Sambuc
137ebfedea0SLionel Sambuc    HI-UX:*)
138ebfedea0SLionel Sambuc	echo "${MACHINE}-hi-hiux"; exit 0
139ebfedea0SLionel Sambuc	;;
140ebfedea0SLionel Sambuc
141ebfedea0SLionel Sambuc    HP-UX:*)
142ebfedea0SLionel Sambuc	HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
143ebfedea0SLionel Sambuc	case "$HPUXVER" in
144ebfedea0SLionel Sambuc	    1[0-9].*)	# HPUX 10 and 11 targets are unified
145ebfedea0SLionel Sambuc		echo "${MACHINE}-hp-hpux1x"; exit 0
146ebfedea0SLionel Sambuc		;;
147ebfedea0SLionel Sambuc	    *)
148ebfedea0SLionel Sambuc		echo "${MACHINE}-hp-hpux"; exit 0
149ebfedea0SLionel Sambuc		;;
150ebfedea0SLionel Sambuc	esac
151ebfedea0SLionel Sambuc	;;
152ebfedea0SLionel Sambuc
153ebfedea0SLionel Sambuc    IRIX:5.*)
154ebfedea0SLionel Sambuc	echo "mips2-sgi-irix"; exit 0
155ebfedea0SLionel Sambuc	;;
156ebfedea0SLionel Sambuc
157ebfedea0SLionel Sambuc    IRIX:6.*)
158ebfedea0SLionel Sambuc	echo "mips3-sgi-irix"; exit 0
159ebfedea0SLionel Sambuc	;;
160ebfedea0SLionel Sambuc
161ebfedea0SLionel Sambuc    IRIX64:*)
162ebfedea0SLionel Sambuc	echo "mips4-sgi-irix64"; exit 0
163ebfedea0SLionel Sambuc	;;
164ebfedea0SLionel Sambuc
165ebfedea0SLionel Sambuc    Linux:[2-9].*)
166ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-linux2"; exit 0
167ebfedea0SLionel Sambuc	;;
168ebfedea0SLionel Sambuc
169ebfedea0SLionel Sambuc    Linux:1.*)
170ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-linux1"; exit 0
171ebfedea0SLionel Sambuc	;;
172ebfedea0SLionel Sambuc
173ebfedea0SLionel Sambuc    GNU*)
174ebfedea0SLionel Sambuc	echo "hurd-x86"; exit 0;
175ebfedea0SLionel Sambuc	;;
176ebfedea0SLionel Sambuc
177ebfedea0SLionel Sambuc    LynxOS:*)
178ebfedea0SLionel Sambuc	echo "${MACHINE}-lynx-lynxos"; exit 0
179ebfedea0SLionel Sambuc	;;
180ebfedea0SLionel Sambuc
181ebfedea0SLionel Sambuc    BSD/OS:4.*)  # BSD/OS always says 386
182ebfedea0SLionel Sambuc	echo "i486-whatever-bsdi4"; exit 0
183ebfedea0SLionel Sambuc	;;
184ebfedea0SLionel Sambuc
185ebfedea0SLionel Sambuc    BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*)
186ebfedea0SLionel Sambuc        case `/sbin/sysctl -n hw.model` in
187ebfedea0SLionel Sambuc	    Pentium*)
188ebfedea0SLionel Sambuc                echo "i586-whatever-bsdi"; exit 0
189ebfedea0SLionel Sambuc                ;;
190ebfedea0SLionel Sambuc            *)
191ebfedea0SLionel Sambuc                echo "i386-whatever-bsdi"; exit 0
192ebfedea0SLionel Sambuc                ;;
193ebfedea0SLionel Sambuc            esac;
194ebfedea0SLionel Sambuc	;;
195ebfedea0SLionel Sambuc
196ebfedea0SLionel Sambuc    BSD/386:*|BSD/OS:*)
197ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-bsdi"; exit 0
198ebfedea0SLionel Sambuc	;;
199ebfedea0SLionel Sambuc
200ebfedea0SLionel Sambuc    FreeBSD:*:*:*386*)
201ebfedea0SLionel Sambuc        VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'`
202ebfedea0SLionel Sambuc        MACH=`sysctl -n hw.model`
203ebfedea0SLionel Sambuc        ARCH='whatever'
204ebfedea0SLionel Sambuc        case ${MACH} in
205ebfedea0SLionel Sambuc           *386*       ) MACH="i386"     ;;
206ebfedea0SLionel Sambuc           *486*       ) MACH="i486"     ;;
207ebfedea0SLionel Sambuc           Pentium\ II*) MACH="i686"     ;;
208ebfedea0SLionel Sambuc           Pentium*    ) MACH="i586"     ;;
209ebfedea0SLionel Sambuc           *           ) MACH="$MACHINE" ;;
210ebfedea0SLionel Sambuc        esac
211ebfedea0SLionel Sambuc        case ${MACH} in
212ebfedea0SLionel Sambuc           i[0-9]86 ) ARCH="pc" ;;
213ebfedea0SLionel Sambuc        esac
214ebfedea0SLionel Sambuc        echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0
215ebfedea0SLionel Sambuc        ;;
216ebfedea0SLionel Sambuc
217ebfedea0SLionel Sambuc    FreeBSD:*)
218ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-freebsd"; exit 0
219ebfedea0SLionel Sambuc	;;
220ebfedea0SLionel Sambuc
221ebfedea0SLionel Sambuc    NetBSD:*:*:*386*)
222ebfedea0SLionel Sambuc        echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
223ebfedea0SLionel Sambuc	;;
224ebfedea0SLionel Sambuc
225ebfedea0SLionel Sambuc    NetBSD:*)
226ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-netbsd"; exit 0
227ebfedea0SLionel Sambuc	;;
228ebfedea0SLionel Sambuc
229ebfedea0SLionel Sambuc    OpenBSD:*)
230ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-openbsd"; exit 0
231ebfedea0SLionel Sambuc	;;
232ebfedea0SLionel Sambuc
233ebfedea0SLionel Sambuc    OpenUNIX:*)
234ebfedea0SLionel Sambuc	echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
235ebfedea0SLionel Sambuc	;;
236ebfedea0SLionel Sambuc
237ebfedea0SLionel Sambuc    OSF1:*:*:*alpha*)
238ebfedea0SLionel Sambuc	OSFMAJOR=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'`
239ebfedea0SLionel Sambuc	case "$OSFMAJOR" in
240ebfedea0SLionel Sambuc	    4|5)
241ebfedea0SLionel Sambuc		echo "${MACHINE}-dec-tru64"; exit 0
242ebfedea0SLionel Sambuc		;;
243ebfedea0SLionel Sambuc	    1|2|3)
244ebfedea0SLionel Sambuc		echo "${MACHINE}-dec-osf"; exit 0
245ebfedea0SLionel Sambuc		;;
246ebfedea0SLionel Sambuc	    *)
247ebfedea0SLionel Sambuc		echo "${MACHINE}-dec-osf"; exit 0
248ebfedea0SLionel Sambuc		;;
249ebfedea0SLionel Sambuc	esac
250ebfedea0SLionel Sambuc	;;
251ebfedea0SLionel Sambuc
252ebfedea0SLionel Sambuc    QNX:*)
253ebfedea0SLionel Sambuc	case "$RELEASE" in
254ebfedea0SLionel Sambuc	    4*)
255ebfedea0SLionel Sambuc		echo "${MACHINE}-whatever-qnx4"
256ebfedea0SLionel Sambuc		;;
257ebfedea0SLionel Sambuc	    6*)
258ebfedea0SLionel Sambuc		echo "${MACHINE}-whatever-qnx6"
259ebfedea0SLionel Sambuc		;;
260ebfedea0SLionel Sambuc	    *)
261ebfedea0SLionel Sambuc		echo "${MACHINE}-whatever-qnx"
262ebfedea0SLionel Sambuc		;;
263ebfedea0SLionel Sambuc	esac
264ebfedea0SLionel Sambuc	exit 0
265ebfedea0SLionel Sambuc	;;
266ebfedea0SLionel Sambuc
267ebfedea0SLionel Sambuc    Paragon*:*:*:*)
268ebfedea0SLionel Sambuc	echo "i860-intel-osf1"; exit 0
269ebfedea0SLionel Sambuc	;;
270ebfedea0SLionel Sambuc
271ebfedea0SLionel Sambuc    Rhapsody:*)
272ebfedea0SLionel Sambuc	echo "ppc-apple-rhapsody"; exit 0
273ebfedea0SLionel Sambuc	;;
274ebfedea0SLionel Sambuc
275ebfedea0SLionel Sambuc    Darwin:*)
276ebfedea0SLionel Sambuc	case "$MACHINE" in
277ebfedea0SLionel Sambuc	    Power*)
278ebfedea0SLionel Sambuc		echo "ppc-apple-darwin${VERSION}"
279ebfedea0SLionel Sambuc		;;
280ebfedea0SLionel Sambuc	    *)
281ebfedea0SLionel Sambuc		echo "i686-apple-darwin${VERSION}"
282ebfedea0SLionel Sambuc		;;
283ebfedea0SLionel Sambuc	esac
284ebfedea0SLionel Sambuc	exit 0
285ebfedea0SLionel Sambuc	;;
286ebfedea0SLionel Sambuc
287ebfedea0SLionel Sambuc    SunOS:5.*)
288ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-solaris2"; exit 0
289ebfedea0SLionel Sambuc	;;
290ebfedea0SLionel Sambuc
291ebfedea0SLionel Sambuc    SunOS:*)
292ebfedea0SLionel Sambuc	echo "${MACHINE}-sun-sunos4"; exit 0
293ebfedea0SLionel Sambuc	;;
294ebfedea0SLionel Sambuc
295ebfedea0SLionel Sambuc    UNIX_System_V:4.*:*)
296ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-sysv4"; exit 0
297ebfedea0SLionel Sambuc	;;
298ebfedea0SLionel Sambuc
299ebfedea0SLionel Sambuc    VOS:*:*:i786)
300ebfedea0SLionel Sambuc     echo "i386-stratus-vos"; exit 0
301ebfedea0SLionel Sambuc     ;;
302ebfedea0SLionel Sambuc
303ebfedea0SLionel Sambuc    VOS:*:*:*)
304ebfedea0SLionel Sambuc     echo "hppa1.1-stratus-vos"; exit 0
305ebfedea0SLionel Sambuc     ;;
306ebfedea0SLionel Sambuc
307ebfedea0SLionel Sambuc    *:4*:R4*:m88k)
308ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-sysv4"; exit 0
309ebfedea0SLionel Sambuc	;;
310ebfedea0SLionel Sambuc
311ebfedea0SLionel Sambuc    DYNIX/ptx:4*:*)
312ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-sysv4"; exit 0
313ebfedea0SLionel Sambuc	;;
314ebfedea0SLionel Sambuc
315ebfedea0SLionel Sambuc    *:4.0:3.0:3[34]?? | *:4.0:3.0:3[34]??,*)
316ebfedea0SLionel Sambuc	echo "i486-ncr-sysv4"; exit 0
317ebfedea0SLionel Sambuc	;;
318ebfedea0SLionel Sambuc
319ebfedea0SLionel Sambuc    ULTRIX:*)
320ebfedea0SLionel Sambuc	echo "${MACHINE}-unknown-ultrix"; exit 0
321ebfedea0SLionel Sambuc	;;
322ebfedea0SLionel Sambuc
323ebfedea0SLionel Sambuc    SINIX*|ReliantUNIX*)
324ebfedea0SLionel Sambuc	echo "${MACHINE}-siemens-sysv4"; exit 0
325ebfedea0SLionel Sambuc	;;
326ebfedea0SLionel Sambuc
327ebfedea0SLionel Sambuc    POSIX-BC*)
328ebfedea0SLionel Sambuc	echo "${MACHINE}-siemens-sysv4"; exit 0   # Here, $MACHINE == "BS2000"
329ebfedea0SLionel Sambuc	;;
330ebfedea0SLionel Sambuc
331ebfedea0SLionel Sambuc    machten:*)
332ebfedea0SLionel Sambuc       echo "${MACHINE}-tenon-${SYSTEM}"; exit 0;
333ebfedea0SLionel Sambuc       ;;
334ebfedea0SLionel Sambuc
335ebfedea0SLionel Sambuc    library:*)
336ebfedea0SLionel Sambuc	echo "${MACHINE}-ncr-sysv4"; exit 0
337ebfedea0SLionel Sambuc	;;
338ebfedea0SLionel Sambuc
339ebfedea0SLionel Sambuc    ConvexOS:*:11.0:*)
340ebfedea0SLionel Sambuc	echo "${MACHINE}-v11-${SYSTEM}"; exit 0;
341ebfedea0SLionel Sambuc	;;
342ebfedea0SLionel Sambuc
343ebfedea0SLionel Sambuc    NEWS-OS:4.*)
344ebfedea0SLionel Sambuc	echo "mips-sony-newsos4"; exit 0;
345ebfedea0SLionel Sambuc	;;
346ebfedea0SLionel Sambuc
347ebfedea0SLionel Sambuc    MINGW*)
348ebfedea0SLionel Sambuc	echo "${MACHINE}-whatever-mingw"; exit 0;
349ebfedea0SLionel Sambuc	;;
350ebfedea0SLionel Sambuc    CYGWIN*)
351ebfedea0SLionel Sambuc	case "$RELEASE" in
352ebfedea0SLionel Sambuc	    [bB]*|1.0|1.[12].*)
353ebfedea0SLionel Sambuc		echo "${MACHINE}-whatever-cygwin_pre1.3"
354ebfedea0SLionel Sambuc		;;
355ebfedea0SLionel Sambuc	    *)
356ebfedea0SLionel Sambuc		echo "${MACHINE}-whatever-cygwin"
357ebfedea0SLionel Sambuc		;;
358ebfedea0SLionel Sambuc	esac
359ebfedea0SLionel Sambuc	exit 0
360ebfedea0SLionel Sambuc	;;
361ebfedea0SLionel Sambuc
362ebfedea0SLionel Sambuc    *"CRAY T3E")
363ebfedea0SLionel Sambuc       echo "t3e-cray-unicosmk"; exit 0;
364ebfedea0SLionel Sambuc       ;;
365ebfedea0SLionel Sambuc
366ebfedea0SLionel Sambuc    *CRAY*)
367ebfedea0SLionel Sambuc       echo "j90-cray-unicos"; exit 0;
368ebfedea0SLionel Sambuc       ;;
369ebfedea0SLionel Sambuc
370ebfedea0SLionel Sambuc    NONSTOP_KERNEL*)
371ebfedea0SLionel Sambuc       echo "nsr-tandem-nsk"; exit 0;
372ebfedea0SLionel Sambuc       ;;
373ebfedea0SLionel Sambuc
374ebfedea0SLionel Sambuc    vxworks*)
375ebfedea0SLionel Sambuc       echo "${MACHINE}-whatever-vxworks"; exit 0;
376ebfedea0SLionel Sambuc       ;;
377ebfedea0SLionel Sambucesac
378ebfedea0SLionel Sambuc
379ebfedea0SLionel Sambuc#
380ebfedea0SLionel Sambuc# Ugg. These are all we can determine by what we know about
381ebfedea0SLionel Sambuc# the output of uname. Be more creative:
382ebfedea0SLionel Sambuc#
383ebfedea0SLionel Sambuc
384ebfedea0SLionel Sambuc# Do the Apollo stuff first. Here, we just simply assume
385ebfedea0SLionel Sambuc# that the existance of the /usr/apollo directory is proof
386ebfedea0SLionel Sambuc# enough
387ebfedea0SLionel Sambucif [ -d /usr/apollo ]; then
388ebfedea0SLionel Sambuc    echo "whatever-apollo-whatever"
389ebfedea0SLionel Sambuc    exit 0
390ebfedea0SLionel Sambucfi
391ebfedea0SLionel Sambuc
392ebfedea0SLionel Sambuc# Now NeXT
393ebfedea0SLionel SambucISNEXT=`hostinfo 2>/dev/null`
394ebfedea0SLionel Sambuccase "$ISNEXT" in
395ebfedea0SLionel Sambuc    *'NeXT Mach 3.3'*)
396ebfedea0SLionel Sambuc	echo "whatever-next-nextstep3.3"; exit 0
397ebfedea0SLionel Sambuc	;;
398ebfedea0SLionel Sambuc    *NeXT*)
399ebfedea0SLionel Sambuc	echo "whatever-next-nextstep"; exit 0
400ebfedea0SLionel Sambuc	;;
401ebfedea0SLionel Sambucesac
402ebfedea0SLionel Sambuc
403ebfedea0SLionel Sambuc# At this point we gone through all the one's
404ebfedea0SLionel Sambuc# we know of: Punt
405ebfedea0SLionel Sambuc
406ebfedea0SLionel Sambucecho "${MACHINE}-whatever-${SYSTEM}"
407ebfedea0SLionel Sambucexit 0
408ebfedea0SLionel Sambuc) 2>/dev/null | (
409ebfedea0SLionel Sambuc
410ebfedea0SLionel Sambuc# ---------------------------------------------------------------------------
411ebfedea0SLionel Sambuc# this is where the translation occurs into SSLeay terms
412ebfedea0SLionel Sambuc# ---------------------------------------------------------------------------
413ebfedea0SLionel Sambuc
414ebfedea0SLionel Sambuc# Only set CC if not supplied already
415ebfedea0SLionel Sambucif [ -z "$CROSS_COMPILE$CC" ]; then
416ebfedea0SLionel Sambuc  GCCVER=`sh -c "gcc -dumpversion" 2>/dev/null`
417ebfedea0SLionel Sambuc  if [ "$GCCVER" != "" ]; then
418ebfedea0SLionel Sambuc    # then strip off whatever prefix egcs prepends the number with...
419ebfedea0SLionel Sambuc    # Hopefully, this will work for any future prefixes as well.
420ebfedea0SLionel Sambuc    GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
421ebfedea0SLionel Sambuc    # Since gcc 3.1 gcc --version behaviour has changed.  gcc -dumpversion
422ebfedea0SLionel Sambuc    # does give us what we want though, so we use that.  We just just the
423ebfedea0SLionel Sambuc    # major and minor version numbers.
424ebfedea0SLionel Sambuc    # peak single digit before and after first dot, e.g. 2.95.1 gives 29
425ebfedea0SLionel Sambuc    GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
426ebfedea0SLionel Sambuc    CC=gcc
427ebfedea0SLionel Sambuc  else
428ebfedea0SLionel Sambuc    CC=cc
429ebfedea0SLionel Sambuc  fi
430ebfedea0SLionel Sambucfi
431ebfedea0SLionel SambucGCCVER=${GCCVER:-0}
432ebfedea0SLionel Sambucif [ "$SYSTEM" = "HP-UX" ];then
433ebfedea0SLionel Sambuc  # By default gcc is a ILP32 compiler (with long long == 64).
434ebfedea0SLionel Sambuc  GCC_BITS="32"
435ebfedea0SLionel Sambuc  if [ $GCCVER -ge 30 ]; then
436ebfedea0SLionel Sambuc    # PA64 support only came in with gcc 3.0.x.
437ebfedea0SLionel Sambuc    # We check if the preprocessor symbol __LP64__ is defined...
438ebfedea0SLionel Sambuc    if echo "__LP64__" | gcc -v -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null; then
439ebfedea0SLionel Sambuc      : # __LP64__ has slipped through, it therefore is not defined
440ebfedea0SLionel Sambuc    else
441ebfedea0SLionel Sambuc      GCC_BITS="64"
442ebfedea0SLionel Sambuc    fi
443ebfedea0SLionel Sambuc  fi
444ebfedea0SLionel Sambucfi
445ebfedea0SLionel Sambucif [ "$SYSTEM" = "SunOS" ]; then
446ebfedea0SLionel Sambuc  if [ $GCCVER -ge 30 ]; then
447ebfedea0SLionel Sambuc    # 64-bit ABI isn't officially supported in gcc 3.0, but it appears
448ebfedea0SLionel Sambuc    # to be working, at the very least 'make test' passes...
449ebfedea0SLionel Sambuc    if gcc -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then
450ebfedea0SLionel Sambuc      GCC_ARCH="-m64"
451ebfedea0SLionel Sambuc    else
452ebfedea0SLionel Sambuc      GCC_ARCH="-m32"
453ebfedea0SLionel Sambuc    fi
454ebfedea0SLionel Sambuc  fi
455ebfedea0SLionel Sambuc  # check for WorkShop C, expected output is "cc: blah-blah C x.x"
456ebfedea0SLionel Sambuc  CCVER=`(cc -V 2>&1) 2>/dev/null | \
457ebfedea0SLionel Sambuc  	egrep -e '^cc: .* C [0-9]\.[0-9]' | \
458ebfedea0SLionel Sambuc	sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'`
459ebfedea0SLionel Sambuc  CCVER=${CCVER:-0}
460ebfedea0SLionel Sambuc  if [ $MACHINE != i86pc -a $CCVER -gt 40 ]; then
461ebfedea0SLionel Sambuc    CC=cc	# overrides gcc!!!
462ebfedea0SLionel Sambuc    if [ $CCVER -eq 50 ]; then
463ebfedea0SLionel Sambuc      echo "WARNING! Detected WorkShop C 5.0. Do make sure you have"
464ebfedea0SLionel Sambuc      echo "         patch #107357-01 or later applied."
465ebfedea0SLionel Sambuc      sleep 5
466ebfedea0SLionel Sambuc    fi
467ebfedea0SLionel Sambuc  fi
468ebfedea0SLionel Sambucfi
469ebfedea0SLionel Sambuc
470ebfedea0SLionel Sambucif [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
471ebfedea0SLionel Sambuc  # check for Compaq C, expected output is "blah-blah C Vx.x"
472ebfedea0SLionel Sambuc  CCCVER=`(ccc -V 2>&1) 2>/dev/null | \
473ebfedea0SLionel Sambuc	egrep -e '.* C V[0-9]\.[0-9]' | \
474ebfedea0SLionel Sambuc	sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'`
475ebfedea0SLionel Sambuc  CCCVER=${CCCVER:-0}
476ebfedea0SLionel Sambuc  if [ $CCCVER -gt 60 ]; then
477ebfedea0SLionel Sambuc    CC=ccc	# overrides gcc!!! well, ccc outperforms inoticeably
478ebfedea0SLionel Sambuc		# only on hash routines and des, otherwise gcc (2.95)
479ebfedea0SLionel Sambuc		# keeps along rather tight...
480ebfedea0SLionel Sambuc  fi
481ebfedea0SLionel Sambucfi
482ebfedea0SLionel Sambuc
483ebfedea0SLionel Sambucif [ "${SYSTEM}" = "AIX" ]; then	# favor vendor cc over gcc
484ebfedea0SLionel Sambuc    (cc) 2>&1 | grep -iv "not found" > /dev/null && CC=cc
485ebfedea0SLionel Sambucfi
486ebfedea0SLionel Sambuc
487ebfedea0SLionel SambucCCVER=${CCVER:-0}
488ebfedea0SLionel Sambuc
489ebfedea0SLionel Sambuc# read the output of the embedded GuessOS
490ebfedea0SLionel Sambucread GUESSOS
491ebfedea0SLionel Sambuc
492ebfedea0SLionel Sambucecho Operating system: $GUESSOS
493ebfedea0SLionel Sambuc
494ebfedea0SLionel Sambuc# now map the output into SSLeay terms ... really should hack into the
495ebfedea0SLionel Sambuc# script above so we end up with values in vars but that would take
496ebfedea0SLionel Sambuc# more time that I want to waste at the moment
497ebfedea0SLionel Sambuccase "$GUESSOS" in
498ebfedea0SLionel Sambuc  uClinux*64*)
499ebfedea0SLionel Sambuc    OUT=uClinux-dist64
500ebfedea0SLionel Sambuc	;;
501ebfedea0SLionel Sambuc  uClinux*)
502ebfedea0SLionel Sambuc    OUT=uClinux-dist
503ebfedea0SLionel Sambuc	;;
504ebfedea0SLionel Sambuc  mips2-sgi-irix)
505ebfedea0SLionel Sambuc	CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
506ebfedea0SLionel Sambuc	CPU=${CPU:-0}
507ebfedea0SLionel Sambuc	if [ $CPU -ge 4000 ]; then
508ebfedea0SLionel Sambuc		options="$options -mips2"
509ebfedea0SLionel Sambuc	fi
510ebfedea0SLionel Sambuc	OUT="irix-$CC"
511ebfedea0SLionel Sambuc	;;
512ebfedea0SLionel Sambuc  mips3-sgi-irix)
513ebfedea0SLionel Sambuc	#CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
514ebfedea0SLionel Sambuc	#CPU=${CPU:-0}
515ebfedea0SLionel Sambuc	#if [ $CPU -ge 5000 ]; then
516ebfedea0SLionel Sambuc	#	options="$options -mips4"
517ebfedea0SLionel Sambuc	#else
518ebfedea0SLionel Sambuc	#	options="$options -mips3"
519ebfedea0SLionel Sambuc	#fi
520ebfedea0SLionel Sambuc	OUT="irix-mips3-$CC"
521ebfedea0SLionel Sambuc	;;
522ebfedea0SLionel Sambuc  mips4-sgi-irix64)
523ebfedea0SLionel Sambuc	echo "WARNING! If you wish to build 64-bit library, then you have to"
524ebfedea0SLionel Sambuc	echo "         invoke './Configure irix64-mips4-$CC' *manually*."
525ebfedea0SLionel Sambuc	if [ "$TEST" = "false" -a -t 1 ]; then
526ebfedea0SLionel Sambuc	  echo "         You have about 5 seconds to press Ctrl-C to abort."
527ebfedea0SLionel Sambuc	  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
528ebfedea0SLionel Sambuc	fi
529ebfedea0SLionel Sambuc        #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
530ebfedea0SLionel Sambuc        #CPU=${CPU:-0}
531ebfedea0SLionel Sambuc        #if [ $CPU -ge 5000 ]; then
532ebfedea0SLionel Sambuc        #        options="$options -mips4"
533ebfedea0SLionel Sambuc        #else
534ebfedea0SLionel Sambuc        #        options="$options -mips3"
535ebfedea0SLionel Sambuc        #fi
536ebfedea0SLionel Sambuc	OUT="irix-mips3-$CC"
537ebfedea0SLionel Sambuc	;;
538ebfedea0SLionel Sambuc  ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
539ebfedea0SLionel Sambuc  ppc-apple-darwin*)
540ebfedea0SLionel Sambuc	ISA64=`(sysctl -n hw.optional.64bitops) 2>/dev/null`
541ebfedea0SLionel Sambuc	if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
542ebfedea0SLionel Sambuc	    echo "WARNING! If you wish to build 64-bit library, then you have to"
543ebfedea0SLionel Sambuc	    echo "         invoke './Configure darwin64-ppc-cc' *manually*."
544ebfedea0SLionel Sambuc	    if [ "$TEST" = "false" -a -t 1 ]; then
545ebfedea0SLionel Sambuc	      echo "         You have about 5 seconds to press Ctrl-C to abort."
546ebfedea0SLionel Sambuc	      (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
547ebfedea0SLionel Sambuc	    fi
548ebfedea0SLionel Sambuc	fi
549ebfedea0SLionel Sambuc	if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
550ebfedea0SLionel Sambuc	    OUT="darwin64-ppc-cc"
551ebfedea0SLionel Sambuc	else
552ebfedea0SLionel Sambuc	    OUT="darwin-ppc-cc"
553ebfedea0SLionel Sambuc	fi ;;
554ebfedea0SLionel Sambuc  i?86-apple-darwin*)
555ebfedea0SLionel Sambuc	ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null`
556ebfedea0SLionel Sambuc	if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
557ebfedea0SLionel Sambuc	    echo "WARNING! If you wish to build 64-bit library, then you have to"
558ebfedea0SLionel Sambuc	    echo "         invoke './Configure darwin64-x86_64-cc' *manually*."
559ebfedea0SLionel Sambuc	    if [ "$TEST" = "false" -a -t 1 ]; then
560ebfedea0SLionel Sambuc	      echo "         You have about 5 seconds to press Ctrl-C to abort."
561ebfedea0SLionel Sambuc	      (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
562ebfedea0SLionel Sambuc	    fi
563ebfedea0SLionel Sambuc	fi
564ebfedea0SLionel Sambuc	if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
565ebfedea0SLionel Sambuc	    OUT="darwin64-x86_64-cc"
566ebfedea0SLionel Sambuc	else
567ebfedea0SLionel Sambuc	    OUT="darwin-i386-cc"
568ebfedea0SLionel Sambuc	fi ;;
569ebfedea0SLionel Sambuc  armv6+7-*-iphoneos)
570ebfedea0SLionel Sambuc	options="$options -arch%20armv6 -arch%20armv7"
571ebfedea0SLionel Sambuc	OUT="iphoneos-cross" ;;
572ebfedea0SLionel Sambuc  *-*-iphoneos)
573ebfedea0SLionel Sambuc	options="$options -arch%20${MACHINE}"
574ebfedea0SLionel Sambuc	OUT="iphoneos-cross" ;;
575ebfedea0SLionel Sambuc  alpha-*-linux2)
576ebfedea0SLionel Sambuc        ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
577ebfedea0SLionel Sambuc	case ${ISA:-generic} in
578ebfedea0SLionel Sambuc	*[678])	OUT="linux-alpha+bwx-$CC" ;;
579ebfedea0SLionel Sambuc	*)	OUT="linux-alpha-$CC" ;;
580ebfedea0SLionel Sambuc	esac
581ebfedea0SLionel Sambuc	if [ "$CC" = "gcc" ]; then
582ebfedea0SLionel Sambuc	    case ${ISA:-generic} in
583ebfedea0SLionel Sambuc	    EV5|EV45)		options="$options -mcpu=ev5";;
584ebfedea0SLionel Sambuc	    EV56|PCA56)		options="$options -mcpu=ev56";;
585ebfedea0SLionel Sambuc	    *)			options="$options -mcpu=ev6";;
586ebfedea0SLionel Sambuc	    esac
587ebfedea0SLionel Sambuc	fi
588ebfedea0SLionel Sambuc	;;
589ebfedea0SLionel Sambuc  ppc64-*-linux2)
590ebfedea0SLionel Sambuc	echo "WARNING! If you wish to build 64-bit library, then you have to"
591ebfedea0SLionel Sambuc	echo "         invoke './Configure linux-ppc64' *manually*."
592ebfedea0SLionel Sambuc	if [ "$TEST" = "false" -a -t 1 ]; then
593ebfedea0SLionel Sambuc	    echo "         You have about 5 seconds to press Ctrl-C to abort."
594ebfedea0SLionel Sambuc	    (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
595ebfedea0SLionel Sambuc	fi
596ebfedea0SLionel Sambuc	OUT="linux-ppc"
597ebfedea0SLionel Sambuc	;;
598ebfedea0SLionel Sambuc  ppc-*-linux2) OUT="linux-ppc" ;;
599ebfedea0SLionel Sambuc  ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;;
600ebfedea0SLionel Sambuc  ppcgen-*-vxworks*) OUT="vxworks-ppcgen" ;;
601ebfedea0SLionel Sambuc  pentium-*-vxworks*) OUT="vxworks-pentium" ;;
602ebfedea0SLionel Sambuc  simlinux-*-vxworks*) OUT="vxworks-simlinux" ;;
603ebfedea0SLionel Sambuc  mips-*-vxworks*) OUT="vxworks-mips";;
604ebfedea0SLionel Sambuc  ia64-*-linux?) OUT="linux-ia64" ;;
605ebfedea0SLionel Sambuc  sparc64-*-linux2)
606ebfedea0SLionel Sambuc	echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
607ebfedea0SLionel Sambuc	echo "         and wish to build 64-bit library, then you have to"
608ebfedea0SLionel Sambuc	echo "         invoke './Configure linux64-sparcv9' *manually*."
609ebfedea0SLionel Sambuc	if [ "$TEST" = "false" -a -t 1 ]; then
610ebfedea0SLionel Sambuc	  echo "          You have about 5 seconds to press Ctrl-C to abort."
611ebfedea0SLionel Sambuc	  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
612ebfedea0SLionel Sambuc	fi
613ebfedea0SLionel Sambuc	OUT="linux-sparcv9" ;;
614ebfedea0SLionel Sambuc  sparc-*-linux2)
615ebfedea0SLionel Sambuc	KARCH=`awk '/^type/{print$3;exit(0);}' /proc/cpuinfo`
616ebfedea0SLionel Sambuc	case ${KARCH:-sun4} in
617ebfedea0SLionel Sambuc	sun4u*)	OUT="linux-sparcv9" ;;
618ebfedea0SLionel Sambuc	sun4m)	OUT="linux-sparcv8" ;;
619ebfedea0SLionel Sambuc	sun4d)	OUT="linux-sparcv8" ;;
620ebfedea0SLionel Sambuc	*)	OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
621ebfedea0SLionel Sambuc	esac ;;
622ebfedea0SLionel Sambuc  parisc*-*-linux2)
623ebfedea0SLionel Sambuc	# 64-bit builds under parisc64 linux are not supported and
624ebfedea0SLionel Sambuc	# compiler is expected to generate 32-bit objects...
625ebfedea0SLionel Sambuc	CPUARCH=`awk '/cpu family/{print substr($5,1,3); exit(0);}' /proc/cpuinfo`
626ebfedea0SLionel Sambuc	CPUSCHEDULE=`awk '/^cpu.[ 	]*: PA/{print substr($3,3); exit(0);}' /proc/cpuinfo`
627ebfedea0SLionel Sambuc
628ebfedea0SLionel Sambuc	# ??TODO ??  Model transformations
629ebfedea0SLionel Sambuc	# 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
630ebfedea0SLionel Sambuc	#    assuming no further arch. identification will ever be used by GCC.
631ebfedea0SLionel Sambuc	# 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
632ebfedea0SLionel Sambuc	# 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
633ebfedea0SLionel Sambuc	#    for these chips in the future.
634ebfedea0SLionel Sambuc	#         PA7300LC -> 7100LC (1.1)
635ebfedea0SLionel Sambuc	#         PA8200   -> 8000   (2.0)
636ebfedea0SLionel Sambuc	#         PA8500   -> 8000   (2.0)
637ebfedea0SLionel Sambuc	#         PA8600   -> 8000   (2.0)
638ebfedea0SLionel Sambuc
639ebfedea0SLionel Sambuc	CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8.00/8000/'`
640ebfedea0SLionel Sambuc	# Finish Model transformations
641ebfedea0SLionel Sambuc
642ebfedea0SLionel Sambuc	options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
643ebfedea0SLionel Sambuc	OUT="linux-generic32" ;;
644ebfedea0SLionel Sambuc  armv[1-3]*-*-linux2) OUT="linux-generic32" ;;
645ebfedea0SLionel Sambuc  armv[7-9]*-*-linux2) OUT="linux-armv4"; options="$options -march=armv7-a" ;;
646ebfedea0SLionel Sambuc  arm*-*-linux2) OUT="linux-armv4" ;;
647ebfedea0SLionel Sambuc  sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
648ebfedea0SLionel Sambuc  sh*-*-linux2)  OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
649ebfedea0SLionel Sambuc  m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
650ebfedea0SLionel Sambuc  s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
651ebfedea0SLionel Sambuc  s390x-*-linux2)
652ebfedea0SLionel Sambuc	# To be uncommented when glibc bug is fixed, see Configure...
653ebfedea0SLionel Sambuc	#if egrep -e '^features.* highgprs' /proc/cpuinfo >/dev/null ; then
654ebfedea0SLionel Sambuc	#  echo "WARNING! If you wish to build \"highgprs\" 32-bit library, then you"
655ebfedea0SLionel Sambuc	#  echo "         have to invoke './Configure linux32-s390x' *manually*."
656ebfedea0SLionel Sambuc	#  if [ "$TEST" = "false" -a -t -1 ]; then
657ebfedea0SLionel Sambuc	#    echo "         You have about 5 seconds to press Ctrl-C to abort."
658ebfedea0SLionel Sambuc	#    (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
659ebfedea0SLionel Sambuc	#  fi
660ebfedea0SLionel Sambuc	#fi
661ebfedea0SLionel Sambuc	OUT="linux64-s390x"
662ebfedea0SLionel Sambuc	;;
663ebfedea0SLionel Sambuc  x86_64-*-linux?) OUT="linux-x86_64" ;;
664ebfedea0SLionel Sambuc  *86-*-linux2) OUT="linux-elf"
665ebfedea0SLionel Sambuc	if [ "$GCCVER" -gt 28 ]; then
666ebfedea0SLionel Sambuc          if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
667ebfedea0SLionel Sambuc	    options="$options -march=pentium"
668ebfedea0SLionel Sambuc          fi
669ebfedea0SLionel Sambuc          if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then
670ebfedea0SLionel Sambuc	    options="$options -march=pentiumpro"
671ebfedea0SLionel Sambuc          fi
672ebfedea0SLionel Sambuc          if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then
673ebfedea0SLionel Sambuc	    options="$options -march=k6"
674ebfedea0SLionel Sambuc          fi
675ebfedea0SLionel Sambuc        fi ;;
676ebfedea0SLionel Sambuc  *-*-linux1) OUT="linux-aout" ;;
677ebfedea0SLionel Sambuc  *-*-linux2) OUT="linux-generic32" ;;
678ebfedea0SLionel Sambuc  sun4[uv]*-*-solaris2)
679ebfedea0SLionel Sambuc	OUT="solaris-sparcv9-$CC"
680ebfedea0SLionel Sambuc	ISA64=`(isalist) 2>/dev/null | grep sparcv9`
681ebfedea0SLionel Sambuc	if [ "$ISA64" != "" -a "$KERNEL_BITS" = "" ]; then
682ebfedea0SLionel Sambuc	    if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
683ebfedea0SLionel Sambuc		echo "WARNING! If you wish to build 64-bit library, then you have to"
684ebfedea0SLionel Sambuc		echo "         invoke './Configure solaris64-sparcv9-cc' *manually*."
685ebfedea0SLionel Sambuc		if [ "$TEST" = "false" -a -t 1 ]; then
686ebfedea0SLionel Sambuc		  echo "         You have about 5 seconds to press Ctrl-C to abort."
687ebfedea0SLionel Sambuc		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
688ebfedea0SLionel Sambuc		fi
689ebfedea0SLionel Sambuc	    elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
690ebfedea0SLionel Sambuc		# $GCC_ARCH denotes default ABI chosen by compiler driver
691ebfedea0SLionel Sambuc		# (first one found on the $PATH). I assume that user
692ebfedea0SLionel Sambuc		# expects certain consistency with the rest of his builds
693ebfedea0SLionel Sambuc		# and therefore switch over to 64-bit. <appro>
694ebfedea0SLionel Sambuc		OUT="solaris64-sparcv9-gcc"
695ebfedea0SLionel Sambuc		echo "WARNING! If you wish to build 32-bit library, then you have to"
696ebfedea0SLionel Sambuc		echo "         invoke './Configure solaris-sparcv9-gcc' *manually*."
697ebfedea0SLionel Sambuc		if [ "$TEST" = "false" -a -t 1 ]; then
698ebfedea0SLionel Sambuc		  echo "         You have about 5 seconds to press Ctrl-C to abort."
699ebfedea0SLionel Sambuc		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
700ebfedea0SLionel Sambuc		fi
701ebfedea0SLionel Sambuc	    elif [ "$GCC_ARCH" = "-m32" ]; then
702ebfedea0SLionel Sambuc		echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
703ebfedea0SLionel Sambuc		echo "        and wish to build 64-bit library, then you have to"
704ebfedea0SLionel Sambuc		echo "        invoke './Configure solaris64-sparcv9-gcc' *manually*."
705ebfedea0SLionel Sambuc		if [ "$TEST" = "false" -a -t 1 ]; then
706ebfedea0SLionel Sambuc		  echo "         You have about 5 seconds to press Ctrl-C to abort."
707ebfedea0SLionel Sambuc		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
708ebfedea0SLionel Sambuc		fi
709ebfedea0SLionel Sambuc	    fi
710ebfedea0SLionel Sambuc	fi
711ebfedea0SLionel Sambuc	if [ "$ISA64" != "" -a "$KERNEL_BITS" = "64" ]; then
712ebfedea0SLionel Sambuc	    OUT="solaris64-sparcv9-$CC"
713ebfedea0SLionel Sambuc	fi
714ebfedea0SLionel Sambuc	;;
715ebfedea0SLionel Sambuc  sun4m-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
716ebfedea0SLionel Sambuc  sun4d-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
717ebfedea0SLionel Sambuc  sun4*-*-solaris2)	OUT="solaris-sparcv7-$CC" ;;
718ebfedea0SLionel Sambuc  *86*-*-solaris2)
719ebfedea0SLionel Sambuc	ISA64=`(isalist) 2>/dev/null | grep amd64`
720ebfedea0SLionel Sambuc	if [ "$ISA64" != "" -a ${KERNEL_BITS:-64} -eq 64 ]; then
721ebfedea0SLionel Sambuc	    OUT="solaris64-x86_64-$CC"
722ebfedea0SLionel Sambuc	else
723ebfedea0SLionel Sambuc	    OUT="solaris-x86-$CC"
724ebfedea0SLionel Sambuc	    if [ `uname -r | sed -e 's/5\.//'` -lt 10 ]; then
725ebfedea0SLionel Sambuc		options="$options no-sse2"
726ebfedea0SLionel Sambuc	    fi
727ebfedea0SLionel Sambuc	fi
728ebfedea0SLionel Sambuc	;;
729ebfedea0SLionel Sambuc  *-*-sunos4)		OUT="sunos-$CC" ;;
730ebfedea0SLionel Sambuc
731ebfedea0SLionel Sambuc  *86*-*-bsdi4)		OUT="BSD-x86-elf"; options="$options no-sse2 -ldl" ;;
732ebfedea0SLionel Sambuc  alpha*-*-*bsd*)	OUT="BSD-generic64"; options="$options -DL_ENDIAN" ;;
733ebfedea0SLionel Sambuc  powerpc64-*-*bsd*)	OUT="BSD-generic64"; options="$options -DB_ENDIAN" ;;
734ebfedea0SLionel Sambuc  sparc64-*-*bsd*)	OUT="BSD-sparc64" ;;
735ebfedea0SLionel Sambuc  ia64-*-*bsd*)		OUT="BSD-ia64" ;;
736ebfedea0SLionel Sambuc  amd64-*-*bsd*)	OUT="BSD-x86_64" ;;
737ebfedea0SLionel Sambuc  *86*-*-*bsd*)		# mimic ld behaviour when it's looking for libc...
738ebfedea0SLionel Sambuc			if [ -L /usr/lib/libc.so ]; then	# [Free|Net]BSD
739ebfedea0SLionel Sambuc			    libc=/usr/lib/libc.so
740ebfedea0SLionel Sambuc			else					# OpenBSD
741ebfedea0SLionel Sambuc			    # ld searches for highest libc.so.* and so do we
742*0a6a1f1dSLionel Sambuc			    libc=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`
743ebfedea0SLionel Sambuc			fi
744ebfedea0SLionel Sambuc			case "`(file -L $libc) 2>/dev/null`" in
745ebfedea0SLionel Sambuc			*ELF*)	OUT="BSD-x86-elf" ;;
746ebfedea0SLionel Sambuc			*)	OUT="BSD-x86"; options="$options no-sse2" ;;
747ebfedea0SLionel Sambuc			esac ;;
748ebfedea0SLionel Sambuc  *-*-*bsd*)		OUT="BSD-generic32" ;;
749ebfedea0SLionel Sambuc
750ebfedea0SLionel Sambuc  *-*-osf)		OUT="osf1-alpha-cc" ;;
751ebfedea0SLionel Sambuc  *-*-tru64)		OUT="tru64-alpha-cc" ;;
752ebfedea0SLionel Sambuc  *-*-[Uu]nix[Ww]are7)
753ebfedea0SLionel Sambuc	if [ "$CC" = "gcc" ]; then
754ebfedea0SLionel Sambuc	  OUT="unixware-7-gcc" ; options="$options no-sse2"
755ebfedea0SLionel Sambuc	else
756ebfedea0SLionel Sambuc	  OUT="unixware-7" ; options="$options no-sse2 -D__i386__"
757ebfedea0SLionel Sambuc	fi
758ebfedea0SLionel Sambuc	;;
759ebfedea0SLionel Sambuc  *-*-[Uu]nix[Ww]are20*) OUT="unixware-2.0"; options="$options no-sse2 no-sha512" ;;
760ebfedea0SLionel Sambuc  *-*-[Uu]nix[Ww]are21*) OUT="unixware-2.1"; options="$options no-sse2 no-sha512" ;;
761ebfedea0SLionel Sambuc  *-*-vos)
762ebfedea0SLionel Sambuc	options="$options no-threads no-shared no-asm no-dso"
763ebfedea0SLionel Sambuc	EXE=".pm"
764ebfedea0SLionel Sambuc	OUT="vos-$CC" ;;
765ebfedea0SLionel Sambuc  BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
766ebfedea0SLionel Sambuc  RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
767ebfedea0SLionel Sambuc  *-siemens-sysv4) OUT="SINIX" ;;
768ebfedea0SLionel Sambuc  *-hpux1*)
769ebfedea0SLionel Sambuc	if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
770ebfedea0SLionel Sambuc	    OUT="hpux64-parisc2-gcc"
771ebfedea0SLionel Sambuc	fi
772ebfedea0SLionel Sambuc	[ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
773ebfedea0SLionel Sambuc	KERNEL_BITS=${KERNEL_BITS:-32}
774ebfedea0SLionel Sambuc	CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null`
775ebfedea0SLionel Sambuc	CPU_VERSION=${CPU_VERSION:-0}
776ebfedea0SLionel Sambuc	# See <sys/unistd.h> for further info on CPU_VERSION.
777ebfedea0SLionel Sambuc	if   [ $CPU_VERSION -ge 768 ]; then	# IA-64 CPU
778ebfedea0SLionel Sambuc	     if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
779ebfedea0SLionel Sambuc	        OUT="hpux64-ia64-cc"
780ebfedea0SLionel Sambuc             else
781ebfedea0SLionel Sambuc	        OUT="hpux-ia64-cc"
782ebfedea0SLionel Sambuc             fi
783ebfedea0SLionel Sambuc	elif [ $CPU_VERSION -ge 532 ]; then	# PA-RISC 2.x CPU
784ebfedea0SLionel Sambuc	     OUT=${OUT:-"hpux-parisc2-${CC}"}
785ebfedea0SLionel Sambuc	     if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
786ebfedea0SLionel Sambuc		echo "WARNING! If you wish to build 64-bit library then you have to"
787ebfedea0SLionel Sambuc		echo "         invoke './Configure hpux64-parisc2-cc' *manually*."
788ebfedea0SLionel Sambuc		if [ "$TEST" = "false" -a -t 1 ]; then
789ebfedea0SLionel Sambuc		  echo "         You have about 5 seconds to press Ctrl-C to abort."
790ebfedea0SLionel Sambuc		  (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
791ebfedea0SLionel Sambuc		fi
792ebfedea0SLionel Sambuc	     fi
793ebfedea0SLionel Sambuc	elif [ $CPU_VERSION -ge 528 ]; then	# PA-RISC 1.1+ CPU
794ebfedea0SLionel Sambuc	     OUT="hpux-parisc-${CC}"
795ebfedea0SLionel Sambuc	elif [ $CPU_VERSION -ge 523 ]; then	# PA-RISC 1.0 CPU
796ebfedea0SLionel Sambuc	     OUT="hpux-parisc-${CC}"
797ebfedea0SLionel Sambuc	else					# Motorola(?) CPU
798ebfedea0SLionel Sambuc	     OUT="hpux-$CC"
799ebfedea0SLionel Sambuc	fi
800ebfedea0SLionel Sambuc	options="$options -D_REENTRANT" ;;
801ebfedea0SLionel Sambuc  *-hpux)	OUT="hpux-parisc-$CC" ;;
802ebfedea0SLionel Sambuc  *-aix)
803ebfedea0SLionel Sambuc	[ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
804ebfedea0SLionel Sambuc	KERNEL_BITS=${KERNEL_BITS:-32}
805ebfedea0SLionel Sambuc	OBJECT_MODE=${OBJECT_MODE:-32}
806ebfedea0SLionel Sambuc	if [ "$CC" = "gcc" ]; then
807ebfedea0SLionel Sambuc	    OUT="aix-gcc"
808ebfedea0SLionel Sambuc          if [ $OBJECT_MODE -eq 64 ]; then
809ebfedea0SLionel Sambuc            echo 'Your $OBJECT_MODE was found to be set to 64'
810ebfedea0SLionel Sambuc            OUT="aix64-gcc"
811ebfedea0SLionel Sambuc          fi
812ebfedea0SLionel Sambuc	elif [ $OBJECT_MODE -eq 64 ]; then
813ebfedea0SLionel Sambuc	    echo 'Your $OBJECT_MODE was found to be set to 64'
814ebfedea0SLionel Sambuc	    OUT="aix64-cc"
815ebfedea0SLionel Sambuc	else
816ebfedea0SLionel Sambuc	    OUT="aix-cc"
817ebfedea0SLionel Sambuc	    if [ $KERNEL_BITS -eq 64 ]; then
818ebfedea0SLionel Sambuc		echo "WARNING! If you wish to build 64-bit kit, then you have to"
819ebfedea0SLionel Sambuc		echo "         invoke './Configure aix64-cc' *manually*."
820ebfedea0SLionel Sambuc		if [ "$TEST" = "false" -a -t 1 ]; then
821ebfedea0SLionel Sambuc		    echo "         You have ~5 seconds to press Ctrl-C to abort."
822ebfedea0SLionel Sambuc		    (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
823ebfedea0SLionel Sambuc		fi
824ebfedea0SLionel Sambuc	    fi
825ebfedea0SLionel Sambuc	fi
826ebfedea0SLionel Sambuc	if (lsattr -E -O -l `lsdev -c processor|awk '{print$1;exit}'` | grep -i powerpc) >/dev/null 2>&1; then
827ebfedea0SLionel Sambuc	    :	# this applies even to Power3 and later, as they return PowerPC_POWER[345]
828ebfedea0SLionel Sambuc	else
829ebfedea0SLionel Sambuc	    options="$options no-asm"
830ebfedea0SLionel Sambuc	fi
831ebfedea0SLionel Sambuc	;;
832ebfedea0SLionel Sambuc  # these are all covered by the catchall below
833ebfedea0SLionel Sambuc  # *-dgux) OUT="dgux" ;;
834ebfedea0SLionel Sambuc  mips-sony-newsos4) OUT="newsos4-gcc" ;;
835ebfedea0SLionel Sambuc  *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
836ebfedea0SLionel Sambuc  *-*-cygwin) OUT="Cygwin" ;;
837ebfedea0SLionel Sambuc  t3e-cray-unicosmk) OUT="cray-t3e" ;;
838ebfedea0SLionel Sambuc  j90-cray-unicos) OUT="cray-j90" ;;
839ebfedea0SLionel Sambuc  nsr-tandem-nsk) OUT="tandem-c89" ;;
840ebfedea0SLionel Sambuc  beos-*) OUT="$GUESSOS" ;;
841ebfedea0SLionel Sambuc  x86pc-*-qnx6) OUT="QNX6-i386" ;;
842ebfedea0SLionel Sambuc  *-*-qnx6) OUT="QNX6" ;;
843ebfedea0SLionel Sambuc  x86-*-android|i?86-*-android) OUT="android-x86" ;;
844ebfedea0SLionel Sambuc  armv[7-9]*-*-android) OUT="android-armv7" ;;
845ebfedea0SLionel Sambuc  *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
846ebfedea0SLionel Sambucesac
847ebfedea0SLionel Sambuc
848ebfedea0SLionel Sambuc# NB: This atalla support has been superceded by the ENGINE support
849ebfedea0SLionel Sambuc# That contains its own header and definitions anyway. Support can
850ebfedea0SLionel Sambuc# be enabled or disabled on any supported platform without external
851ebfedea0SLionel Sambuc# headers, eg. by adding the "hw-atalla" switch to ./config or
852ebfedea0SLionel Sambuc# perl Configure
853ebfedea0SLionel Sambuc#
854ebfedea0SLionel Sambuc# See whether we can compile Atalla support
855ebfedea0SLionel Sambuc#if [ -f /usr/include/atasi.h ]
856ebfedea0SLionel Sambuc#then
857ebfedea0SLionel Sambuc#  options="$options -DATALLA"
858ebfedea0SLionel Sambuc#fi
859ebfedea0SLionel Sambuc
860ebfedea0SLionel Sambucif expr "$options" : '.*no\-asm' > /dev/null; then :; else
861ebfedea0SLionel Sambuc  sh -c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \
862ebfedea0SLionel Sambuc  grep \\--noexecstack >/dev/null && \
863ebfedea0SLionel Sambuc  options="$options -Wa,--noexecstack"
864ebfedea0SLionel Sambucfi
865ebfedea0SLionel Sambuc
866ebfedea0SLionel Sambuc# gcc < 2.8 does not support -march=ultrasparc
867ebfedea0SLionel Sambucif [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
868ebfedea0SLionel Sambucthen
869ebfedea0SLionel Sambuc  echo "WARNING! Falling down to 'solaris-sparcv8-gcc'."
870ebfedea0SLionel Sambuc  echo "         Upgrade to gcc-2.8 or later."
871ebfedea0SLionel Sambuc  sleep 5
872ebfedea0SLionel Sambuc  OUT=solaris-sparcv8-gcc
873ebfedea0SLionel Sambucfi
874ebfedea0SLionel Sambucif [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ]
875ebfedea0SLionel Sambucthen
876ebfedea0SLionel Sambuc  echo "WARNING! Falling down to 'linux-sparcv8'."
877ebfedea0SLionel Sambuc  echo "         Upgrade to gcc-2.8 or later."
878ebfedea0SLionel Sambuc  sleep 5
879ebfedea0SLionel Sambuc  OUT=linux-sparcv8
880ebfedea0SLionel Sambucfi
881ebfedea0SLionel Sambuc
882ebfedea0SLionel Sambuccase "$GUESSOS" in
883ebfedea0SLionel Sambuc  i386-*) options="$options 386" ;;
884ebfedea0SLionel Sambucesac
885ebfedea0SLionel Sambuc
886ebfedea0SLionel Sambucfor i in aes bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha
887ebfedea0SLionel Sambucdo
888ebfedea0SLionel Sambuc  if [ ! -d crypto/$i ]
889ebfedea0SLionel Sambuc  then
890ebfedea0SLionel Sambuc    options="$options no-$i"
891ebfedea0SLionel Sambuc  fi
892ebfedea0SLionel Sambucdone
893ebfedea0SLionel Sambuc
894ebfedea0SLionel Sambuc# Discover Kerberos 5 (since it's still a prototype, we don't
895ebfedea0SLionel Sambuc# do any guesses yet, that's why this section is commented away.
896ebfedea0SLionel Sambuc#if [ -d /usr/kerberos ]; then
897ebfedea0SLionel Sambuc#    krb5_dir=/usr/kerberos
898ebfedea0SLionel Sambuc#    if [ \( -f $krb5_dir/lib/libgssapi_krb5.a -o -f $krb5_dir/lib/libgssapi_krb5.so* \)\
899ebfedea0SLionel Sambuc#	-a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
900ebfedea0SLionel Sambuc#	-a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
901ebfedea0SLionel Sambuc#	-a \( -f $krb5_dir/lib/libk5crypto.a -o -f $krb5_dir/lib/libk5crypto.so* \)\
902ebfedea0SLionel Sambuc#	-a \( -f $krb5_dir/include/krb5.h \) ]; then
903ebfedea0SLionel Sambuc#	options="$options --with-krb5-flavor=MIT"
904ebfedea0SLionel Sambuc#    fi
905ebfedea0SLionel Sambuc#elif [ -d /usr/heimdal ]; then
906ebfedea0SLionel Sambuc#    krb5_dir=/usr/heimdal
907ebfedea0SLionel Sambuc#    if [ \( -f $krb5_dir/lib/libgssapi.a -o -f $krb5_dir/lib/libgssapi.so* \)\
908ebfedea0SLionel Sambuc#	-a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
909ebfedea0SLionel Sambuc#	-a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
910ebfedea0SLionel Sambuc#	-a \( -f $krb5_dir/include/krb5.h \) ]; then
911ebfedea0SLionel Sambuc#	options="$options --with-krb5-flavor=Heimdal"
912ebfedea0SLionel Sambuc#    fi
913ebfedea0SLionel Sambuc#fi
914ebfedea0SLionel Sambuc
915ebfedea0SLionel Sambucif [ -z "$OUT" ]; then
916ebfedea0SLionel Sambuc  OUT="$CC"
917ebfedea0SLionel Sambucfi
918ebfedea0SLionel Sambuc
919ebfedea0SLionel Sambucif [ ".$PERL" = . ] ; then
920ebfedea0SLionel Sambuc	for i in . `echo $PATH | sed 's/:/ /g'`; do
921ebfedea0SLionel Sambuc		if [ -f "$i/perl5$EXE" ] ; then
922ebfedea0SLionel Sambuc			PERL="$i/perl5$EXE"
923ebfedea0SLionel Sambuc			break;
924ebfedea0SLionel Sambuc		fi;
925ebfedea0SLionel Sambuc	done
926ebfedea0SLionel Sambucfi
927ebfedea0SLionel Sambuc
928ebfedea0SLionel Sambucif [ ".$PERL" = . ] ; then
929ebfedea0SLionel Sambuc	for i in . `echo $PATH | sed 's/:/ /g'`; do
930ebfedea0SLionel Sambuc		if [ -f "$i/perl$EXE" ] ; then
931ebfedea0SLionel Sambuc			if "$i/perl$EXE" -e 'exit($]<5.0)'; then
932ebfedea0SLionel Sambuc				PERL="$i/perl$EXE"
933ebfedea0SLionel Sambuc				break;
934ebfedea0SLionel Sambuc			fi;
935ebfedea0SLionel Sambuc		fi;
936ebfedea0SLionel Sambuc	done
937ebfedea0SLionel Sambucfi
938ebfedea0SLionel Sambuc
939ebfedea0SLionel Sambucif [ ".$PERL" = . ] ; then
940ebfedea0SLionel Sambuc	echo "You need Perl 5."
941ebfedea0SLionel Sambuc	exit 1
942ebfedea0SLionel Sambucfi
943ebfedea0SLionel Sambuc
944ebfedea0SLionel Sambuc# run Configure to check to see if we need to specify the
945ebfedea0SLionel Sambuc# compiler for the platform ... in which case we add it on
946ebfedea0SLionel Sambuc# the end ... otherwise we leave it off
947ebfedea0SLionel Sambuc
948ebfedea0SLionel Sambuc$PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null
949ebfedea0SLionel Sambucif [ $? = "0" ]; then
950ebfedea0SLionel Sambuc  OUT="$OUT-$CC"
951ebfedea0SLionel Sambucfi
952ebfedea0SLionel Sambuc
953ebfedea0SLionel SambucOUT="$PREFIX$OUT"
954ebfedea0SLionel Sambuc
955ebfedea0SLionel Sambuc$PERL ./Configure LIST | grep "$OUT" > /dev/null
956ebfedea0SLionel Sambucif [ $? = "0" ]; then
957ebfedea0SLionel Sambuc  echo Configuring for $OUT
958ebfedea0SLionel Sambuc
959ebfedea0SLionel Sambuc  if [ "$TEST" = "true" ]; then
960ebfedea0SLionel Sambuc    echo $PERL ./Configure $OUT $options
961ebfedea0SLionel Sambuc  else
962ebfedea0SLionel Sambuc    $PERL ./Configure $OUT $options
963ebfedea0SLionel Sambuc  fi
964ebfedea0SLionel Sambucelse
965ebfedea0SLionel Sambuc  echo "This system ($OUT) is not supported. See file INSTALL for details."
966ebfedea0SLionel Sambucfi
967ebfedea0SLionel Sambuc)
968