diff --git a/config b/config index bebaef2308906519a240527557446912a30f0d6d..fd4b1984a599fedca6709751575105e8acf52849 100755 --- a/config +++ b/config @@ -587,13 +587,20 @@ case "$GUESSOS" in fi ;; ppc64-*-linux2) - echo "WARNING! If you wish to build 64-bit library, then you have to" - echo " invoke './Configure linux-ppc64' *manually*." - if [ "$TEST" = "false" -a -t 1 ]; then - echo " You have about 5 seconds to press Ctrl-C to abort." - (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 + if [ -z "$KERNEL_BITS" ]; then + echo "WARNING! If you wish to build 64-bit library, then you have to" + echo " invoke './Configure linux-ppc64' *manually*." + if [ "$TEST" = "false" -a -t 1 ]; then + echo " You have about 5 seconds to press Ctrl-C to abort." + (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 + fi + fi + if [ "$KERNEL_BITS" = "64" ]; then + OUT="linux-ppc64" + else + OUT="linux-ppc" + (echo "__LP64__" | gcc -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null) || options="$options -m32" fi - OUT="linux-ppc" ;; ppc-*-linux2) OUT="linux-ppc" ;; mips64*-*-linux2) diff --git a/crypto/ppccap.c b/crypto/ppccap.c index f71ba66aa38282fb2ec6884f791ee80083d0c73f..531f1b3be84005d74075e0445b198f42da13b87d 100644 --- a/crypto/ppccap.c +++ b/crypto/ppccap.c @@ -4,6 +4,9 @@ #include #include #include +#ifdef __linux +#include +#endif #include #include @@ -102,6 +105,10 @@ void OPENSSL_cpuid_setup(void) if (sizeof(size_t)==4) { +#ifdef __linux + struct utsname uts; + if (uname(&uts)==0 && strcmp(uts.machine,"ppc64")==0) +#endif if (sigsetjmp(ill_jmp,1) == 0) { OPENSSL_ppc64_probe();