OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 # | 2 # |
3 # OpenSSL config: determine the operating system and run ./Configure | 3 # OpenSSL config: determine the operating system and run ./Configure |
4 # | 4 # |
5 # "config -h" for usage information. | 5 # "config -h" for usage information. |
6 # | 6 # |
7 # this is a merge of minarch and GuessOS from the Apache Group. | 7 # this is a merge of minarch and GuessOS from the Apache Group. |
8 # Originally written by Tim Hudson <tjh@cryptsoft.com>. | 8 # Originally written by Tim Hudson <tjh@cryptsoft.com>. |
9 | 9 |
10 # Original Apache Group comments on GuessOS | 10 # Original Apache Group comments on GuessOS |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 PREFIX="" | 23 PREFIX="" |
24 SUFFIX="" | 24 SUFFIX="" |
25 TEST="false" | 25 TEST="false" |
26 EXE="" | 26 EXE="" |
27 | 27 |
28 # pick up any command line args to config | 28 # pick up any command line args to config |
29 for i | 29 for i |
30 do | 30 do |
31 case "$i" in | 31 case "$i" in |
32 -d) PREFIX="debug-";; | 32 -d*) PREFIX="debug-";; |
33 -t*) TEST="true";; | 33 -t*) TEST="true";; |
34 -h*) TEST="true"; cat <<EOF | 34 -h*) TEST="true"; cat <<EOF |
35 Usage: config [options] | 35 Usage: config [options] |
36 -d Add a debug- prefix to machine choice. | 36 -d Add a debug- prefix to machine choice. |
37 -t Test mode, do not run the Configure perl script. | 37 -t Test mode, do not run the Configure perl script. |
38 -h This help. | 38 -h This help. |
39 | 39 |
40 Any other text will be passed to the Configure perl script. | 40 Any other text will be passed to the Configure perl script. |
41 See INSTALL for instructions. | 41 See INSTALL for instructions. |
42 | 42 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 ;; | 115 ;; |
116 | 116 |
117 AIX:*:[5-9]:*) | 117 AIX:*:[5-9]:*) |
118 echo "${MACHINE}-ibm-aix"; exit 0 | 118 echo "${MACHINE}-ibm-aix"; exit 0 |
119 ;; | 119 ;; |
120 | 120 |
121 AIX:*) | 121 AIX:*) |
122 echo "${MACHINE}-ibm-aix3"; exit 0 | 122 echo "${MACHINE}-ibm-aix3"; exit 0 |
123 ;; | 123 ;; |
124 | 124 |
| 125 BeOS:*:BePC) |
| 126 if [ -e /boot/develop/headers/be/bone ]; then |
| 127 echo "beos-x86-bone"; exit 0 |
| 128 else |
| 129 echo "beos-x86-r5"; exit 0 |
| 130 fi |
| 131 ;; |
| 132 |
125 dgux:*) | 133 dgux:*) |
126 echo "${MACHINE}-dg-dgux"; exit 0 | 134 echo "${MACHINE}-dg-dgux"; exit 0 |
127 ;; | 135 ;; |
128 | 136 |
129 HI-UX:*) | 137 HI-UX:*) |
130 echo "${MACHINE}-hi-hiux"; exit 0 | 138 echo "${MACHINE}-hi-hiux"; exit 0 |
131 ;; | 139 ;; |
132 | 140 |
133 HP-UX:*) | 141 HP-UX:*) |
134 HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` | 142 HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 Rhapsody:*) | 271 Rhapsody:*) |
264 echo "ppc-apple-rhapsody"; exit 0 | 272 echo "ppc-apple-rhapsody"; exit 0 |
265 ;; | 273 ;; |
266 | 274 |
267 Darwin:*) | 275 Darwin:*) |
268 case "$MACHINE" in | 276 case "$MACHINE" in |
269 Power*) | 277 Power*) |
270 echo "ppc-apple-darwin${VERSION}" | 278 echo "ppc-apple-darwin${VERSION}" |
271 ;; | 279 ;; |
272 *) | 280 *) |
273 » » echo "i386-apple-darwin${VERSION}" | 281 » » echo "i686-apple-darwin${VERSION}" |
274 ;; | 282 ;; |
275 esac | 283 esac |
276 exit 0 | 284 exit 0 |
277 ;; | 285 ;; |
278 | 286 |
279 SunOS:5.*) | 287 SunOS:5.*) |
280 echo "${MACHINE}-whatever-solaris2"; exit 0 | 288 echo "${MACHINE}-whatever-solaris2"; exit 0 |
281 ;; | 289 ;; |
282 | 290 |
283 SunOS:*) | 291 SunOS:*) |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 | 489 |
482 # read the output of the embedded GuessOS | 490 # read the output of the embedded GuessOS |
483 read GUESSOS | 491 read GUESSOS |
484 | 492 |
485 echo Operating system: $GUESSOS | 493 echo Operating system: $GUESSOS |
486 | 494 |
487 # now map the output into SSLeay terms ... really should hack into the | 495 # now map the output into SSLeay terms ... really should hack into the |
488 # script above so we end up with values in vars but that would take | 496 # script above so we end up with values in vars but that would take |
489 # more time that I want to waste at the moment | 497 # more time that I want to waste at the moment |
490 case "$GUESSOS" in | 498 case "$GUESSOS" in |
| 499 uClinux*64*) |
| 500 OUT=uClinux-dist64 |
| 501 ;; |
| 502 uClinux*) |
| 503 OUT=uClinux-dist |
| 504 ;; |
491 mips2-sgi-irix) | 505 mips2-sgi-irix) |
492 CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).
*/\1/'` | 506 CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).
*/\1/'` |
493 CPU=${CPU:-0} | 507 CPU=${CPU:-0} |
494 if [ $CPU -ge 4000 ]; then | 508 if [ $CPU -ge 4000 ]; then |
495 options="$options -mips2" | 509 options="$options -mips2" |
496 fi | 510 fi |
497 OUT="irix-$CC" | 511 OUT="irix-$CC" |
498 ;; | 512 ;; |
499 mips3-sgi-irix) | 513 mips3-sgi-irix) |
500 #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\)
.*/\1/'` | 514 #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\)
.*/\1/'` |
(...skipping 15 matching lines...) Expand all Loading... |
516 #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\)
.*/\1/'` | 530 #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\)
.*/\1/'` |
517 #CPU=${CPU:-0} | 531 #CPU=${CPU:-0} |
518 #if [ $CPU -ge 5000 ]; then | 532 #if [ $CPU -ge 5000 ]; then |
519 # options="$options -mips4" | 533 # options="$options -mips4" |
520 #else | 534 #else |
521 # options="$options -mips3" | 535 # options="$options -mips3" |
522 #fi | 536 #fi |
523 OUT="irix-mips3-$CC" | 537 OUT="irix-mips3-$CC" |
524 ;; | 538 ;; |
525 ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;; | 539 ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;; |
526 ppc-apple-darwin*) OUT="darwin-ppc-cc" ;; | 540 ppc-apple-darwin*) |
527 i386-apple-darwin*) OUT="darwin-i386-cc" ;; | 541 » ISA64=`(sysctl -n hw.optional.64bitops) 2>/dev/null` |
| 542 » if [ "$ISA64" = "1" ]; then |
| 543 » echo "WARNING! If you wish to build 64-bit library, then you have to
" |
| 544 » echo " invoke './Configure darwin64-ppc-cc' *manually*." |
| 545 » if [ "$TEST" = "false" -a -t 1 ]; then |
| 546 » echo " You have about 5 seconds to press Ctrl-C to abort." |
| 547 » (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste
) <&1 |
| 548 » fi |
| 549 » fi |
| 550 » OUT="darwin-ppc-cc" ;; |
| 551 i?86-apple-darwin*) |
| 552 » ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null` |
| 553 » if [ "$ISA64" = "1" ]; then |
| 554 » echo "WARNING! If you wish to build 64-bit library, then you have to
" |
| 555 » echo " invoke './Configure darwin64-x86_64-cc' *manually*." |
| 556 » if [ "$TEST" = "false" -a -t 1 ]; then |
| 557 » echo " You have about 5 seconds to press Ctrl-C to abort." |
| 558 » (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste
) <&1 |
| 559 » fi |
| 560 » fi |
| 561 » OUT="darwin-i386-cc" ;; |
528 alpha-*-linux2) | 562 alpha-*-linux2) |
529 ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo` | 563 ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo` |
530 case ${ISA:-generic} in | 564 case ${ISA:-generic} in |
531 *[678]) OUT="linux-alpha+bwx-$CC" ;; | 565 *[678]) OUT="linux-alpha+bwx-$CC" ;; |
532 *) OUT="linux-alpha-$CC" ;; | 566 *) OUT="linux-alpha-$CC" ;; |
533 esac | 567 esac |
534 if [ "$CC" = "gcc" ]; then | 568 if [ "$CC" = "gcc" ]; then |
535 case ${ISA:-generic} in | 569 case ${ISA:-generic} in |
536 EV5|EV45) options="$options -mcpu=ev5";; | 570 EV5|EV45) options="$options -mcpu=ev5";; |
537 EV56|PCA56) options="$options -mcpu=ev56";; | 571 EV56|PCA56) options="$options -mcpu=ev56";; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 # PA7300LC -> 7100LC (1.1) | 616 # PA7300LC -> 7100LC (1.1) |
583 # PA8200 -> 8000 (2.0) | 617 # PA8200 -> 8000 (2.0) |
584 # PA8500 -> 8000 (2.0) | 618 # PA8500 -> 8000 (2.0) |
585 # PA8600 -> 8000 (2.0) | 619 # PA8600 -> 8000 (2.0) |
586 | 620 |
587 CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8.00/8000
/'` | 621 CPUSCHEDULE=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8.00/8000
/'` |
588 # Finish Model transformations | 622 # Finish Model transformations |
589 | 623 |
590 options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH" | 624 options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH" |
591 OUT="linux-generic32" ;; | 625 OUT="linux-generic32" ;; |
592 arm*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; | 626 armv[1-3]*-*-linux2) OUT="linux-generic32" ;; |
593 arm*l-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;; | 627 arm*-*-linux2) OUT="linux-armv4" ;; |
594 sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; | 628 sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; |
595 sh*-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;; | 629 sh*-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;; |
596 m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; | 630 m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; |
597 s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN -DNO_ASM" ;
; | 631 s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; |
598 s390x-*-linux2) OUT="linux-generic64"; options="$options -DB_ENDIAN" ;; | 632 s390x-*-linux2) OUT="linux-s390x" ;; |
599 x86_64-*-linux?) OUT="linux-x86_64" ;; | 633 x86_64-*-linux?) OUT="linux-x86_64" ;; |
600 *86-*-linux2) OUT="linux-elf" | 634 *86-*-linux2) OUT="linux-elf" |
601 if [ "$GCCVER" -gt 28 ]; then | 635 if [ "$GCCVER" -gt 28 ]; then |
602 if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then | 636 if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then |
603 options="$options -march=pentium" | 637 options="$options -march=pentium" |
604 fi | 638 fi |
605 if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then | 639 if grep '^model.*Pentium Pro' /proc/cpuinfo >/dev/null ; then |
606 options="$options -march=pentiumpro" | 640 options="$options -march=pentiumpro" |
607 fi | 641 fi |
608 if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then | 642 if grep '^model.*K6' /proc/cpuinfo >/dev/null ; then |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 fi | 800 fi |
767 ;; | 801 ;; |
768 # these are all covered by the catchall below | 802 # these are all covered by the catchall below |
769 # *-dgux) OUT="dgux" ;; | 803 # *-dgux) OUT="dgux" ;; |
770 mips-sony-newsos4) OUT="newsos4-gcc" ;; | 804 mips-sony-newsos4) OUT="newsos4-gcc" ;; |
771 *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;; | 805 *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;; |
772 *-*-cygwin) OUT="Cygwin" ;; | 806 *-*-cygwin) OUT="Cygwin" ;; |
773 t3e-cray-unicosmk) OUT="cray-t3e" ;; | 807 t3e-cray-unicosmk) OUT="cray-t3e" ;; |
774 j90-cray-unicos) OUT="cray-j90" ;; | 808 j90-cray-unicos) OUT="cray-j90" ;; |
775 nsr-tandem-nsk) OUT="tandem-c89" ;; | 809 nsr-tandem-nsk) OUT="tandem-c89" ;; |
| 810 beos-*) OUT="$GUESSOS" ;; |
776 x86pc-*-qnx6) OUT="QNX6-i386" ;; | 811 x86pc-*-qnx6) OUT="QNX6-i386" ;; |
777 *-*-qnx6) OUT="QNX6" ;; | 812 *-*-qnx6) OUT="QNX6" ;; |
778 *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;; | 813 *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;; |
779 esac | 814 esac |
780 | 815 |
781 # NB: This atalla support has been superceded by the ENGINE support | 816 # NB: This atalla support has been superceded by the ENGINE support |
782 # That contains its own header and definitions anyway. Support can | 817 # That contains its own header and definitions anyway. Support can |
783 # be enabled or disabled on any supported platform without external | 818 # be enabled or disabled on any supported platform without external |
784 # headers, eg. by adding the "hw-atalla" switch to ./config or | 819 # headers, eg. by adding the "hw-atalla" switch to ./config or |
785 # perl Configure | 820 # perl Configure |
786 # | 821 # |
787 # See whether we can compile Atalla support | 822 # See whether we can compile Atalla support |
788 #if [ -f /usr/include/atasi.h ] | 823 #if [ -f /usr/include/atasi.h ] |
789 #then | 824 #then |
790 # options="$options -DATALLA" | 825 # options="$options -DATALLA" |
791 #fi | 826 #fi |
792 | 827 |
| 828 ($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \ |
| 829 grep \\--noexecstack) 2>&1 > /dev/null && \ |
| 830 options="$options -Wa,--noexecstack" |
| 831 |
793 # gcc < 2.8 does not support -march=ultrasparc | 832 # gcc < 2.8 does not support -march=ultrasparc |
794 if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ] | 833 if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ] |
795 then | 834 then |
796 echo "WARNING! Falling down to 'solaris-sparcv8-gcc'." | 835 echo "WARNING! Falling down to 'solaris-sparcv8-gcc'." |
797 echo " Upgrade to gcc-2.8 or later." | 836 echo " Upgrade to gcc-2.8 or later." |
798 sleep 5 | 837 sleep 5 |
799 OUT=solaris-sparcv8-gcc | 838 OUT=solaris-sparcv8-gcc |
800 fi | 839 fi |
801 if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ] | 840 if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ] |
802 then | 841 then |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 | 924 |
886 if [ "$TEST" = "true" ]; then | 925 if [ "$TEST" = "true" ]; then |
887 echo $PERL ./Configure $OUT $options | 926 echo $PERL ./Configure $OUT $options |
888 else | 927 else |
889 $PERL ./Configure $OUT $options | 928 $PERL ./Configure $OUT $options |
890 fi | 929 fi |
891 else | 930 else |
892 echo "This system ($OUT) is not supported. See file INSTALL for details." | 931 echo "This system ($OUT) is not supported. See file INSTALL for details." |
893 fi | 932 fi |
894 ) | 933 ) |
OLD | NEW |