linux-ppc: make it more robust [from HEAD].

This commit is contained in:
Andy Polyakov 2012-10-21 18:25:29 +00:00
parent 9a6aff50ff
commit aa963813ed
2 changed files with 20 additions and 6 deletions

7
config
View File

@ -587,13 +587,20 @@ case "$GUESSOS" in
fi fi
;; ;;
ppc64-*-linux2) ppc64-*-linux2)
if [ -z "$KERNEL_BITS" ]; then
echo "WARNING! If you wish to build 64-bit library, then you have to" echo "WARNING! If you wish to build 64-bit library, then you have to"
echo " invoke './Configure linux-ppc64' *manually*." echo " invoke './Configure linux-ppc64' *manually*."
if [ "$TEST" = "false" -a -t 1 ]; then if [ "$TEST" = "false" -a -t 1 ]; then
echo " You have about 5 seconds to press Ctrl-C to abort." 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 (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
fi fi
fi
if [ "$KERNEL_BITS" = "64" ]; then
OUT="linux-ppc64"
else
OUT="linux-ppc" OUT="linux-ppc"
(echo "__LP64__" | gcc -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null) || options="$options -m32"
fi
;; ;;
ppc-*-linux2) OUT="linux-ppc" ;; ppc-*-linux2) OUT="linux-ppc" ;;
mips64*-*-linux2) mips64*-*-linux2)

View File

@ -4,6 +4,9 @@
#include <setjmp.h> #include <setjmp.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#ifdef __linux
#include <sys/utsname.h>
#endif
#include <crypto.h> #include <crypto.h>
#include <openssl/bn.h> #include <openssl/bn.h>
@ -102,6 +105,10 @@ void OPENSSL_cpuid_setup(void)
if (sizeof(size_t)==4) 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) if (sigsetjmp(ill_jmp,1) == 0)
{ {
OPENSSL_ppc64_probe(); OPENSSL_ppc64_probe();