3 # OpenSSL config: determine the operating system and run ./Configure
5 # "config -h" for usage information.
7 # this is a merge of minarch and GuessOS from the Apache Group.
8 # Originally written by Tim Hudson <tjh@cryptsoft.com>.
10 # Original Apache Group comments on GuessOS
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.
20 # Be as similar to the output of config.guess/config.sub
27 # pick up any command line args to config
31 -d*) options
=$options" --debug";;
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.
39 Any other text will be passed to the Configure perl script.
40 See INSTALL for instructions.
44 *) options
=$options" $i" ;;
48 # First get uname entries that we use below
50 [ "$MACHINE" ] || MACHINE
=`(uname -m) 2>/dev/null` || MACHINE
="unknown"
51 [ "$RELEASE" ] || RELEASE
=`(uname -r) 2>/dev/null` || RELEASE
="unknown"
52 [ "$SYSTEM" ] || SYSTEM
=`(uname -s) 2>/dev/null` || SYSTEM
="unknown"
53 [ "$BUILD" ] || VERSION
=`(uname -v) 2>/dev/null` || VERSION
="unknown"
56 # Now test for ISC and SCO, since it is has a braindamaged uname.
58 # We need to work around FreeBSD 1.1.5.1
60 XREL
=`uname -X 2>/dev/null | grep "^Release" | awk '{print $3}'`
61 if [ "x$XREL" != "x" ]; then
62 if [ -f /etc
/kconfig
]; then
65 echo "${MACHINE}-whatever-isc4"; exit 0
71 echo "whatever-whatever-sco3"; exit 0
74 echo "whatever-whatever-sco5"; exit 0
78 x2.0
*) echo "whatever-whatever-unixware20"; exit 0 ;;
79 x2.1
*) echo "whatever-whatever-unixware21"; exit 0 ;;
80 x2
*) echo "whatever-whatever-unixware2"; exit 0 ;;
84 echo "whatever-whatever-unixware1"; exit 0
88 # We hardcode i586 in place of ${MACHINE} for the
89 # following reason. The catch is that even though Pentium
90 # is minimum requirement for platforms in question,
91 # ${MACHINE} gets always assigned to i386. Now, problem
92 # with i386 is that it makes ./config pass 386 to
93 # ./Configure, which in turn makes make generate
94 # inefficient SHA-1 (for this moment) code.
95 x
[678]*) echo "i586-sco-unixware7"; exit 0 ;;
101 # Now we simply scan though... In most cases, the SYSTEM info is enough
103 case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
105 echo "m68k-apple-aux3"; exit 0
109 echo "${MACHINE}-ibm-aix"; exit 0
113 echo "${MACHINE}-ibm-aix"; exit 0
117 echo "${MACHINE}-ibm-aix3"; exit 0
121 echo "${MACHINE}-hi-hiux"; exit 0
125 HPUXVER
=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
127 1[0-9].
*) # HPUX 10 and 11 targets are unified
128 echo "${MACHINE}-hp-hpux1x"; exit 0
131 echo "${MACHINE}-hp-hpux"; exit 0
137 echo "mips2-sgi-irix"; exit 0
141 echo "mips3-sgi-irix"; exit 0
145 echo "mips4-sgi-irix64"; exit 0
149 echo "${MACHINE}-whatever-linux2"; exit 0
153 echo "${MACHINE}-whatever-linux1"; exit 0
157 echo "hurd-x86"; exit 0;
161 echo "${MACHINE}-lynx-lynxos"; exit 0
164 BSD
/OS
:4.
*) # BSD/OS always says 386
165 echo "i486-whatever-bsdi4"; exit 0
168 BSD
/386:*:*:*486*|BSD
/OS
:*:*:*:*486*)
169 case `/sbin/sysctl -n hw.model` in
171 echo "i586-whatever-bsdi"; exit 0
174 echo "i386-whatever-bsdi"; exit 0
180 echo "${MACHINE}-whatever-bsdi"; exit 0
184 VERS
=`echo ${RELEASE} | sed -e 's/[-(].*//'`
185 MACH
=`sysctl -n hw.model`
188 *386* ) MACH
="i386" ;;
189 *486* ) MACH
="i486" ;;
190 Pentium\ II
*) MACH
="i686" ;;
191 Pentium
* ) MACH
="i586" ;;
192 * ) MACH
="$MACHINE" ;;
195 i
[0-9]86 ) ARCH
="pc" ;;
197 echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0
201 echo "${MACHINE}-whatever-freebsd"; exit 0
205 echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
209 echo "${MACHINE}-whatever-netbsd"; exit 0
213 echo "${MACHINE}-whatever-openbsd"; exit 0
217 echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
221 OSFMAJOR
=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'`
224 echo "${MACHINE}-dec-tru64"; exit 0
227 echo "${MACHINE}-dec-osf"; exit 0
230 echo "${MACHINE}-dec-osf"; exit 0
238 echo "${MACHINE}-whatever-qnx4"
241 echo "${MACHINE}-whatever-qnx6"
244 echo "${MACHINE}-whatever-qnx"
251 echo "i860-intel-osf1"; exit 0
255 echo "ppc-apple-rhapsody"; exit 0
261 echo "ppc-apple-darwin${VERSION}"
264 echo "i686-apple-darwin${VERSION}"
271 echo "${MACHINE}-whatever-solaris2"; exit 0
275 echo "${MACHINE}-sun-sunos4"; exit 0
279 echo "${MACHINE}-whatever-sysv4"; exit 0
283 echo "i386-stratus-vos"; exit 0
287 echo "hppa1.1-stratus-vos"; exit 0
291 echo "${MACHINE}-whatever-sysv4"; exit 0
295 echo "${MACHINE}-whatever-sysv4"; exit 0
298 *:4.0:3.0:3[34]?? |
*:4.0:3.0:3[34]??
,*)
299 echo "i486-ncr-sysv4"; exit 0
303 echo "${MACHINE}-unknown-ultrix"; exit 0
307 echo "${MACHINE}-siemens-sysv4"; exit 0 # Here, $MACHINE == "BS2000"
311 echo "${MACHINE}-tenon-${SYSTEM}"; exit 0;
315 echo "${MACHINE}-ncr-sysv4"; exit 0
319 echo "${MACHINE}-v11-${SYSTEM}"; exit 0;
323 echo "${MACHINE}-whatever-mingw"; exit 0;
326 echo "${MACHINE}-pc-cygwin"; exit 0
330 echo "${MACHINE}-whatever-vxworks"; exit 0;
335 # Ugg. These are all we can determine by what we know about
336 # the output of uname. Be more creative:
339 # Do the Apollo stuff first. Here, we just simply assume
340 # that the existence of the /usr/apollo directory is proof
342 if [ -d /usr
/apollo
]; then
343 echo "whatever-apollo-whatever"
348 ISNEXT
=`hostinfo 2>/dev/null`
351 echo "whatever-next-nextstep3.3"; exit 0
354 echo "whatever-next-nextstep"; exit 0
358 # At this point we gone through all the one's
361 echo "${MACHINE}-whatever-${SYSTEM}"
365 # ---------------------------------------------------------------------------
366 # this is where the translation occurs into SSLeay terms
367 # ---------------------------------------------------------------------------
369 # Only set CC if not supplied already
370 if [ -z "$CROSS_COMPILE$CC" ]; then
371 GCCVER
=`sh -c "gcc -dumpversion" 2>/dev/null`
372 if [ "$GCCVER" != "" ]; then
373 # then strip off whatever prefix egcs prepends the number with...
374 # Hopefully, this will work for any future prefixes as well.
375 GCCVER
=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
376 # Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
377 # does give us what we want though, so we use that. We just just the
378 # major and minor version numbers.
379 # peak single digit before and after first dot, e.g. 2.95.1 gives 29
380 GCCVER
=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
387 if [ "$SYSTEM" = "HP-UX" ];then
388 # By default gcc is a ILP32 compiler (with long long == 64).
390 if [ $GCCVER -ge 30 ]; then
391 # PA64 support only came in with gcc 3.0.x.
392 # We check if the preprocessor symbol __LP64__ is defined...
393 if echo "__LP64__" | gcc
-v -E -x c
- 2>/dev
/null |
grep "^__LP64__" 2>&1 > /dev
/null
; then
394 : # __LP64__ has slipped through, it therefore is not defined
400 if [ "$SYSTEM" = "SunOS" ]; then
401 if [ $GCCVER -ge 30 ]; then
402 # 64-bit ABI isn't officially supported in gcc 3.0, but it appears
403 # to be working, at the very least 'make test' passes...
404 if gcc
-v -E -x c
/dev
/null
2>&1 |
grep __arch64__
> /dev
/null
; then
410 # check for WorkShop C, expected output is "cc: blah-blah C x.x"
411 CCVER
=`(cc -V 2>&1) 2>/dev/null | \
412 egrep -e '^cc: .* C [0-9]\.[0-9]' | \
413 sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'`
415 if [ $MACHINE != i86pc
-a $CCVER -gt 40 ]; then
416 CC
=cc
# overrides gcc!!!
417 if [ $CCVER -eq 50 ]; then
418 echo "WARNING! Detected WorkShop C 5.0. Do make sure you have"
419 echo " patch #107357-01 or later applied."
425 if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
426 # check for Compaq C, expected output is "blah-blah C Vx.x"
427 CCCVER
=`(ccc -V 2>&1) 2>/dev/null | \
428 egrep -e '.* C V[0-9]\.[0-9]' | \
429 sed 's/.* C V\([0-9]\)\.\([0-9]\).*/\1\2/'`
431 if [ $CCCVER -gt 60 ]; then
432 CC
=ccc
# overrides gcc!!! well, ccc outperforms inoticeably
433 # only on hash routines and des, otherwise gcc (2.95)
434 # keeps along rather tight...
438 if [ "${SYSTEM}" = "AIX" ]; then # favor vendor cc over gcc
439 (cc
) 2>&1 |
grep -iv "not found" > /dev
/null
&& CC
=cc
444 # read the output of the embedded GuessOS
447 echo Operating system
: $GUESSOS
449 # now map the output into SSLeay terms ... really should hack into the
450 # script above so we end up with values in vars but that would take
451 # more time that I want to waste at the moment
460 CPU
=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
462 if [ $CPU -ge 4000 ]; then
463 options
="$options -mips2"
468 #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
470 #if [ $CPU -ge 5000 ]; then
471 # options="$options -mips4"
473 # options="$options -mips3"
478 echo "WARNING! If you wish to build 64-bit library, then you have to"
479 echo " invoke './Configure irix64-mips4-$CC' *manually*."
480 if [ "$TEST" = "false" -a -t 1 ]; then
481 echo " You have about 5 seconds to press Ctrl-C to abort."
482 (trap "stty `stty -g`" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
484 #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
486 #if [ $CPU -ge 5000 ]; then
487 # options="$options -mips4"
489 # options="$options -mips3"
493 ppc-apple-rhapsody
) OUT
="rhapsody-ppc-cc" ;;
495 ISA64
=`(sysctl -n hw.optional.64bitops) 2>/dev/null`
496 if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
497 echo "WARNING! If you wish to build 64-bit library, then you have to"
498 echo " invoke './Configure darwin64-ppc-cc' *manually*."
499 if [ "$TEST" = "false" -a -t 1 ]; then
500 echo " You have about 5 seconds to press Ctrl-C to abort."
501 (trap "stty `stty -g`" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
504 if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
505 OUT
="darwin64-ppc-cc"
510 ISA64
=`(sysctl -n hw.optional.x86_64) 2>/dev/null`
511 if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
512 echo "WARNING! If you wish to build 64-bit library, then you have to"
513 echo " invoke './Configure darwin64-x86_64-cc $options' *manually*."
514 if [ "$TEST" = "false" -a -t 1 ]; then
515 echo " You have about 5 seconds to press Ctrl-C to abort."
516 # The stty technique used elsewhere doesn't work on
517 # MacOS. At least, right now on this Mac.
521 if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
522 OUT
="darwin64-x86_64-cc"
527 options
="$options -arch%20armv6 -arch%20armv7"
528 OUT
="iphoneos-cross" ;;
530 options
="$options -arch%20${MACHINE}"
531 OUT
="iphoneos-cross" ;;
532 arm64-
*-iphoneos|
*-*-ios64)
535 ISA
=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
536 case ${ISA:-generic} in
537 *[678]) OUT
="linux-alpha+bwx-$CC" ;;
538 *) OUT
="linux-alpha-$CC" ;;
540 if [ "$CC" = "gcc" ]; then
541 case ${ISA:-generic} in
542 EV5|EV45
) options
="$options -mcpu=ev5";;
543 EV56|PCA56
) options
="$options -mcpu=ev56";;
544 *) options
="$options -mcpu=ev6";;
549 if [ -z "$KERNEL_BITS" ]; then
550 echo "WARNING! If you wish to build 64-bit library, then you have to"
551 echo " invoke './Configure linux-ppc64' *manually*."
552 if [ "$TEST" = "false" -a -t 1 ]; then
553 echo " You have about 5 seconds to press Ctrl-C to abort."
554 (trap "stty `stty -g`" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
557 if [ "$KERNEL_BITS" = "64" ]; then
561 (echo "__LP64__" | gcc
-E -x c
- 2>/dev
/null |
grep "^__LP64__" 2>&1 > /dev
/null
) || options
="$options -m32"
564 ppc64le-
*-linux2) OUT
="linux-ppc64le" ;;
565 ppc-
*-linux2) OUT
="linux-ppc" ;;
567 echo "WARNING! If you wish to build 64-bit library, then you have to"
568 echo " invoke './Configure linux64-mips64' *manually*."
569 if [ "$TEST" = "false" -a -t 1 ]; then
570 echo " You have about 5 seconds to press Ctrl-C to abort."
571 (trap "stty `stty -g`" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
575 mips
*-*-linux2) OUT
="linux-mips32" ;;
576 ppc60x-
*-vxworks*) OUT
="vxworks-ppc60x" ;;
577 ppcgen-
*-vxworks*) OUT
="vxworks-ppcgen" ;;
578 pentium-
*-vxworks*) OUT
="vxworks-pentium" ;;
579 simlinux-
*-vxworks*) OUT
="vxworks-simlinux" ;;
580 mips-
*-vxworks*) OUT
="vxworks-mips";;
581 ia64-
*-linux?
) OUT
="linux-ia64" ;;
583 echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
584 echo " and wish to build 64-bit library, then you have to"
585 echo " invoke './Configure linux64-sparcv9' *manually*."
586 if [ "$TEST" = "false" -a -t 1 ]; then
587 echo " You have about 5 seconds to press Ctrl-C to abort."
588 (trap "stty `stty -g`" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
590 OUT
="linux-sparcv9" ;;
592 KARCH
=`awk '/^type/{print$3;exit(0);}' /proc/cpuinfo`
593 case ${KARCH:-sun4} in
594 sun4u
*) OUT
="linux-sparcv9" ;;
595 sun4m
) OUT
="linux-sparcv8" ;;
596 sun4d
) OUT
="linux-sparcv8" ;;
597 *) OUT
="linux-generic32"; options
="$options -DB_ENDIAN" ;;
600 # 64-bit builds under parisc64 linux are not supported and
601 # compiler is expected to generate 32-bit objects...
602 CPUARCH
=`awk '/cpu family/{print substr($5,1,3); exit(0);}' /proc/cpuinfo`
603 CPUSCHEDULE
=`awk '/^cpu.[ ]*: PA/{print substr($3,3); exit(0);}' /proc/cpuinfo`
605 # ??TODO ?? Model transformations
606 # 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
607 # assuming no further arch. identification will ever be used by GCC.
608 # 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
609 # 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
610 # for these chips in the future.
611 # PA7300LC -> 7100LC (1.1)
612 # PA8200 -> 8000 (2.0)
613 # PA8500 -> 8000 (2.0)
614 # PA8600 -> 8000 (2.0)
616 CPUSCHEDULE
=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8.00/8000/'`
617 # Finish Model transformations
619 options
="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
620 OUT
="linux-generic32" ;;
621 armv
[1-3]*-*-linux2) OUT
="linux-generic32" ;;
622 armv
[7-9]*-*-linux2) OUT
="linux-armv4"; options
="$options -march=armv7-a" ;;
623 arm
*-*-linux2) OUT
="linux-armv4" ;;
624 aarch64-
*-linux2) OUT
="linux-aarch64" ;;
625 sh
*b-
*-linux2) OUT
="linux-generic32"; options
="$options -DB_ENDIAN" ;;
626 sh
*-*-linux2) OUT
="linux-generic32"; options
="$options -DL_ENDIAN" ;;
627 m68k
*-*-linux2) OUT
="linux-generic32"; options
="$options -DB_ENDIAN" ;;
628 s390-
*-linux2) OUT
="linux-generic32"; options
="$options -DB_ENDIAN" ;;
630 # To be uncommented when glibc bug is fixed, see Configure...
631 #if egrep -e '^features.* highgprs' /proc/cpuinfo >/dev/null ; then
632 # echo "WARNING! If you wish to build \"highgprs\" 32-bit library, then you"
633 # echo " have to invoke './Configure linux32-s390x' *manually*."
634 # if [ "$TEST" = "false" -a -t -1 ]; then
635 # echo " You have about 5 seconds to press Ctrl-C to abort."
636 # (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
641 x86_64-
*-linux?
) OUT
="linux-x86_64" ;;
642 *86-*-linux2) OUT
="linux-elf"
643 if [ "$GCCVER" -gt 28 ]; then
644 if grep '^model.*Pentium' /proc
/cpuinfo
>/dev
/null
; then
645 options
="$options -march=pentium"
647 if grep '^model.*Pentium Pro' /proc
/cpuinfo
>/dev
/null
; then
648 options
="$options -march=pentiumpro"
650 if grep '^model.*K6' /proc
/cpuinfo
>/dev
/null
; then
651 options
="$options -march=k6"
654 *-*-linux1) OUT
="linux-aout" ;;
655 *-*-linux2) OUT
="linux-generic32" ;;
656 sun4
[uv
]*-*-solaris2)
657 OUT
="solaris-sparcv9-$CC"
658 ISA64
=`(isainfo) 2>/dev/null | grep sparcv9`
659 if [ "$ISA64" != "" -a "$KERNEL_BITS" = "" ]; then
660 if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
661 echo "WARNING! If you wish to build 64-bit library, then you have to"
662 echo " invoke './Configure solaris64-sparcv9-cc' *manually*."
663 if [ "$TEST" = "false" -a -t 1 ]; then
664 echo " You have about 5 seconds to press Ctrl-C to abort."
665 (trap "stty `stty -g`" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
667 elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
668 # $GCC_ARCH denotes default ABI chosen by compiler driver
669 # (first one found on the $PATH). I assume that user
670 # expects certain consistency with the rest of his builds
671 # and therefore switch over to 64-bit. <appro>
672 OUT
="solaris64-sparcv9-gcc"
673 echo "WARNING! If you wish to build 32-bit library, then you have to"
674 echo " invoke './Configure solaris-sparcv9-gcc' *manually*."
675 if [ "$TEST" = "false" -a -t 1 ]; then
676 echo " You have about 5 seconds to press Ctrl-C to abort."
677 (trap "stty `stty -g`" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
679 elif [ "$GCC_ARCH" = "-m32" ]; then
680 echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
681 echo " and wish to build 64-bit library, then you have to"
682 echo " invoke './Configure solaris64-sparcv9-gcc' *manually*."
683 if [ "$TEST" = "false" -a -t 1 ]; then
684 echo " You have about 5 seconds to press Ctrl-C to abort."
685 (trap "stty `stty -g`" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
689 if [ "$ISA64" != "" -a "$KERNEL_BITS" = "64" ]; then
690 OUT
="solaris64-sparcv9-$CC"
693 sun4m-
*-solaris2) OUT
="solaris-sparcv8-$CC" ;;
694 sun4d-
*-solaris2) OUT
="solaris-sparcv8-$CC" ;;
695 sun4
*-*-solaris2) OUT
="solaris-sparcv7-$CC" ;;
697 ISA64
=`(isainfo) 2>/dev/null | grep amd64`
698 if [ "$ISA64" != "" -a ${KERNEL_BITS:-64} -eq 64 ]; then
699 OUT
="solaris64-x86_64-$CC"
701 OUT
="solaris-x86-$CC"
702 if [ `uname -r | sed -e 's/5\.//'` -lt 10 ]; then
703 options
="$options no-sse2"
707 *-*-sunos4) OUT
="sunos-$CC" ;;
709 *86*-*-bsdi4) OUT
="BSD-x86-elf"; options
="$options no-sse2 -ldl" ;;
710 alpha
*-*-*bsd
*) OUT
="BSD-generic64"; options
="$options -DL_ENDIAN" ;;
711 powerpc64-
*-*bsd
*) OUT
="BSD-generic64"; options
="$options -DB_ENDIAN" ;;
712 sparc64-
*-*bsd
*) OUT
="BSD-sparc64" ;;
713 ia64-
*-*bsd
*) OUT
="BSD-ia64" ;;
714 amd64-
*-*bsd
*) OUT
="BSD-x86_64" ;;
715 *86*-*-*bsd
*) # mimic ld behaviour when it's looking for libc...
716 if [ -L /usr
/lib
/libc.so
]; then # [Free|Net]BSD
717 libc
=/usr
/lib
/libc.so
719 # ld searches for highest libc.so.* and so do we
720 libc
=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`
722 case "`(file -L $libc) 2>/dev/null`" in
723 *ELF
*) OUT
="BSD-x86-elf" ;;
724 *) OUT
="BSD-x86"; options
="$options no-sse2" ;;
726 *-*-*bsd
*) OUT
="BSD-generic32" ;;
728 *-*-osf) OUT
="osf1-alpha-cc" ;;
729 *-*-tru64) OUT
="tru64-alpha-cc" ;;
731 if [ "$CC" = "gcc" ]; then
732 OUT
="unixware-7-gcc" ; options
="$options no-sse2"
734 OUT
="unixware-7" ; options
="$options no-sse2 -D__i386__"
737 *-*-[Uu
]nix
[Ww
]are20
*) OUT
="unixware-2.0"; options
="$options no-sse2 no-sha512" ;;
738 *-*-[Uu
]nix
[Ww
]are21
*) OUT
="unixware-2.1"; options
="$options no-sse2 no-sha512" ;;
740 options
="$options no-threads no-shared no-asm no-dso"
743 BS2000-siemens-sysv4
) OUT
="BS2000-OSD" ;;
745 if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
746 OUT
="hpux64-parisc2-gcc"
748 [ "$KERNEL_BITS" ] || KERNEL_BITS
=`(getconf KERNEL_BITS) 2>/dev/null`
749 KERNEL_BITS
=${KERNEL_BITS:-32}
750 CPU_VERSION
=`(getconf CPU_VERSION) 2>/dev/null`
751 CPU_VERSION
=${CPU_VERSION:-0}
752 # See <sys/unistd.h> for further info on CPU_VERSION.
753 if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
754 if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
759 elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
760 OUT
=${OUT:-"hpux-parisc2-${CC}"}
761 if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
762 echo "WARNING! If you wish to build 64-bit library then you have to"
763 echo " invoke './Configure hpux64-parisc2-cc' *manually*."
764 if [ "$TEST" = "false" -a -t 1 ]; then
765 echo " You have about 5 seconds to press Ctrl-C to abort."
766 (trap "stty `stty -g`" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
769 elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU
770 OUT
="hpux-parisc-${CC}"
771 elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU
772 OUT
="hpux-parisc-${CC}"
773 else # Motorola(?) CPU
776 options
="$options -D_REENTRANT" ;;
777 *-hpux) OUT
="hpux-parisc-$CC" ;;
779 [ "$KERNEL_BITS" ] || KERNEL_BITS
=`(getconf KERNEL_BITMODE) 2>/dev/null`
780 KERNEL_BITS
=${KERNEL_BITS:-32}
781 OBJECT_MODE
=${OBJECT_MODE:-32}
782 if [ "$CC" = "gcc" ]; then
784 if [ $OBJECT_MODE -eq 64 ]; then
785 echo 'Your $OBJECT_MODE was found to be set to 64'
788 elif [ $OBJECT_MODE -eq 64 ]; then
789 echo 'Your $OBJECT_MODE was found to be set to 64'
793 if [ $KERNEL_BITS -eq 64 ]; then
794 echo "WARNING! If you wish to build 64-bit kit, then you have to"
795 echo " invoke './Configure aix64-cc' *manually*."
796 if [ "$TEST" = "false" -a -t 1 ]; then
797 echo " You have ~5 seconds to press Ctrl-C to abort."
798 (trap "stty `stty -g`" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
802 if (lsattr
-E -O -l `lsdev -c processor|awk '{print$1;exit}'` |
grep -i powerpc
) >/dev
/null
2>&1; then
803 : # this applies even to Power3 and later, as they return PowerPC_POWER[345]
805 options
="$options no-asm"
808 # these are all covered by the catchall below
809 i
[3456]86-*-cygwin) OUT
="Cygwin-x86" ;;
810 *-*-cygwin) OUT
="Cygwin-${MACHINE}" ;;
811 x86pc-
*-qnx6) OUT
="QNX6-i386" ;;
812 *-*-qnx6) OUT
="QNX6" ;;
813 x86-
*-android|i?
86-*-android) OUT
="android-x86" ;;
814 armv
[7-9]*-*-android) OUT
="android-armv7" ;;
815 *) OUT
=`echo $GUESSOS | awk -F- '{print $3}'`;;
818 # NB: This atalla support has been superseded by the ENGINE support
819 # That contains its own header and definitions anyway. Support can
820 # be enabled or disabled on any supported platform without external
821 # headers, eg. by adding the "hw-atalla" switch to ./config or
824 # See whether we can compile Atalla support
825 #if [ -f /usr/include/atasi.h ]
827 # options="$options -DATALLA"
830 if [ -n "$CONFIG_OPTIONS" ]; then
831 options
="$options $CONFIG_OPTIONS"
834 if expr "$options" : '.*no\-asm' > /dev
/null
; then :; else
835 sh
-c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \
836 grep \\--noexecstack >/dev
/null
&& \
837 options
="$options -Wa,--noexecstack"
840 # gcc < 2.8 does not support -march=ultrasparc
841 if [ "$OUT" = solaris-sparcv9-gcc
-a $GCCVER -lt 28 ]
843 echo "WARNING! Falling down to 'solaris-sparcv8-gcc'."
844 echo " Upgrade to gcc-2.8 or later."
846 OUT
=solaris-sparcv8-gcc
848 if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ]
850 echo "WARNING! Falling down to 'linux-sparcv8'."
851 echo " Upgrade to gcc-2.8 or later."
857 i386-
*) options
="$options 386" ;;
860 for i
in aes bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha
862 if [ ! -d crypto
/$i ]
864 options
="$options no-$i"
868 if [ -z "$OUT" ]; then
872 if [ ".$PERL" = .
] ; then
873 for i
in .
`echo $PATH | sed 's/:/ /g'`; do
874 if [ -f "$i/perl5$EXE" ] ; then
881 if [ ".$PERL" = .
] ; then
882 for i
in .
`echo $PATH | sed 's/:/ /g'`; do
883 if [ -f "$i/perl$EXE" ] ; then
884 if "$i/perl$EXE" -e 'exit($]<5.0)'; then
892 if [ ".$PERL" = .
] ; then
893 echo "You need Perl 5."
897 # run Configure to check to see if we need to specify the
898 # compiler for the platform ... in which case we add it on
899 # the end ... otherwise we leave it off
901 $PERL .
/Configure LIST |
grep "$OUT-$CC" > /dev
/null
902 if [ $?
= "0" ]; then
908 $PERL .
/Configure LIST |
grep "$OUT" > /dev
/null
909 if [ $?
= "0" ]; then
910 echo Configuring
for $OUT
912 if [ "$TEST" = "true" ]; then
913 echo $PERL .
/Configure
$OUT $options
915 $PERL .
/Configure
$OUT $options
918 echo "This system ($OUT) is not supported. See file INSTALL for details."