Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > media > main-release-src > by-pkgid > 7851f2b34d4cc8d5b406077c679787f2 > files > 2

stunnel-4.26-2mdv2009.1.src.rpm

--- stunnel-4.24/configure.ac.lib64	2008-05-18 13:45:55.000000000 +0200
+++ stunnel-4.24/configure.ac	2008-05-19 19:30:51.000000000 +0200
@@ -214,6 +214,33 @@
     ;;
 esac
 
+# Determine library dir name
+AC_MSG_CHECKING([for library dirname])
+case $host in
+*-*-linux*)
+  # Test if the compiler is 64bit
+  echo 'int i;' > conftest.c
+  stunnel_cv_cc_64bit_output=no
+  if $CC -c conftest.c; then
+    case `/usr/bin/file conftest.o` in
+    *"ELF 64"*)
+      stunnel_cv_cc_64bit_output=yes
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+case $host_cpu:$stunnel_cv_cc_64bit_output in
+powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
+  lib="lib64"
+  ;;
+*:*)
+  lib="lib"
+  ;;
+esac
+AC_MSG_RESULT([$lib])
+
 AC_MSG_NOTICE([**************************************** SSL])
 checkssldir() { :
     if test -f "$1/include/openssl/ssl.h"
@@ -238,7 +265,7 @@
     ],
     [
         # Search default localtions of SSL library
-        for maindir in /usr/local /usr/lib /usr/pkg /usr /var/ssl /opt; do
+        for maindir in /usr/local /usr/$lib /usr/pkg /usr /var/ssl /opt; do
             for dir in $maindir $maindir/openssl $maindir/ssl; do
                 checkssldir $dir && break 2
             done
@@ -259,7 +286,7 @@
 
 # Add SSL includes and libraries
 CFLAGS="$CFLAGS -I$ssldir/include"
-LIBS="$LIBS -L$ssldir/lib -lssl -lcrypto"
+LIBS="$LIBS -L$ssldir/$lib -lssl -lcrypto"
 
 # Check for obsolete RSAref library
 AC_MSG_CHECKING([for obsolete RSAref library])