summaryrefslogtreecommitdiff
path: root/src/lib/libssl/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/src/config')
-rw-r--r--src/lib/libssl/src/config199
1 files changed, 78 insertions, 121 deletions
diff --git a/src/lib/libssl/src/config b/src/lib/libssl/src/config
index c2f504f59e..dde9275b76 100644
--- a/src/lib/libssl/src/config
+++ b/src/lib/libssl/src/config
@@ -54,22 +54,6 @@ SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown"
54VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" 54VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"
55 55
56 56
57
58
59
60# Check for VC++ presence first.
61#
62#if [ "x$MSVCDIR" != "x" -o "x$VCINSTALLDIR" != "x" ]; then
63# perl Configure VC-WIN32 $*
64# cmd /c ms\\do_masm.bat
65# perl util/mk1mf.pl VC-WIN32-GMAKE >mak.tmp
66# rm Makefile
67# mv mak.tmp Makefile
68# echo "Configured for VC++ using GNU make"
69# exit 0
70#fi
71#
72
73# Now test for ISC and SCO, since it is has a braindamaged uname. 57# Now test for ISC and SCO, since it is has a braindamaged uname.
74# 58#
75# We need to work around FreeBSD 1.1.5.1 59# We need to work around FreeBSD 1.1.5.1
@@ -98,9 +82,9 @@ if [ "x$XREL" != "x" ]; then
98 esac 82 esac
99 ;; 83 ;;
100 4.2) 84 4.2)
101 echo "i386-whatever-unixware1"; exit 0 85 echo "whatever-whatever-unixware1"; exit 0
102 ;; 86 ;;
103 5) 87 5*)
104 case "x${VERSION}" in 88 case "x${VERSION}" in
105 # We hardcode i586 in place of ${MACHINE} for the 89 # We hardcode i586 in place of ${MACHINE} for the
106 # following reason. The catch is that even though Pentium 90 # following reason. The catch is that even though Pentium
@@ -109,8 +93,7 @@ if [ "x$XREL" != "x" ]; then
109 # with i386 is that it makes ./config pass 386 to 93 # with i386 is that it makes ./config pass 386 to
110 # ./Configure, which in turn makes make generate 94 # ./Configure, which in turn makes make generate
111 # inefficient SHA-1 (for this moment) code. 95 # inefficient SHA-1 (for this moment) code.
112 x7*) echo "i586-sco-unixware7"; exit 0 ;; 96 x[678]*) echo "i586-sco-unixware7"; exit 0 ;;
113 x8*) echo "i586-unkn-OpenUNIX${VERSION}"; exit 0 ;;
114 esac 97 esac
115 ;; 98 ;;
116 esac 99 esac
@@ -354,11 +337,7 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
354 ;; 337 ;;
355 338
356 MINGW*) 339 MINGW*)
357 echo "${MACHINE}-whatever-mingw"; echo 0; 340 echo "${MACHINE}-whatever-mingw"; exit 0;
358 # Save fipslib path so VC++ build can find it
359 (cd /usr/local/ssl/lib ; pwd -W ) > util/fipslib_path.txt
360 # Extract _chkstk.o so VC++ can use it, to avoid __alloca link error
361 (cd ms ; ar x `gcc -print-libgcc-file-name` _chkstk.o)
362 ;; 341 ;;
363 CYGWIN*) 342 CYGWIN*)
364 case "$RELEASE" in 343 case "$RELEASE" in
@@ -472,8 +451,6 @@ if [ "$SYSTEM" = "SunOS" ]; then
472 echo " patch #107357-01 or later applied." 451 echo " patch #107357-01 or later applied."
473 sleep 5 452 sleep 5
474 fi 453 fi
475 elif [ "$CC" = "cc" -a $CCVER -gt 0 ]; then
476 CC=sc3
477 fi 454 fi
478fi 455fi
479 456
@@ -539,36 +516,23 @@ case "$GUESSOS" in
539 #fi 516 #fi
540 OUT="irix-mips3-$CC" 517 OUT="irix-mips3-$CC"
541 ;; 518 ;;
519 ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
520 ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
521 i386-apple-darwin*) OUT="darwin-i386-cc" ;;
542 alpha-*-linux2) 522 alpha-*-linux2)
543 ISA=`awk '/cpu model/{print$4}' /proc/cpuinfo` 523 ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
544 case ${ISA:-generic} in 524 case ${ISA:-generic} in
545 *[67]) OUT="linux-alpha+bwx-$CC" ;; 525 *[678]) OUT="linux-alpha+bwx-$CC" ;;
546 *) OUT="linux-alpha-$CC" ;; 526 *) OUT="linux-alpha-$CC" ;;
547 esac 527 esac
548 if [ "$CC" = "gcc" ]; then 528 if [ "$CC" = "gcc" ]; then
549 case ${ISA:-generic} in 529 case ${ISA:-generic} in
550 EV5|EV45) options="$options -mcpu=ev5";; 530 EV5|EV45) options="$options -mcpu=ev5";;
551 EV56|PCA56) options="$options -mcpu=ev56";; 531 EV56|PCA56) options="$options -mcpu=ev56";;
552 EV6|EV67|PCA57) options="$options -mcpu=ev6";; 532 *) options="$options -mcpu=ev6";;
553 esac 533 esac
554 fi 534 fi
555 ;; 535 ;;
556 mips-*-linux?)
557 cat >dummy.c <<EOF
558#include <stdio.h> /* for printf() prototype */
559 int main (argc, argv) int argc; char *argv[]; {
560#ifdef __MIPSEB__
561 printf ("linux-%s\n", argv[1]);
562#endif
563#ifdef __MIPSEL__
564 printf ("linux-%sel\n", argv[1]);
565#endif
566 return 0;
567}
568EOF
569 ${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
570 rm dummy dummy.c
571 ;;
572 ppc64-*-linux2) 536 ppc64-*-linux2)
573 echo "WARNING! If you wish to build 64-bit library, then you have to" 537 echo "WARNING! If you wish to build 64-bit library, then you have to"
574 echo " invoke './Configure linux-ppc64' *manually*." 538 echo " invoke './Configure linux-ppc64' *manually*."
@@ -579,11 +543,7 @@ EOF
579 OUT="linux-ppc" 543 OUT="linux-ppc"
580 ;; 544 ;;
581 ppc-*-linux2) OUT="linux-ppc" ;; 545 ppc-*-linux2) OUT="linux-ppc" ;;
582 m68k-*-linux*) OUT="linux-m68k" ;;
583 ia64-*-linux?) OUT="linux-ia64" ;; 546 ia64-*-linux?) OUT="linux-ia64" ;;
584 ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
585 ppc-apple-darwin*) OUT="darwin-ppc-cc" ;;
586 i386-apple-darwin*) OUT="darwin-i386-cc" ;;
587 sparc64-*-linux2) 547 sparc64-*-linux2)
588 echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI" 548 echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
589 echo " and wish to build 64-bit library, then you have to" 549 echo " and wish to build 64-bit library, then you have to"
@@ -594,16 +554,18 @@ EOF
594 fi 554 fi
595 OUT="linux-sparcv9" ;; 555 OUT="linux-sparcv9" ;;
596 sparc-*-linux2) 556 sparc-*-linux2)
597 KARCH=`awk '/^type/{print$3}' /proc/cpuinfo` 557 KARCH=`awk '/^type/{print$3;exit(0);}' /proc/cpuinfo`
598 case ${KARCH:-sun4} in 558 case ${KARCH:-sun4} in
599 sun4u*) OUT="linux-sparcv9" ;; 559 sun4u*) OUT="linux-sparcv9" ;;
600 sun4m) OUT="linux-sparcv8" ;; 560 sun4m) OUT="linux-sparcv8" ;;
601 sun4d) OUT="linux-sparcv8" ;; 561 sun4d) OUT="linux-sparcv8" ;;
602 *) OUT="linux-sparcv7" ;; 562 *) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
603 esac ;; 563 esac ;;
604 parisc-*-linux2) 564 parisc*-*-linux2)
605 CPUARCH=`awk '/cpu family/{print substr($5,1,3)}' /proc/cpuinfo` 565 # 64-bit builds under parisc64 linux are not supported and
606 CPUSCHEDULE=`awk '/^cpu.[ ]: PA/{print substr($3,3)}' /proc/cpuinfo` 566 # compiler is expected to generate 32-bit objects...
567 CPUARCH=`awk '/cpu family/{print substr($5,1,3); exit(0);}' /proc/cpuinfo`
568 CPUSCHEDULE=`awk '/^cpu.[ ]*: PA/{print substr($3,3); exit(0);}' /proc/cpuinfo`
607 569
608 # ??TODO ?? Model transformations 570 # ??TODO ?? Model transformations
609 # 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off 571 # 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
@@ -616,31 +578,34 @@ EOF
616 # PA8500 -> 8000 (2.0) 578 # PA8500 -> 8000 (2.0)
617 # PA8600 -> 8000 (2.0) 579 # PA8600 -> 8000 (2.0)
618 580
619 CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8?00/8000/'` 581 CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8.00/8000/'`
620 # Finish Model transformations 582 # Finish Model transformations
621 583
622 options="$options -mschedule=$CPUSCHEDULE -march=$CPUARCH" 584 options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH"
623 OUT="linux-parisc" ;; 585 OUT="linux-generic32" ;;
624 arm*b-*-linux2) OUT="linux-elf-arm"; options="$options -DB_ENDIAN" ;; 586 arm*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
625 arm*l-*-linux2) OUT="linux-elf-arm"; options="$options -DL_ENDIAN" ;; 587 arm*l-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
626 arm*-*-linux2) OUT="linux-elf-arm" ;; 588 sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
627 s390-*-linux2) OUT="linux-s390" ;; 589 sh*-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;;
628 s390x-*-linux?) OUT="linux-s390x" ;; 590 m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;;
591 s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN -DNO_ASM" ;;
592 s390x-*-linux2) OUT="linux-generic64"; options="$options -DB_ENDIAN" ;;
629 x86_64-*-linux?) OUT="linux-x86_64" ;; 593 x86_64-*-linux?) OUT="linux-x86_64" ;;
630 *-*-linux2) OUT="linux-elf" 594 *86-*-linux2) OUT="linux-elf"
631 if [ "$GCCVER" -gt 28 ]; then 595 if [ "$GCCVER" -gt 28 ]; then
632 if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then 596 if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
633 OUT="linux-pentium" 597 options="$options -march=pentium"
634 fi 598 fi
635 if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then 599 if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then
636 OUT="linux-ppro" 600 options="$options -march=pentiumpro"
637 fi 601 fi
638 if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then 602 if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then
639 OUT="linux-k6" 603 options="$options -march=k6"
640 fi 604 fi
641 fi ;; 605 fi ;;
642 *-*-linux1) OUT="linux-aout" ;; 606 *-*-linux1) OUT="linux-aout" ;;
643 sun4u*-*-solaris2) 607 *-*-linux2) OUT="linux-generic32" ;;
608 sun4[uv]*-*-solaris2)
644 OUT="solaris-sparcv9-$CC" 609 OUT="solaris-sparcv9-$CC"
645 ISA64=`(isalist) 2>/dev/null | grep sparcv9` 610 ISA64=`(isalist) 2>/dev/null | grep sparcv9`
646 if [ "$ISA64" != "" ]; then 611 if [ "$ISA64" != "" ]; then
@@ -683,48 +648,43 @@ EOF
683 OUT="solaris64-x86_64-$CC" 648 OUT="solaris64-x86_64-$CC"
684 else 649 else
685 OUT="solaris-x86-$CC" 650 OUT="solaris-x86-$CC"
651 if [ `uname -r | sed -e 's/5\.//'` -lt 10 ]; then
652 options="$options no-sse2"
653 fi
686 fi 654 fi
687 ;; 655 ;;
688 *-*-sunos4) OUT="sunos-$CC" ;; 656 *-*-sunos4) OUT="sunos-$CC" ;;
689 alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;; 657
690 sparc64-*-freebsd*) OUT="FreeBSD-sparc64" ;; 658 *86*-*-bsdi4) OUT="BSD-x86-elf"; options="$options no-sse2 -ldl" ;;
691 ia64-*-freebsd*) OUT="FreeBSD-ia64" ;; 659 alpha*-*-*bsd*) OUT="BSD-generic64"; options="$options -DL_ENDIAN" ;;
692 *-freebsd[3-9]*) OUT="FreeBSD-elf" ;; 660 powerpc64-*-*bsd*) OUT="BSD-generic64"; options="$options -DB_ENDIAN" ;;
693 *-freebsd[1-2]*) OUT="FreeBSD" ;; 661 sparc64-*-*bsd*) OUT="BSD-sparc64" ;;
694 *86*-*-netbsd) OUT="NetBSD-x86" ;; 662 ia64-*-*bsd*) OUT="BSD-ia64" ;;
695 sun3*-*-netbsd) OUT="NetBSD-m68" ;; 663 amd64-*-*bsd*) OUT="BSD-x86_64" ;;
696 *-*-netbsd) OUT="NetBSD-sparc" ;; 664 *86*-*-*bsd*) # mimic ld behaviour when it's looking for libc...
697 alpha*-*-openbsd) OUT="OpenBSD-alpha" ;; 665 if [ -L /usr/lib/libc.so ]; then # [Free|Net]BSD
698 *86*-*-openbsd) OUT="OpenBSD-i386" ;; 666 libc=/usr/lib/libc.so
699 m68k*-*-openbsd) OUT="OpenBSD-m68k" ;; 667 else # OpenBSD
700 m88k*-*-openbsd) OUT="OpenBSD-m88k" ;; 668 # ld searches for highest libc.so.* and so do we
701 mips*-*-openbsd) OUT="OpenBSD-mips" ;; 669 libc=`(ls /usr/lib/libc.so.* | tail -1) 2>/dev/null`
702 pmax*-*-openbsd) OUT="OpenBSD-mips" ;; 670 fi
703 powerpc*-*-openbsd) OUT="OpenBSD-powerpc" ;; 671 case "`(file -L $libc) 2>/dev/null`" in
704 sparc64*-*-openbsd) OUT="OpenBSD-sparc64" ;; 672 *ELF*) OUT="BSD-x86-elf" ;;
705 sparc*-*-openbsd) OUT="OpenBSD-sparc" ;; 673 *) OUT="BSD-x86"; options="$options no-sse2" ;;
706 vax*-*-openbsd) OUT="OpenBSD-vax" ;; 674 esac ;;
707 hppa*-*-openbsd) OUT="OpenBSD-hppa" ;; 675 *-*-*bsd*) OUT="BSD-generic32" ;;
708 *-*-openbsd) OUT="OpenBSD" ;; 676
709 *86*-*-bsdi4) OUT="bsdi-elf-gcc" ;; 677 *-*-osf) OUT="osf1-alpha-cc" ;;
710 *-*-osf) OUT="alphaold-cc" ;; 678 *-*-tru64) OUT="tru64-alpha-cc" ;;
711 *-*-tru64) OUT="alpha-cc" ;; 679 *-*-[Uu]nix[Ww]are7)
712 *-*-OpenUNIX*)
713 if [ "$CC" = "gcc" ]; then 680 if [ "$CC" = "gcc" ]; then
714 OUT="OpenUNIX-8-gcc" 681 OUT="unixware-7-gcc" ; options="$options no-sse2"
715 else 682 else
716 OUT="OpenUNIX-8" 683 OUT="unixware-7" ; options="$options no-sse2 -D__i386__"
717 fi 684 fi
718 ;; 685 ;;
719 *-*-unixware7) OUT="unixware-7" ;; 686 *-*-[Uu]nix[Ww]are20*) OUT="unixware-2.0"; options="$options no-sse2 no-sha512" ;;
720 *-*-UnixWare7) OUT="unixware-7" ;; 687 *-*-[Uu]nix[Ww]are21*) OUT="unixware-2.1"; options="$options no-sse2 no-sha512" ;;
721 *-*-Unixware7) OUT="unixware-7" ;;
722 *-*-unixware20*) OUT="unixware-2.0" ;;
723 *-*-unixware21*) OUT="unixware-2.1" ;;
724 *-*-UnixWare20*) OUT="unixware-2.0" ;;
725 *-*-UnixWare21*) OUT="unixware-2.1" ;;
726 *-*-Unixware20*) OUT="unixware-2.0" ;;
727 *-*-Unixware21*) OUT="unixware-2.1" ;;
728 *-*-vos) 688 *-*-vos)
729 options="$options no-threads no-shared no-asm no-dso" 689 options="$options no-threads no-shared no-asm no-dso"
730 EXE=".pm" 690 EXE=".pm"
@@ -733,15 +693,8 @@ EOF
733 RM*-siemens-sysv4) OUT="ReliantUNIX" ;; 693 RM*-siemens-sysv4) OUT="ReliantUNIX" ;;
734 *-siemens-sysv4) OUT="SINIX" ;; 694 *-siemens-sysv4) OUT="SINIX" ;;
735 *-hpux1*) 695 *-hpux1*)
736 if [ $CC = "gcc" ]; 696 if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
737 then
738 if [ $GCC_BITS = "64" ]; then
739 OUT="hpux64-parisc2-gcc" 697 OUT="hpux64-parisc2-gcc"
740 else
741 OUT="hpux-parisc-gcc"
742 fi
743 else
744 OUT="hpux-parisc-$CC"
745 fi 698 fi
746 KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null` 699 KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
747 KERNEL_BITS=${KERNEL_BITS:-32} 700 KERNEL_BITS=${KERNEL_BITS:-32}
@@ -758,9 +711,7 @@ EOF
758 fi 711 fi
759 OUT="hpux64-ia64-cc" 712 OUT="hpux64-ia64-cc"
760 elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU 713 elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
761 if [ "$CC" = "cc" ]; then 714 OUT=${OUT:-"hpux-parisc2-${CC}"}
762 OUT="hpux-parisc2-cc" # can't we have hpux-parisc2-gcc?
763 fi
764 if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then 715 if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
765 echo "WARNING! If you wish to build 64-bit library then you have to" 716 echo "WARNING! If you wish to build 64-bit library then you have to"
766 echo " invoke './Configure hpux64-parisc2-cc' *manually*." 717 echo " invoke './Configure hpux64-parisc2-cc' *manually*."
@@ -770,9 +721,9 @@ EOF
770 fi 721 fi
771 fi 722 fi
772 elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU 723 elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU
773 : 724 OUT="hpux-parisc-${CC}"
774 elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU 725 elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU
775 : 726 OUT="hpux-parisc-${CC}"
776 else # Motorola(?) CPU 727 else # Motorola(?) CPU
777 OUT="hpux-$CC" 728 OUT="hpux-$CC"
778 fi 729 fi
@@ -798,6 +749,11 @@ EOF
798 fi 749 fi
799 fi 750 fi
800 fi 751 fi
752 if (lsattr -E -O -l `lsdev -c processor|awk '{print$1;exit}'` | grep -i powerpc) >/dev/null 2>&1; then
753 : # this applies even to Power3 and later, as they return PowerPC_POWER[345]
754 else
755 options="$options no-asm"
756 fi
801 ;; 757 ;;
802 # these are all covered by the catchall below 758 # these are all covered by the catchall below
803 # *-dgux) OUT="dgux" ;; 759 # *-dgux) OUT="dgux" ;;
@@ -822,12 +778,13 @@ esac
822# options="$options -DATALLA" 778# options="$options -DATALLA"
823#fi 779#fi
824 780
825# gcc < 2.8 does not support -mcpu=ultrasparc 781# gcc < 2.8 does not support -march=ultrasparc
826if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ] 782if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
827then 783then
828 echo "WARNING! Do consider upgrading to gcc-2.8 or later." 784 echo "WARNING! Falling down to 'solaris-sparcv8-gcc'."
785 echo " Upgrade to gcc-2.8 or later."
829 sleep 5 786 sleep 5
830 OUT=solaris-sparcv9-gcc27 787 OUT=solaris-sparcv8-gcc
831fi 788fi
832if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ] 789if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ]
833then 790then
@@ -841,7 +798,7 @@ case "$GUESSOS" in
841 i386-*) options="$options 386" ;; 798 i386-*) options="$options 386" ;;
842esac 799esac
843 800
844for i in bf cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 aes ripemd rsa sha 801for i in aes bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha
845do 802do
846 if [ ! -d crypto/$i ] 803 if [ ! -d crypto/$i ]
847 then 804 then