2 # Copyright 1998-2019 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
9 # OpenSSL config: determine the operating system and run ./Configure
10 # Derived from minarch and GuessOS from Apache.
12 # Do "config -h" for usage information.
19 # pick up any command line args to config
23 -d*) options
=$options" --debug";;
24 -t*) DRYRUN
="true" VERBOSE
="true";;
26 -h*) DRYRUN
="true"; cat <<EOF
27 Usage: config [options]
28 -d Build with debugging when possible.
29 -t Test mode, do not run the Configure perl script.
30 -v Verbose mode, show the exact Configure call that is being made.
33 Any other text will be passed to the Configure perl script.
34 See INSTALL for instructions.
38 *) i
=`echo "$i" | sed -e "s|'|'\\\\\\''|g"`
39 options
="$options '$i'" ;;
43 # Environment that's being passed to Configure
52 # First get uname entries that we use below
54 [ "$MACHINE" ] || MACHINE
=`(uname -m) 2>/dev/null` || MACHINE
="unknown"
55 [ "$RELEASE" ] || RELEASE
=`(uname -r) 2>/dev/null` || RELEASE
="unknown"
56 [ "$SYSTEM" ] || SYSTEM
=`(uname -s) 2>/dev/null` || SYSTEM
="unknown"
57 [ "$BUILD" ] || VERSION
=`(uname -v) 2>/dev/null` || VERSION
="unknown"
60 # Now test for ISC and SCO, since it is has a braindamaged uname.
62 # We need to work around FreeBSD 1.1.5.1
64 XREL
=`uname -X 2>/dev/null | grep "^Release" | awk '{print $3}'`
65 if [ "x$XREL" != "x" ]; then
66 if [ -f /etc
/kconfig
]; then
69 echo "${MACHINE}-whatever-isc4"; exit 0
75 echo "whatever-whatever-sco3"; exit 0
78 echo "whatever-whatever-sco5"; exit 0
82 x2.0
*) echo "whatever-whatever-unixware20"; exit 0 ;;
83 x2.1
*) echo "whatever-whatever-unixware21"; exit 0 ;;
84 x2
*) echo "whatever-whatever-unixware2"; exit 0 ;;
88 echo "whatever-whatever-unixware1"; exit 0
92 # We hardcode i586 in place of ${MACHINE} for the
93 # following reason. The catch is that even though Pentium
94 # is minimum requirement for platforms in question,
95 # ${MACHINE} gets always assigned to i386. Now, problem
96 # with i386 is that it makes ./config pass 386 to
97 # ./Configure, which in turn makes make generate
98 # inefficient SHA-1 (for this moment) code.
99 x
[678]*) echo "i586-sco-unixware7"; exit 0 ;;
105 # Now we simply scan though... In most cases, the SYSTEM info is enough
107 case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
109 echo "m68k-apple-aux3"; exit 0
113 echo "${MACHINE}-ibm-aix"; exit 0
117 echo "${MACHINE}-ibm-aix"; exit 0
121 echo "${MACHINE}-ibm-aix3"; exit 0
125 echo "${MACHINE}-hi-hiux"; exit 0
129 HPUXVER
=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
131 1[0-9].
*) # HPUX 10 and 11 targets are unified
132 echo "${MACHINE}-hp-hpux1x"; exit 0
135 echo "${MACHINE}-hp-hpux"; 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-dragonfly"; exit 0
205 echo "${MACHINE}-whatever-freebsd"; exit 0
209 echo "${MACHINE}-whatever-haiku"; exit 0
213 echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
217 echo "${MACHINE}-whatever-netbsd"; exit 0
221 echo "${MACHINE}-whatever-openbsd"; exit 0
225 echo "${MACHINE}-unknown-OpenUNIX${VERSION}"; exit 0
229 OSFMAJOR
=`echo ${RELEASE}| sed -e 's/^V\([0-9]*\)\..*$/\1/'`
232 echo "${MACHINE}-dec-tru64"; exit 0
235 echo "${MACHINE}-dec-osf"; exit 0
238 echo "${MACHINE}-dec-osf"; exit 0
244 echo "i860-intel-osf1"; exit 0
248 echo "ppc-apple-rhapsody"; exit 0
254 echo "ppc-apple-darwin${VERSION}"
257 echo "x86_64-apple-darwin${VERSION}"
260 echo "i686-apple-darwin${VERSION}"
267 echo "${MACHINE}-whatever-solaris2"; exit 0
271 echo "${MACHINE}-sun-sunos4"; exit 0
275 echo "${MACHINE}-whatever-sysv4"; exit 0
279 echo "i386-stratus-vos"; exit 0
283 echo "hppa1.1-stratus-vos"; exit 0
287 echo "${MACHINE}-whatever-sysv4"; exit 0
291 echo "${MACHINE}-whatever-sysv4"; exit 0
294 *:4.0:3.0:3[34]?? |
*:4.0:3.0:3[34]??
,*)
295 echo "i486-ncr-sysv4"; exit 0
299 echo "${MACHINE}-unknown-ultrix"; exit 0
303 echo "${MACHINE}-siemens-sysv4"; exit 0 # Here, $MACHINE == "BS2000"
307 echo "${MACHINE}-tenon-${SYSTEM}"; exit 0;
311 echo "${MACHINE}-ncr-sysv4"; exit 0
315 echo "${MACHINE}-v11-${SYSTEM}"; exit 0;
318 # The following combinations are supported
319 # MINGW64* on x86_64 => mingw64
320 # MINGW32* on x86_64 => mingw
321 # MINGW32* on i?86 => mingw
323 # MINGW64* on i?86 isn't expected to work...
325 echo "${MACHINE}-whatever-mingw64"; exit 0;
328 echo "${MACHINE}-whatever-mingw"; exit 0;
331 echo "${MACHINE}-pc-cygwin"; exit 0
335 echo "${MACHINE}-whatever-vxworks"; exit 0;
340 # Ugg. These are all we can determine by what we know about
341 # the output of uname. Be more creative:
344 # Do the Apollo stuff first. Here, we just simply assume
345 # that the existence of the /usr/apollo directory is proof
347 if [ -d /usr
/apollo
]; then
348 echo "whatever-apollo-whatever"
353 ISNEXT
=`hostinfo 2>/dev/null`
356 echo "whatever-next-nextstep3.3"; exit 0
359 echo "whatever-next-nextstep"; exit 0
363 # At this point we gone through all the one's
366 echo "${MACHINE}-whatever-${SYSTEM}"
370 # ---------------------------------------------------------------------------
371 # this is where the translation occurs into SSLeay terms
372 # ---------------------------------------------------------------------------
374 # Only set CC if not supplied already
375 if [ -z "$CROSS_COMPILE$CC" ]; then
376 GCCVER
=`sh -c "gcc -dumpversion" 2>/dev/null`
377 if [ "$GCCVER" != "" ]; then
378 # then strip off whatever prefix egcs prepends the number with...
379 # Hopefully, this will work for any future prefixes as well.
380 GCCVER
=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
381 # Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
382 # does give us what we want though, so we use that. We just just the
383 # major and minor version numbers.
384 # peak single digit before and after first dot, e.g. 2.95.1 gives 29
385 GCCVER
=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
392 if [ "$SYSTEM" = "HP-UX" ];then
393 # By default gcc is a ILP32 compiler (with long long == 64).
395 if [ $GCCVER -ge 30 ]; then
396 # PA64 support only came in with gcc 3.0.x.
397 # We check if the preprocessor symbol __LP64__ is defined...
398 if echo "__LP64__" | gcc
-v -E -x c
- 2>/dev
/null |
grep "^__LP64__" 2>&1 > /dev
/null
; then
399 : # __LP64__ has slipped through, it therefore is not defined
405 if [ "$SYSTEM" = "SunOS" ]; then
406 if [ $GCCVER -ge 30 ]; then
407 # 64-bit ABI isn't officially supported in gcc 3.0, but it appears
408 # to be working, at the very least 'make test' passes...
409 if gcc
-v -E -x c
/dev
/null
2>&1 |
grep __arch64__
> /dev
/null
; then
415 # check for WorkShop C, expected output is "cc: blah-blah C x.x"
416 CCVER
=`(cc -V 2>&1) 2>/dev/null | \
417 egrep -e '^cc: .* C [0-9]\.[0-9]' | \
418 sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'`
420 if [ $MACHINE != i86pc
-a $CCVER -gt 40 ]; then
421 CC
=cc
# overrides gcc!!!
422 if [ $CCVER -eq 50 ]; then
423 echo "WARNING! Detected WorkShop C 5.0. Do make sure you have"
424 echo " patch #107357-01 or later applied."
430 if [ "${SYSTEM}" = "AIX" ]; then # favor vendor cc over gcc
431 (cc
) 2>&1 |
grep -iv "not found" > /dev
/null
&& CC
=cc
436 # read the output of the embedded GuessOS
439 echo Operating system
: $GUESSOS
441 # now map the output into SSLeay terms ... really should hack into the
442 # script above so we end up with values in vars but that would take
443 # more time that I want to waste at the moment
455 echo "WARNING! If you wish to build 64-bit library, then you have to"
456 echo " invoke '$THERE/Configure irix64-mips4-$CC' *manually*."
457 if [ "$DRYRUN" = "false" -a -t 1 ]; then
458 echo " You have about 5 seconds to press Ctrl-C to abort."
459 (trap "stty `stty -g`; exit 0" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
463 ppc-apple-rhapsody
) OUT
="rhapsody-ppc-cc" ;;
465 ISA64
=`(sysctl -n hw.optional.64bitops) 2>/dev/null`
466 if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
467 echo "WARNING! If you wish to build 64-bit library, then you have to"
468 echo " invoke '$THERE/Configure darwin64-ppc-cc' *manually*."
469 if [ "$DRYRUN" = "false" -a -t 1 ]; then
470 echo " You have about 5 seconds to press Ctrl-C to abort."
471 (trap "stty `stty -g`; exit 0" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
474 if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
475 OUT
="darwin64-ppc-cc"
480 ISA64
=`(sysctl -n hw.optional.x86_64) 2>/dev/null`
481 if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then
482 echo "WARNING! If you wish to build 64-bit library, then you have to"
483 echo " invoke 'KERNEL_BITS=64 $THERE/config $options'."
484 if [ "$DRYRUN" = "false" -a -t 1 ]; then
485 echo " You have about 5 seconds to press Ctrl-C to abort."
486 (trap "stty `stty -g`; exit 1" 2; stty
-icanon min
0 time 50; read waste
; exit 0) <&1 ||
exit
489 if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
490 OUT
="darwin64-x86_64-cc"
494 x86_64-apple-darwin
*)
495 if [ "$KERNEL_BITS" = "32" ]; then
498 OUT
="darwin64-x86_64-cc"
501 __CNF_CFLAGS
="$__CNF_CFLAGS -arch armv6 -arch armv7"
502 __CNF_CXXFLAGS
="$__CNF_CXXFLAGS -arch armv6 -arch armv7"
503 OUT
="iphoneos-cross" ;;
505 __CNF_CFLAGS
="$__CNF_CFLAGS -arch ${MACHINE}"
506 __CNF_CXXFLAGS
="$__CNF_CXXFLAGS -arch ${MACHINE}"
507 OUT
="iphoneos-cross" ;;
508 arm64-
*-iphoneos|
*-*-ios64)
511 ISA
=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
512 case ${ISA:-generic} in
513 *[678]) OUT
="linux-alpha+bwx-$CC" ;;
514 *) OUT
="linux-alpha-$CC" ;;
516 if [ "$CC" = "gcc" ]; then
517 case ${ISA:-generic} in
518 EV5|EV45
) __CNF_CFLAGS
="$__CNF_CFLAGS -mcpu=ev5"
519 __CNF_CXXFLAGS
="$__CNF_CFLAGS -mcpu=ev5";;
520 EV56|PCA56
) __CNF_CFLAGS
="$__CNF_CFLAGS -mcpu=ev56"
521 __CNF_CXXFLAGS
="$__CNF_CXXFLAGS -mcpu=ev56";;
522 *) __CNF_CFLAGS
="$__CNF_CFLAGS -mcpu=ev6"
523 __CNF_CXXFLAGS
="$__CNF_CXXFLAGS -mcpu=ev6";;
528 if [ -z "$KERNEL_BITS" ]; then
529 echo "WARNING! If you wish to build 64-bit library, then you have to"
530 echo " invoke '$THERE/Configure linux-ppc64' *manually*."
531 if [ "$DRYRUN" = "false" -a -t 1 ]; then
532 echo " You have about 5 seconds to press Ctrl-C to abort."
533 (trap "stty `stty -g`; exit 0" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
536 if [ "$KERNEL_BITS" = "64" ]; then
540 if (echo "__LP64__" | gcc
-E -x c
- 2>/dev
/null |
grep "^__LP64__" 2>&1 > /dev
/null
); then
543 __CNF_CFLAGS
="$__CNF_CFLAGS -m32"
544 __CNF_CXXFLAGS
="$__CNF_CXXFLAGS -m32"
548 ppc64le-
*-linux2) OUT
="linux-ppc64le" ;;
549 ppc-
*-linux2) OUT
="linux-ppc" ;;
551 echo "WARNING! If you wish to build 64-bit library, then you have to"
552 echo " invoke '$THERE/Configure linux64-mips64' *manually*."
553 if [ "$DRYRUN" = "false" -a -t 1 ]; then
554 echo " You have about 5 seconds to press Ctrl-C to abort."
555 (trap "stty `stty -g`; exit 0" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
559 mips
*-*-linux2) OUT
="linux-mips32" ;;
560 ppc60x-
*-vxworks*) OUT
="vxworks-ppc60x" ;;
561 ppcgen-
*-vxworks*) OUT
="vxworks-ppcgen" ;;
562 pentium-
*-vxworks*) OUT
="vxworks-pentium" ;;
563 simlinux-
*-vxworks*) OUT
="vxworks-simlinux" ;;
564 mips-
*-vxworks*) OUT
="vxworks-mips";;
565 ia64-
*-linux?
) OUT
="linux-ia64" ;;
567 echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI"
568 echo " and wish to build 64-bit library, then you have to"
569 echo " invoke '$THERE/Configure linux64-sparcv9' *manually*."
570 if [ "$DRYRUN" = "false" -a -t 1 ]; then
571 echo " You have about 5 seconds to press Ctrl-C to abort."
572 (trap "stty `stty -g`; exit 0" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
574 OUT
="linux-sparcv9" ;;
576 KARCH
=`awk '/^type/{print$3;exit(0);}' /proc/cpuinfo`
577 case ${KARCH:-sun4} in
578 sun4u
*) OUT
="linux-sparcv9" ;;
579 sun4m
) OUT
="linux-sparcv8" ;;
580 sun4d
) OUT
="linux-sparcv8" ;;
581 *) OUT
="linux-generic32";
582 __CNF_CPPFLAGS
="$__CNF_CPPFLAGS -DB_ENDIAN" ;;
585 # 64-bit builds under parisc64 linux are not supported and
586 # compiler is expected to generate 32-bit objects...
587 CPUARCH
=`awk '/cpu family/{print substr($5,1,3); exit(0);}' /proc/cpuinfo`
588 CPUSCHEDULE
=`awk '/^cpu.[ ]*: PA/{print substr($3,3); exit(0);}' /proc/cpuinfo`
590 # ??TODO ?? Model transformations
591 # 0. CPU Architecture for the 1.1 processor has letter suffixes. We strip that off
592 # assuming no further arch. identification will ever be used by GCC.
593 # 1. I'm most concerned about whether is a 7300LC is closer to a 7100 versus a 7100LC.
594 # 2. The variant 64-bit processors cause concern should GCC support explicit schedulers
595 # for these chips in the future.
596 # PA7300LC -> 7100LC (1.1)
597 # PA8200 -> 8000 (2.0)
598 # PA8500 -> 8000 (2.0)
599 # PA8600 -> 8000 (2.0)
601 CPUSCHEDULE
=`echo $CPUSCHEDULE|sed -e 's/7300LC/7100LC/' -e 's/8.00/8000/'`
602 # Finish Model transformations
604 __CNF_CPPFLAGS
="$__CNF_CPPFLAGS -DB_ENDIAN"
605 __CNF_CFLAGS
="$__CNF_CFLAGS -mschedule=$CPUSCHEDULE -march=$CPUARCH"
606 __CNF_CXXFLAGS
="$__CNF_CXXFLAGS -mschedule=$CPUSCHEDULE -march=$CPUARCH"
607 OUT
="linux-generic32" ;;
608 armv
[1-3]*-*-linux2) OUT
="linux-generic32" ;;
609 armv
[7-9]*-*-linux2) OUT
="linux-armv4"
610 __CNF_CFLAGS
="$__CNF_CFLAGS -march=armv7-a"
611 __CNF_CXXFLAGS
="$__CNF_CXXFLAGS -march=armv7-a"
613 arm
*-*-linux2) OUT
="linux-armv4" ;;
614 aarch64-
*-linux2) OUT
="linux-aarch64" ;;
615 sh
*b-
*-linux2) OUT
="linux-generic32";
616 __CNF_CPPFLAGS
="$__CNF_CPPFLAGS -DB_ENDIAN" ;;
617 sh
*-*-linux2) OUT
="linux-generic32";
618 __CNF_CPPFLAGS
="$__CNF_CPPFLAGS -DL_ENDIAN" ;;
619 m68k
*-*-linux2) OUT
="linux-generic32";
620 __CNF_CPPFLAGS
="$__CNF_CPPFLAGS -DB_ENDIAN" ;;
621 s390-
*-linux2) OUT
="linux-generic32";
622 __CNF_CPPFLAGS
="$__CNF_CPPFLAGS -DB_ENDIAN" ;;
624 # To be uncommented when glibc bug is fixed, see Configure...
625 #if egrep -e '^features.* highgprs' /proc/cpuinfo >/dev/null ; then
626 # echo "WARNING! If you wish to build \"highgprs\" 32-bit library, then you"
627 # echo " have to invoke './Configure linux32-s390x' *manually*."
628 # if [ "$DRYRUN" = "false" -a -t -1 ]; then
629 # echo " You have about 5 seconds to press Ctrl-C to abort."
630 # (trap "stty `stty -g`; exit 0" 2 0; stty -icanon min 0 time 50; read waste) <&1
636 if $CC -dM -E -x c
/dev
/null
2>&1 |
grep -q ILP32
> /dev
/null
; then
642 # On machines where the compiler understands -m32, prefer a
643 # config target that uses it
644 if $CC -m32 -E -x c
/dev
/null
> /dev
/null
2>&1; then
649 *86-*-linux1) OUT
="linux-aout" ;;
650 *-*-linux?
) OUT
="linux-generic32" ;;
651 sun4
[uv
]*-*-solaris2)
652 OUT
="solaris-sparcv9-$CC"
653 ISA64
=`(isainfo) 2>/dev/null | grep sparcv9`
654 if [ "$ISA64" != "" -a "$KERNEL_BITS" = "" ]; then
655 if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
656 echo "WARNING! If you wish to build 64-bit library, then you have to"
657 echo " invoke '$THERE/Configure solaris64-sparcv9-cc' *manually*."
658 if [ "$DRYRUN" = "false" -a -t 1 ]; then
659 echo " You have about 5 seconds to press Ctrl-C to abort."
660 (trap "stty `stty -g`; exit 0" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
662 elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
663 # $GCC_ARCH denotes default ABI chosen by compiler driver
664 # (first one found on the $PATH). I assume that user
665 # expects certain consistency with the rest of his builds
666 # and therefore switch over to 64-bit. <appro>
667 OUT
="solaris64-sparcv9-gcc"
668 echo "WARNING! If you wish to build 32-bit library, then you have to"
669 echo " invoke '$THERE/Configure solaris-sparcv9-gcc' *manually*."
670 if [ "$DRYRUN" = "false" -a -t 1 ]; then
671 echo " You have about 5 seconds to press Ctrl-C to abort."
672 (trap "stty `stty -g`; exit 0" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
674 elif [ "$GCC_ARCH" = "-m32" ]; then
675 echo "NOTICE! If you *know* that your GNU C supports 64-bit/V9 ABI"
676 echo " and wish to build 64-bit library, then you have to"
677 echo " invoke '$THERE/Configure solaris64-sparcv9-gcc' *manually*."
678 if [ "$DRYRUN" = "false" -a -t 1 ]; then
679 echo " You have about 5 seconds to press Ctrl-C to abort."
680 (trap "stty `stty -g`; exit 0" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
684 if [ "$ISA64" != "" -a "$KERNEL_BITS" = "64" ]; then
685 OUT
="solaris64-sparcv9-$CC"
688 sun4m-
*-solaris2) OUT
="solaris-sparcv8-$CC" ;;
689 sun4d-
*-solaris2) OUT
="solaris-sparcv8-$CC" ;;
690 sun4
*-*-solaris2) OUT
="solaris-sparcv7-$CC" ;;
692 ISA64
=`(isainfo) 2>/dev/null | grep amd64`
693 if [ "$ISA64" != "" -a ${KERNEL_BITS:-64} -eq 64 ]; then
694 OUT
="solaris64-x86_64-$CC"
696 OUT
="solaris-x86-$CC"
697 if [ `uname -r | sed -e 's/5\.//'` -lt 10 ]; then
698 options
="$options no-sse2"
702 *-*-sunos4) OUT
="sunos-$CC" ;;
704 *86*-*-bsdi4) OUT
="BSD-x86-elf"; options
="$options no-sse2";
705 __CNF_LDFLAGS
="$__CNF_LDFLAGS -ldl" ;;
706 alpha
*-*-*bsd
*) OUT
="BSD-generic64";
707 __CNF_CPPFLAGS
="$__CNF_CPPFLAGS -DL_ENDIAN" ;;
708 powerpc64-
*-*bsd
*) OUT
="BSD-generic64";
709 __CNF_CPPFLAGS
="$__CNF_CPPFLAGS -DB_ENDIAN" ;;
710 sparc64-
*-*bsd
*) OUT
="BSD-sparc64" ;;
711 ia64-
*-*bsd
*) OUT
="BSD-ia64" ;;
712 x86_64-
*-dragonfly*) OUT
="BSD-x86_64" ;;
713 amd64-
*-*bsd
*) OUT
="BSD-x86_64" ;;
714 *86*-*-*bsd
*) # mimic ld behaviour when it's looking for libc...
715 if [ -L /usr
/lib
/libc.so
]; then # [Free|Net]BSD
716 libc
=/usr
/lib
/libc.so
718 # ld searches for highest libc.so.* and so do we
719 libc
=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`
721 case "`(file -L $libc) 2>/dev/null`" in
722 *ELF
*) OUT
="BSD-x86-elf" ;;
723 *) OUT
="BSD-x86"; options
="$options no-sse2" ;;
725 *-*-*bsd
*) OUT
="BSD-generic32" ;;
727 x86_64-
*-haiku) OUT
="haiku-x86_64" ;;
728 *-*-haiku) OUT
="haiku-x86" ;;
730 *-*-osf) OUT
="osf1-alpha-cc" ;;
731 *-*-tru64) OUT
="tru64-alpha-cc" ;;
733 if [ "$CC" = "gcc" ]; then
734 OUT
="unixware-7-gcc" ; options
="$options no-sse2"
736 OUT
="unixware-7" ; options
="$options no-sse2"
737 __CNF_CPPFLAGS
="$__CNF_CPPFLAGS -D__i386__"
740 *-*-[Uu
]nix
[Ww
]are20
*) OUT
="unixware-2.0"; options
="$options no-sse2 no-sha512" ;;
741 *-*-[Uu
]nix
[Ww
]are21
*) OUT
="unixware-2.1"; options
="$options no-sse2 no-sha512" ;;
743 options
="$options no-threads no-shared no-asm no-dso"
746 BS2000-siemens-sysv4
) OUT
="BS2000-OSD" ;;
748 if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
749 OUT
="hpux64-parisc2-gcc"
751 [ "$KERNEL_BITS" ] || KERNEL_BITS
=`(getconf KERNEL_BITS) 2>/dev/null`
752 KERNEL_BITS
=${KERNEL_BITS:-32}
753 CPU_VERSION
=`(getconf CPU_VERSION) 2>/dev/null`
754 CPU_VERSION
=${CPU_VERSION:-0}
755 # See <sys/unistd.h> for further info on CPU_VERSION.
756 if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU
757 if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
762 elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
763 # PA-RISC 2.0 is no longer supported as separate 32-bit
764 # target. This is compensated for by run-time detection
765 # in most critical assembly modules and taking advantage
766 # of 2.0 architecture in PA-RISC 1.1 build.
767 OUT
=${OUT:-"hpux-parisc1_1-${CC}"}
768 if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
769 echo "WARNING! If you wish to build 64-bit library then you have to"
770 echo " invoke '$THERE/Configure hpux64-parisc2-cc' *manually*."
771 if [ "$DRYRUN" = "false" -a -t 1 ]; then
772 echo " You have about 5 seconds to press Ctrl-C to abort."
773 (trap "stty `stty -g`; exit 0" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
776 elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU
777 OUT
="hpux-parisc1_1-${CC}"
778 elif [ $CPU_VERSION -ge 523 ]; then # PA-RISC 1.0 CPU
779 OUT
="hpux-parisc-${CC}"
780 else # Motorola(?) CPU
783 __CNF_CPPFLAGS
="$__CNF_CPPFLAGS -D_REENTRANT" ;;
784 *-hpux) OUT
="hpux-parisc-$CC" ;;
786 [ "$KERNEL_BITS" ] || KERNEL_BITS
=`(getconf KERNEL_BITMODE) 2>/dev/null`
787 KERNEL_BITS
=${KERNEL_BITS:-32}
788 OBJECT_MODE
=${OBJECT_MODE:-32}
789 if [ "$CC" = "gcc" ]; then
791 if [ $OBJECT_MODE -eq 64 ]; then
792 echo 'Your $OBJECT_MODE was found to be set to 64'
795 elif [ $OBJECT_MODE -eq 64 ]; then
796 echo 'Your $OBJECT_MODE was found to be set to 64'
800 if [ $KERNEL_BITS -eq 64 ]; then
801 echo "WARNING! If you wish to build 64-bit kit, then you have to"
802 echo " invoke '$THERE/Configure aix64-cc' *manually*."
803 if [ "$DRYRUN" = "false" -a -t 1 ]; then
804 echo " You have ~5 seconds to press Ctrl-C to abort."
805 (trap "stty `stty -g`; exit 0" 2 0; stty
-icanon min
0 time 50; read waste
) <&1
809 if (lsattr
-E -O -l `lsdev -c processor|awk '{print$1;exit}'` |
grep -i powerpc
) >/dev
/null
2>&1; then
810 : # this applies even to Power3 and later, as they return PowerPC_POWER[345]
812 options
="$options no-asm"
815 # these are all covered by the catchall below
816 i
[3456]86-*-cygwin) OUT
="Cygwin-x86" ;;
817 *-*-cygwin) OUT
="Cygwin-${MACHINE}" ;;
818 x86-
*-android|i?
86-*-android) OUT
="android-x86" ;;
819 armv
[7-9]*-*-android)
820 OUT
="android-armeabi"
821 __CNF_CFLAGS
="$__CNF_CFLAGS -march=armv7-a"
822 __CNF_CXXFLAGS
="$__CNF_CXXFLAGS -march=armv7-a";;
823 arm
*-*-android) OUT
="android-armeabi" ;;
824 *) OUT
=`echo $GUESSOS | awk -F- '{print $3}'`;;
827 # NB: This atalla support has been superseded by the ENGINE support
828 # That contains its own header and definitions anyway. Support can
829 # be enabled or disabled on any supported platform without external
830 # headers, eg. by adding the "hw-atalla" switch to ./config or
833 # See whether we can compile Atalla support
834 #if [ -f /usr/include/atasi.h ]
836 # __CNF_CPPFLAGS="$__CNF_CPPFLAGS -DATALLA"
839 if [ -n "$CONFIG_OPTIONS" ]; then
840 options
="$options $CONFIG_OPTIONS"
843 # gcc < 2.8 does not support -march=ultrasparc
844 if [ "$OUT" = solaris-sparcv9-gcc
-a $GCCVER -lt 28 ]
846 echo "WARNING! Falling down to 'solaris-sparcv8-gcc'."
847 echo " Upgrade to gcc-2.8 or later."
849 OUT
=solaris-sparcv8-gcc
851 if [ "$OUT" = "linux-sparcv9" -a $GCCVER -lt 28 ]
853 echo "WARNING! Falling down to 'linux-sparcv8'."
854 echo " Upgrade to gcc-2.8 or later."
860 i386-
*) options
="$options 386" ;;
863 for i
in aes aria bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha sm2 sm3 sm4
865 if [ ! -d $THERE/crypto
/$i ]
867 options
="$options no-$i"
871 if [ -z "$OUT" ]; then
875 if [ ".$PERL" = .
] ; then
876 for i
in .
`echo $PATH | sed 's/:/ /g'`; do
877 if [ -f "$i/perl5$EXE" ] ; then
884 if [ ".$PERL" = .
] ; then
885 for i
in .
`echo $PATH | sed 's/:/ /g'`; do
886 if [ -f "$i/perl$EXE" ] ; then
887 if "$i/perl$EXE" -e 'exit($]<5.0)'; then
895 if [ ".$PERL" = .
] ; then
896 echo "You need Perl 5."
900 # run Configure to check to see if we need to specify the
901 # compiler for the platform ... in which case we add it on
902 # the end ... otherwise we leave it off
904 $PERL $THERE/Configure LIST |
grep "$OUT-$CC" > /dev
/null
905 if [ $?
= "0" ]; then
911 $PERL $THERE/Configure LIST |
grep "$OUT" > /dev
/null
912 if [ $?
= "0" ]; then
913 if [ "$VERBOSE" = "true" ]; then
915 __CNF_CPPDEFINES
="'$__CNF_CPPDEFINES'" \
916 __CNF_CPPINCLUDES
="'$__CNF_CPPINCLUDES'" \
917 __CNF_CPPFLAGS
="'$__CNF_CPPFLAGS'" \
918 __CNF_CFLAGS
="'$__CNF_CFLAGS'" \
919 __CNF_CXXFLAGS
="'$__CNF_CXXFLAGS'" \
920 __CNF_LDFLAGS
="'$__CNF_LDFLAGS'" \
921 __CNF_LDLIBS
="'$__CNF_LDLIBS'" \
922 $PERL $THERE/Configure
$OUT $options
924 if [ "$DRYRUN" = "false" ]; then
925 # eval to make sure quoted options, possibly with spaces inside,
928 __CNF_CPPDEFINES
="'$__CNF_CPPDEFINES'" \
929 __CNF_CPPINCLUDES
="'$__CNF_CPPINCLUDES'" \
930 __CNF_CPPFLAGS
="'$__CNF_CPPFLAGS'" \
931 __CNF_CFLAGS
="'$__CNF_CFLAGS'" \
932 __CNF_CXXFLAGS
="'$__CNF_CXXFLAGS'" \
933 __CNF_LDFLAGS
="'$__CNF_LDFLAGS'" \
934 __CNF_LDLIBS
="'$__CNF_LDLIBS'" \
935 $PERL $THERE/Configure
$OUT $options
938 echo "This system ($OUT) is not supported. See file INSTALL for details."
942 if [ "$OUT" = "darwin64-x86_64-cc" ]; then
943 echo "WARNING! If you wish to build 32-bit libraries, then you have to"
944 echo " invoke 'KERNEL_BITS=32 $THERE/config $options'."