Forgot to mention second fix.
[openssl.git] / config
1 #!/bin/sh
2 #
3 # OpenSSL config: determine the operating system and run ./Configure
4 #
5 # "config -h" for usage information.
6 #
7 #          this is a merge of minarch and GuessOS from the Apache Group.
8 #          Originally written by Tim Hudson <tjh@cryptsoft.com>.
9
10 # Original Apache Group comments on GuessOS
11
12 # Simple OS/Platform guesser. Similar to config.guess but
13 # much, much smaller. Since it was developed for use with
14 # Apache, it follows under Apache's regular licensing
15 # with one specific addition: Any changes or additions
16 # to this script should be Emailed to the Apache
17 # group (apache@apache.org) in general and to
18 # Jim Jagielski (jim@jaguNET.com) in specific.
19 #
20 # Be as similar to the output of config.guess/config.sub
21 # as possible.
22
23 PREFIX=""
24 SUFFIX=""
25 TEST="false"
26
27 # pick up any command line args to config
28 for i
29 do
30 case "$i" in 
31 -d*) PREFIX="debug-";;
32 -t*) TEST="true";;
33 -h*) TEST="true"; cat <<EOF
34 Usage: config [options]
35  -d     Add a debug- prefix to machine choice.
36  -t     Test mode, do not run the Configure perl script.
37  -h     This help.
38
39 Any other text will be passed to the Configure perl script.
40 See INSTALL for instructions.
41
42 EOF
43 ;;
44 *) options=$options" $i" ;;
45 esac
46 done
47
48 # First get uname entries that we use below
49
50 MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
51 RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
52 SYSTEM=`(uname -s) 2>/dev/null`  || SYSTEM="unknown"
53 VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
54
55
56 # Now test for ISC and SCO, since it is has a braindamaged uname.
57 #
58 # We need to work around FreeBSD 1.1.5.1 
59 (
60 XREL=`uname -X 2>/dev/null | grep "^Release" | awk '{print $3}'`
61 if [ "x$XREL" != "x" ]; then
62     if [ -f /etc/kconfig ]; then
63         case "$XREL" in
64             4.0|4.1)
65                     echo "${MACHINE}-whatever-isc4"; exit 0
66                 ;;
67         esac
68     else
69         case "$XREL" in
70             3.2v4.2)
71                 echo "whatever-whatever-sco3"; exit 0
72                 ;;
73             3.2v5.0*)
74                 echo "whatever-whatever-sco5"; exit 0
75                 ;;
76             4.2MP)
77                 if [ "x$VERSION" = "x2.01" ]; then
78                     echo "${MACHINE}-whatever-unixware201"; exit 0
79                 elif [ "x$VERSION" = "x2.02" ]; then
80                     echo "${MACHINE}-whatever-unixware202"; exit 0
81                 elif [ "x$VERSION" = "x2.03" ]; then
82                     echo "${MACHINE}-whatever-unixware203"; exit 0
83                 elif [ "x$VERSION" = "x2.1.1" ]; then
84                     echo "${MACHINE}-whatever-unixware211"; exit 0
85                 elif [ "x$VERSION" = "x2.1.2" ]; then
86                     echo "${MACHINE}-whatever-unixware212"; exit 0
87                 elif [ "x$VERSION" = "x2.1.3" ]; then
88                     echo "${MACHINE}-whatever-unixware213"; exit 0
89                 else
90                     echo "${MACHINE}-whatever-unixware2"; exit 0
91                 fi
92                 ;;
93             4.2)
94                 echo "whatever-whatever-unixware1"; exit 0
95                 ;;
96             5)
97                 if [ "`echo x$VERSION | sed -e 's/\..*//'`" = "x7" ]; then
98                     echo "${MACHINE}-sco-unixware7"; exit 0
99                 fi
100                 ;;
101         esac
102     fi
103 fi
104 # Now we simply scan though... In most cases, the SYSTEM info is enough
105 #
106 case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
107     MPE/iX:*)
108         MACHINE=`echo "$MACHINE" | sed -e 's/-/_/g'`
109         echo "parisc-hp-MPE/iX"; exit 0
110         ;;
111     A/UX:*)
112         echo "m68k-apple-aux3"; exit 0
113         ;;
114
115     AIX:[3456789]:4:*)
116         echo "${MACHINE}-ibm-aix43"; exit 0
117         ;;
118
119     AIX:*:[56789]:*)
120         echo "${MACHINE}-ibm-aix43"; exit 0
121         ;;
122
123     AIX:*)
124         echo "${MACHINE}-ibm-aix"; exit 0
125         ;;
126
127     dgux:*)
128         echo "${MACHINE}-dg-dgux"; exit 0
129         ;;
130
131     HI-UX:*)
132         echo "${MACHINE}-hi-hiux"; exit 0
133         ;;
134
135     HP-UX:*)
136         HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
137         case "$HPUXVER" in
138             11.*)
139                 echo "${MACHINE}-hp-hpux11"; exit 0
140                 ;;
141             10.*)
142                 echo "${MACHINE}-hp-hpux10"; exit 0
143                 ;;
144             *)
145                 echo "${MACHINE}-hp-hpux"; exit 0
146                 ;;
147         esac
148         ;;
149
150     IRIX:5.*)
151         echo "mips2-sgi-irix"; exit 0
152         ;;
153
154     IRIX:6.*)
155         echo "mips3-sgi-irix"; exit 0
156         ;;
157
158     IRIX64:*)
159         echo "mips4-sgi-irix64"; exit 0
160         ;;
161
162     Linux:[2-9].*)
163         echo "${MACHINE}-whatever-linux2"; exit 0
164         ;;
165
166     Linux:1.*)
167         echo "${MACHINE}-whatever-linux1"; exit 0
168         ;;
169
170     GNU*)
171         echo "hurd-x86"; exit 0;
172         ;;
173
174     LynxOS:*)
175         echo "${MACHINE}-lynx-lynxos"; exit 0
176         ;;
177
178     BSD/OS:4.*)  # BSD/OS always says 386
179         echo "i486-whatever-bsdi4"; exit 0
180         ;;
181
182     BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*)
183         case `/sbin/sysctl -n hw.model` in
184             Pentium*)
185                 echo "i586-whatever-bsdi"; exit 0
186                 ;;
187             *)
188                 echo "i386-whatever-bsdi"; exit 0
189                 ;;
190             esac;
191         ;;
192
193     BSD/386:*|BSD/OS:*)
194         echo "${MACHINE}-whatever-bsdi"; exit 0
195         ;;
196
197     FreeBSD:*)
198         VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'`
199         MACH=`sysctl -n hw.model`
200         ARCH='whatever'
201         case ${MACH} in
202            *386*       ) MACH="i386"     ;;
203            *486*       ) MACH="i486"     ;;
204            Pentium\ II*) MACH="i686"     ;;
205            Pentium*    ) MACH="i586"     ;;
206            Alpha*      ) MACH="alpha"    ;;
207            *           ) MACH="$MACHINE" ;;
208         esac
209         case ${MACH} in
210            i[0-9]86 ) ARCH="pc" ;;
211         esac
212         echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0
213         ;;
214
215     NetBSD:*:*:*386*)
216         echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
217         ;;
218
219     NetBSD:*)
220         echo "${MACHINE}-whatever-netbsd"; exit 0
221         ;;
222
223     OpenBSD:*)
224         echo "${MACHINE}-whatever-openbsd"; exit 0
225         ;;
226
227     OSF1:*:*:*alpha*)
228         echo "${MACHINE}-dec-osf"; exit 0
229         ;;
230
231     QNX:*)
232         case "$VERSION" in
233             4*)
234                 echo "${MACHINE}-whatever-qnx4"
235                 ;;
236             *)
237                 echo "${MACHINE}-whatever-qnx"
238                 ;;
239         esac
240         exit 0
241         ;;
242
243     Paragon*:*:*:*)
244         echo "i860-intel-osf1"; exit 0
245         ;;
246
247     Rhapsody:*)
248         echo "ppc-apple-rhapsody"; exit 0
249         ;;
250
251     Darwin:*)
252         case "$MACHINE" in
253             Power*)
254                 echo "ppc-apple-darwin${VERSION}"
255                 ;;
256             *)
257                 echo "i386-apple-darwin${VERSION}"
258                 ;;
259         esac
260         exit 0
261         ;;
262
263     SunOS:5.*)
264         echo "${MACHINE}-whatever-solaris2"; exit 0
265         ;;
266
267     SunOS:*)
268         echo "${MACHINE}-sun-sunos4"; exit 0
269         ;;
270
271     UNIX_System_V:4.*:*)
272         echo "${MACHINE}-whatever-sysv4"; exit 0
273         ;;
274
275     *:4*:R4*:m88k)
276         echo "${MACHINE}-whatever-sysv4"; exit 0
277         ;;
278
279     DYNIX/ptx:4*:*)
280         echo "${MACHINE}-whatever-sysv4"; exit 0
281         ;;
282
283     *:4.0:3.0:3[34]?? | *:4.0:3.0:3[34]??,*)
284         echo "i486-ncr-sysv4"; exit 0
285         ;;
286
287     ULTRIX:*)
288         echo "${MACHINE}-unknown-ultrix"; exit 0
289         ;;
290
291     SINIX*|ReliantUNIX*)
292         echo "${MACHINE}-siemens-sysv4"; exit 0
293         ;;
294
295     POSIX-BC*)
296         echo "${MACHINE}-siemens-sysv4"; exit 0   # Here, $MACHINE == "BS2000"
297         ;;
298
299     machten:*)
300        echo "${MACHINE}-tenon-${SYSTEM}"; exit 0;
301        ;;
302
303     library:*)
304         echo "${MACHINE}-ncr-sysv4"; exit 0
305         ;;
306
307     ConvexOS:*:11.0:*)
308         echo "${MACHINE}-v11-${SYSTEM}"; exit 0;
309         ;;
310
311     NEWS-OS:4.*)
312         echo "mips-sony-newsos4"; exit 0;
313         ;;
314
315 esac
316
317 #
318 # Ugg. These are all we can determine by what we know about
319 # the output of uname. Be more creative:
320 #
321
322 # Do the Apollo stuff first. Here, we just simply assume
323 # that the existance of the /usr/apollo directory is proof
324 # enough
325 if [ -d /usr/apollo ]; then
326     echo "whatever-apollo-whatever"
327     exit 0
328 fi
329
330 # Now NeXT
331 ISNEXT=`hostinfo 2>/dev/null`
332 case "$ISNEXT" in
333     *'NeXT Mach 3.3'*)
334         echo "whatever-next-nextstep3.3"; exit 0
335         ;;
336     *NeXT*)
337         echo "whatever-next-nextstep"; exit 0
338         ;;
339 esac
340
341 # At this point we gone through all the one's
342 # we know of: Punt
343
344 echo "${MACHINE}-whatever-${SYSTEM}" 
345 exit 0
346 ) 2>/dev/null | (
347
348 # ---------------------------------------------------------------------------
349 # this is where the translation occurs into SSLeay terms
350 # ---------------------------------------------------------------------------
351
352 # figure out if gcc is available and if so we use it otherwise
353 # we fallback to whatever cc does on the system
354 GCCVER=`(gcc --version) 2>/dev/null`
355 if [ "$GCCVER" != "" ]; then
356   CC=gcc
357   # then strip off whatever prefix Cygnus prepends the number with...
358   GCCVER=`echo $GCCVER | sed 's/^[a-z]*\-//'`
359   # peak single digit before and after first dot, e.g. 2.95.1 gives 29
360   GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
361 else
362   CC=cc
363 fi
364 GCCVER=${GCCVER:-0}
365
366 if [ "$SYSTEM" = "SunOS" ]; then
367   if [ $GCCVER -ge 30 ]; then
368     # 64-bit ABI isn't officially supported in gcc 3.0, but it appears
369     # to be working, at the very least 'make test' passes...
370     if gcc -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then
371       GCC_ARCH="-m64"
372     else
373       GCC_ARCH="-m32"
374     fi
375   fi
376   # check for WorkShop C, expected output is "cc: blah-blah C x.x"
377   CCVER=`(cc -V 2>&1) 2>/dev/null | \
378         egrep -e '^cc: .* C [0-9]\.[0-9]' | \
379         sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'`
380   CCVER=${CCVER:-0}
381   if [ $CCVER -gt 40 ]; then
382     CC=cc       # overrides gcc!!!
383     if [ $CCVER -eq 50 ]; then
384       echo "WARNING! Detected WorkShop C 5.0. Do make sure you have"
385       echo "         patch #107357-01 or later applied."
386       sleep 5
387     fi
388   elif [ "$CC" = "cc" -a $CCVER -gt 0 ]; then
389     CC=sc3
390   fi
391 fi
392
393 if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
394   # check for Compaq C, expected output is "blah-blah C Vx.x"
395   CCCVER=`(ccc -V 2>&1) 2>/dev/null | \
396         egrep -e '.* C V[0-9]\.[0-9]' | \
397         sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'`
398   CCCVER=${CCCVER:-0}
399   if [ $CCCVER -gt 60 ]; then
400     CC=ccc      # overrides gcc!!! well, ccc outperforms inoticeably
401                 # only on hash routines and des, otherwise gcc (2.95)
402                 # keeps along rather tight...
403   fi
404 fi
405
406 CCVER=${CCVER:-0}
407
408 # read the output of the embedded GuessOS 
409 read GUESSOS
410
411 echo Operating system: $GUESSOS
412
413 # now map the output into SSLeay terms ... really should hack into the
414 # script above so we end up with values in vars but that would take
415 # more time that I want to waste at the moment
416 case "$GUESSOS" in
417   mips2-sgi-irix)
418         CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
419         CPU=${CPU:-0}
420         if [ $CPU -ge 4000 ]; then
421                 options="$options -mips2"
422         fi
423         OUT="irix-$CC"
424         ;;
425   mips3-sgi-irix)
426         CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
427         CPU=${CPU:-0}
428         if [ $CPU -ge 5000 ]; then
429                 options="$options -mips4"
430         else
431                 options="$options -mips3"
432         fi
433         OUT="irix-mips3-$CC"
434         ;;
435   mips4-sgi-irix64)
436         echo "WARNING! If you wish to build 64-bit library, then you have to"
437         echo "         invoke './Configure irix64-mips4-$CC' *manually*."
438         if [ "$TEST" = "false" ]; then
439           echo "         You have about 5 seconds to press Ctrl-C to abort."
440           (stty -icanon min 0 time 50; read waste) < /dev/tty
441         fi
442         CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
443         CPU=${CPU:-0}
444         if [ $CPU -ge 5000 ]; then
445                 options="$options -mips4"
446         else
447                 options="$options -mips3"
448         fi
449         OUT="irix-mips3-$CC"
450         ;;
451   alpha-*-linux2)
452         ISA=`awk '/cpu model/{print$4}' /proc/cpuinfo`
453         case ${ISA:-generic} in
454         *[67])  OUT="linux-alpha+bwx-$CC" ;;
455         *)      OUT="linux-alpha-$CC" ;;
456         esac
457         if [ "$CC" = "gcc" ]; then
458             case ${ISA:-generic} in
459             EV5|EV45)           options="$options -mcpu=ev5";;
460             EV56|PCA56)         options="$options -mcpu=ev56";;
461             EV6|EV67|PCA57)     options="$options -mcpu=ev6";;
462             esac
463         fi
464         ;;
465   mips-*-linux?)
466           cat >dummy.c <<EOF
467 #include <stdio.h>  /* for printf() prototype */
468         int main (argc, argv) int argc; char *argv[]; {
469 #ifdef __MIPSEB__
470   printf ("linux-%s\n", argv[1]);
471 #endif
472 #ifdef __MIPSEL__
473   printf ("linux-%sel\n", argv[1]);
474 #endif
475   return 0;
476 }
477 EOF
478         ${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
479         rm dummy dummy.c
480         ;;
481   ppc-*-linux2) OUT="linux-ppc" ;;
482   m68k-*-linux*) OUT="linux-m68k" ;;
483   ia64-*-linux?) OUT="linux-ia64" ;;
484   ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
485   ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
486   i386-apple-darwin*) OUT="darwin-i386-cc" ;;
487   sparc64-*-linux2)
488         #Before we can uncomment following lines we have to wait at least
489         #till 64-bit glibc for SPARC is operational:-(
490         #echo "WARNING! If you wish to build 64-bit library, then you have to"
491         #echo "         invoke './Configure linux64-sparcv9' *manually*."
492         #echo "         Type return if you want to continue, Ctrl-C to abort."
493         #read waste < /dev/tty
494         OUT="linux-sparcv9" ;;
495   sparc-*-linux2)
496         KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
497         case ${KARCH:-sun4} in
498         sun4u*) OUT="linux-sparcv9" ;;
499         sun4m)  OUT="linux-sparcv8" ;;
500         sun4d)  OUT="linux-sparcv8" ;;
501         *)      OUT="linux-sparcv7" ;;
502         esac ;;
503   arm*-*-linux2) OUT="linux-elf-arm" ;;
504   s390-*-linux2) OUT="linux-s390" ;;
505   *-*-linux2) OUT="linux-elf" ;;
506   *-*-linux1) OUT="linux-aout" ;;
507   sun4u*-*-solaris2)
508         OUT="solaris-sparcv9-$CC"
509         ISA64=`(isalist) 2>/dev/null | grep sparcv9`
510         if [ "$ISA64" != "" ]; then
511             if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
512                 echo "WARNING! If you wish to build 64-bit library, then you have to"
513                 echo "         invoke './Configure solaris64-sparcv9-cc' *manually*."
514                 if [ "$TEST" = "false" ]; then
515                   echo "         You have about 5 seconds to press Ctrl-C to abort."
516                   (stty -icanon min 0 max 50; read waste) < /dev/tty
517                 fi
518             elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
519                 # $GCC_ARCH denotes default ABI chosen by compiler driver
520                 # (first one found on the $PATH). I assume that user
521                 # expects certain consistency with the rest of his builds
522                 # and therefore switch over to 64-bit. <appro>
523                 OUT="solaris64-sparcv9-gcc"
524                 echo "WARNING! If you wish to build 32-bit library, then you have to"
525                 echo "         invoke './Configure solaris-sparcv9-gcc' *manually*."
526                 if [ "$TEST" = "false" ]; then
527                   echo "         You have about 5 seconds to press Ctrl-C to abort."
528                   (stty -icanon min 0 max 50; read waste) < /dev/tty
529                 fi
530             elif [ "$GCC_ARCH" = "-m32" ]; then
531                 echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
532                 echo "        and wish to build 64-bit library, then you have to"
533                 echo "        invoke './Configure solaris64-sparcv9-gcc' *manually*."
534                 if [ "$TEST" = "false" ]; then
535                   echo "         You have about 5 seconds to press Ctrl-C to abort."
536                   (stty -icanon min 0 max 50; read waste) < /dev/tty
537                 fi
538             fi
539         fi
540         ;;
541   sun4m-*-solaris2)     OUT="solaris-sparcv8-$CC" ;;
542   sun4d-*-solaris2)     OUT="solaris-sparcv8-$CC" ;;
543   sun4*-*-solaris2)     OUT="solaris-sparcv7-$CC" ;;
544   *86*-*-solaris2) OUT="solaris-x86-$CC" ;;
545   *-*-sunos4) OUT="sunos-$CC" ;;
546   alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;;
547   *-freebsd[3-9]*) OUT="FreeBSD-elf" ;;
548   *-freebsd[1-2]*) OUT="FreeBSD" ;;
549   *86*-*-netbsd) OUT="NetBSD-x86" ;;
550   sun3*-*-netbsd) OUT="NetBSD-m68" ;;
551   *-*-netbsd) OUT="NetBSD-sparc" ;;
552   *86*-*-openbsd) OUT="OpenBSD-x86" ;;
553   alpha*-*-openbsd) OUT="OpenBSD-alpha" ;;
554   pmax*-*-openbsd) OUT="OpenBSD-mips" ;;
555   *-*-openbsd) OUT="OpenBSD" ;;
556   *86*-*-bsdi4) OUT="bsdi-elf-gcc" ;;
557   *-*-osf) OUT="alpha-cc" ;;
558   *-*-unixware7) OUT="unixware-7" ;;
559   *-*-UnixWare7) OUT="unixware-7" ;;
560   *-*-Unixware7) OUT="unixware-7" ;;
561   *-*-unixware20*) OUT="unixware-2.0" ;;
562   *-*-unixware21*) OUT="unixware-2.1" ;;
563   *-*-UnixWare20*) OUT="unixware-2.0" ;;
564   *-*-UnixWare21*) OUT="unixware-2.1" ;;
565   *-*-Unixware20*) OUT="unixware-2.0" ;;
566   *-*-Unixware21*) OUT="unixware-2.1" ;;
567   BS2000-siemens-sysv4) OUT="BS2000-OSD" ;;
568   RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
569   *-siemens-sysv4) OUT="SINIX" ;;
570   *-hpux1*)     OUT="hpux-parisc-$CC"
571                 options="$options -D_REENTRANT" ;;
572   *-hpux)       OUT="hpux-parisc-$CC" ;;
573   # these are all covered by the catchall below
574   # *-aix) OUT="aix-$CC" ;;
575   # *-dgux) OUT="dgux" ;;
576   mips-sony-newsos4) OUT="newsos4-gcc" ;;
577   *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
578 esac
579
580 # NB: This atalla support has been superceded by the ENGINE support
581 # That contains its own header and definitions anyway. Support can
582 # be enabled or disabled on any supported platform without external
583 # headers, eg. by adding the "hw-atalla" switch to ./config or
584 # perl Configure
585 #
586 # See whether we can compile Atalla support
587 #if [ -f /usr/include/atasi.h ]
588 #then
589 #  options="$options -DATALLA"
590 #fi
591
592 # gcc < 2.8 does not support -mcpu=ultrasparc
593 if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
594 then
595   echo "WARNING! Do consider upgrading to gcc-2.8 or later."
596   sleep 5
597   OUT=solaris-sparcv9-gcc27
598 fi
599 if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ]
600 then
601   echo "WARNING! Falling down to 'linux-sparcv8'."
602   echo "         Upgrade to gcc-2.8 or later."
603   sleep 5
604   OUT=linux-sparcv8
605 fi
606
607 case "$GUESSOS" in
608   i386-*) options="$options 386" ;;
609 esac
610
611 for i in bf cast des dh dsa ec hmac md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa sha
612 do
613   if [ ! -d crypto/$i ]
614   then
615     options="$options no-$i"
616   fi
617 done
618
619 # Discover Kerberos 5 (since it's still a prototype, we don't
620 # do any guesses yet, that's why this section is commented away.
621 #if [ -d /usr/kerberos ]; then
622 #    krb5_dir=/usr/kerberos
623 #    if [ \( -f $krb5_dir/lib/libgssapi_krb5.a -o -f $krb5_dir/lib/libgssapi_krb5.so* \)\
624 #       -a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
625 #       -a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
626 #       -a \( -f $krb5_dir/lib/libk5crypto.a -o -f $krb5_dir/lib/libk5crypto.so* \)\
627 #       -a \( -f $krb5_dir/include/krb5.h \) ]; then
628 #       options="$options --with-krb5-flavor=MIT"
629 #    fi
630 #elif [ -d /usr/heimdal ]; then
631 #    krb5_dir=/usr/heimdal
632 #    if [ \( -f $krb5_dir/lib/libgssapi.a -o -f $krb5_dir/lib/libgssapi.so* \)\
633 #       -a \( -f $krb5_dir/lib/libkrb5.a -o -f $krb5_dir/lib/libkrb5.so* \)\
634 #       -a \( -f $krb5_dir/lib/libcom_err.a -o -f $krb5_dir/lib/libcom_err.so* \)\
635 #       -a \( -f $krb5_dir/include/krb5.h \) ]; then
636 #       options="$options --with-krb5-flavor=Heimdal"
637 #    fi
638 #fi
639
640 if [ -z "$OUT" ]; then
641   OUT="$CC"
642 fi
643
644 if [ ".$PERL" = . ] ; then
645         for i in . `echo $PATH | sed 's/:/ /g'`; do
646                 if [ -f "$i/perl5" ] ; then
647                         PERL="$i/perl5"
648                         break;
649                 fi;
650         done
651 fi
652
653 if [ ".$PERL" = . ] ; then
654         for i in . `echo $PATH | sed 's/:/ /g'`; do
655                 if [ -f "$i/perl" ] ; then
656                         if "$i/perl" -e 'exit($]<5.0)'; then
657                                 PERL="$i/perl"
658                                 break;
659                         fi;
660                 fi;
661         done
662 fi
663
664 if [ ".$PERL" = . ] ; then
665         echo "You need Perl 5."
666         exit 1
667 fi
668
669 # run Configure to check to see if we need to specify the 
670 # compiler for the platform ... in which case we add it on
671 # the end ... otherwise we leave it off
672
673 $PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null
674 if [ $? = "0" ]; then
675   OUT="$OUT-$CC"
676 fi
677
678 OUT="$PREFIX$OUT"
679
680 $PERL ./Configure LIST | grep "$OUT" > /dev/null
681 if [ $? = "0" ]; then
682   echo Configuring for $OUT
683
684   if [ "$TEST" = "true" ]; then
685     echo $PERL ./Configure $OUT $options
686   else
687     $PERL ./Configure $OUT $options
688   fi
689 else
690   echo "This system ($OUT) is not supported. See file INSTALL for details."
691 fi
692 )