Просмотр исходного кода

Merge branch 'maint'

* maint:
  OpenSSL configure: Detect /usr/lib64 dir
Bryan Drewery 2 лет назад
Родитель
Сommit
34cdeed3d5
2 измененных файлов с 60 добавлено и 20 удалено
  1. 29 10
      build/autotools/includes/acinclude.m4
  2. 31 10
      configure

+ 29 - 10
build/autotools/includes/acinclude.m4

@@ -591,32 +591,42 @@ AC_MSG_CHECKING(for path to OpenSSL)
 MY_ARG_WITH_PATH(openssl, [Path to OpenSSL], [auto])
 MY_ARG_WITH_PATH(openssl, [Path to OpenSSL], [auto])
 
 
 cf_openssl_basedir=""
 cf_openssl_basedir=""
+cf_openssl_libdir=""
 if test "$with_openssl_path" != "auto"; then
 if test "$with_openssl_path" != "auto"; then
   dnl Support for --with-openssl=/some/place
   dnl Support for --with-openssl=/some/place
   cf_openssl_basedir="`echo ${with_openssl_path} | sed 's/\/$//'`"
   cf_openssl_basedir="`echo ${with_openssl_path} | sed 's/\/$//'`"
+  cf_openssl_libdir="${cf_openssl_basedir}/lib"
 else
 else
   dnl Do the auto-probe here.  Check some common directory paths.
   dnl Do the auto-probe here.  Check some common directory paths.
-  for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/local/openssl; do
-    if test -f "${dirs}/include/openssl/opensslv.h" && test -f "${dirs}/lib/libssl.so"; then
-      cf_openssl_basedir="${dirs}"
-      break
-    fi
-  done
-  unset dirs
+  if test -f "/usr/include/openssl/opensslv.h" && test -f "/usr/lib64/libssl.so"; then
+      cf_openssl_libdir="/usr/lib64"
+      cf_openssl_basedir="/usr"
+  else
+    for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/local/openssl; do
+      if test -f "${dirs}/include/openssl/opensslv.h" && test -f "${dirs}/lib/libssl.so"; then
+        cf_openssl_basedir="${dirs}"
+        cf_openssl_libdir="${cf_openssl_basedir}/lib"
+        break
+      fi
+    done
+    unset dirs
+  fi
 fi
 fi
 dnl Now check cf_openssl_found to see if we found anything.
 dnl Now check cf_openssl_found to see if we found anything.
 if test ! -z "$cf_openssl_basedir"; then
 if test ! -z "$cf_openssl_basedir"; then
-  if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" && test -f "${cf_openssl_basedir}/lib/libssl.so"; then
+  if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" && test -f "${cf_openssl_libdir}/libssl.so"; then
     SSL_INCLUDES="-I${cf_openssl_basedir}/include"
     SSL_INCLUDES="-I${cf_openssl_basedir}/include"
-    SSL_LIBS="-L${cf_openssl_basedir}/lib"
+    SSL_LIBS="-L${cf_openssl_libdir}"
   else
   else
     dnl OpenSSL wasn't found in the directory specified.
     dnl OpenSSL wasn't found in the directory specified.
     cf_openssl_basedir=""
     cf_openssl_basedir=""
+    cf_openssl_libdir=""
   fi
   fi
 else
 else
   dnl See if present in system base (in which case, no need to change the include path)
   dnl See if present in system base (in which case, no need to change the include path)
   if test -f "/usr/include/openssl/opensslv.h" ; then
   if test -f "/usr/include/openssl/opensslv.h" ; then
     cf_openssl_basedir="/usr"
     cf_openssl_basedir="/usr"
+    cf_openssl_libdir="/usr/lib"
   fi
   fi
 fi
 fi
 SSL_INCLUDES="${SSL_INCLUDES} -DOPENSSL_API_COMPAT=0x10000000L"
 SSL_INCLUDES="${SSL_INCLUDES} -DOPENSSL_API_COMPAT=0x10000000L"
@@ -628,8 +638,17 @@ else
   AC_MSG_RESULT([not found])
   AC_MSG_RESULT([not found])
   AC_MSG_ERROR([OpenSSL is required.], 1)
   AC_MSG_ERROR([OpenSSL is required.], 1)
 fi
 fi
-SSL_LIBDIR="${cf_openssl_basedir}/lib"
+AC_MSG_CHECKING(for path to OpenSSL Lib)
+MY_ARG_WITH_PATH(openssl, [Path to OpenSSL Lib], [auto])
+if test ! -z "${cf_openssl_libdir}"; then
+  AC_MSG_RESULT(${cf_openssl_libdir})
+else
+  AC_MSG_RESULT([not found])
+  AC_MSG_ERROR([OpenSSL is required.], 1)
+fi
+SSL_LIBDIR="${cf_openssl_libdir}"
 unset cf_openssl_basedir
 unset cf_openssl_basedir
+unset cf_openssl_libdir
 
 
 save_CXX="$CXX"
 save_CXX="$CXX"
 CXX="$CXX $SSL_INCLUDES"
 CXX="$CXX $SSL_INCLUDES"

+ 31 - 10
configure

@@ -6837,27 +6837,37 @@ fi
 
 
 
 
 cf_openssl_basedir=""
 cf_openssl_basedir=""
+cf_openssl_libdir=""
 if test "$with_openssl_path" != "auto"; then
 if test "$with_openssl_path" != "auto"; then
     cf_openssl_basedir="`echo ${with_openssl_path} | sed 's/\/$//'`"
     cf_openssl_basedir="`echo ${with_openssl_path} | sed 's/\/$//'`"
+    cf_openssl_libdir="${cf_openssl_basedir}/lib"
 else
 else
+  if test -f "/usr/include/openssl/opensslv.h" && test -f "/usr/lib64/libssl.so"; then
+      cf_openssl_libdir="/usr/lib64"
+      cf_openssl_basedir="/usr"
+  else
     for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/local/openssl; do
     for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/local/openssl; do
-    if test -f "${dirs}/include/openssl/opensslv.h" && test -f "${dirs}/lib/libssl.so"; then
-      cf_openssl_basedir="${dirs}"
-      break
-    fi
-  done
-  unset dirs
+      if test -f "${dirs}/include/openssl/opensslv.h" && test -f "${dirs}/lib/libssl.so"; then
+        cf_openssl_basedir="${dirs}"
+	cf_openssl_libdir="${cf_openssl_basedir}/lib"
+        break
+      fi
+    done
+    unset dirs
+  fi
 fi
 fi
 if test ! -z "$cf_openssl_basedir"; then
 if test ! -z "$cf_openssl_basedir"; then
-  if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" && test -f "${cf_openssl_basedir}/lib/libssl.so"; then
+  if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" && test -f "${cf_openssl_libdir}/libssl.so"; then
     SSL_INCLUDES="-I${cf_openssl_basedir}/include"
     SSL_INCLUDES="-I${cf_openssl_basedir}/include"
-    SSL_LIBS="-L${cf_openssl_basedir}/lib"
+    SSL_LIBS="-L${cf_openssl_libdir}"
   else
   else
-        cf_openssl_basedir=""
+    cf_openssl_basedir=""
+    cf_openssl_libdir=""
   fi
   fi
 else
 else
     if test -f "/usr/include/openssl/opensslv.h" ; then
     if test -f "/usr/include/openssl/opensslv.h" ; then
     cf_openssl_basedir="/usr"
     cf_openssl_basedir="/usr"
+    cf_openssl_libdir="/usr/lib"
   fi
   fi
 fi
 fi
 SSL_INCLUDES="${SSL_INCLUDES} -DOPENSSL_API_COMPAT=0x10000000L"
 SSL_INCLUDES="${SSL_INCLUDES} -DOPENSSL_API_COMPAT=0x10000000L"
@@ -6870,8 +6880,19 @@ else
 $as_echo "not found" >&6; }
 $as_echo "not found" >&6; }
   as_fn_error 1 "OpenSSL is required." "$LINENO" 5
   as_fn_error 1 "OpenSSL is required." "$LINENO" 5
 fi
 fi
-SSL_LIBDIR="${cf_openssl_basedir}/lib"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for path to OpenSSL Lib" >&5
+$as_echo_n "checking for path to OpenSSL Lib... " >&6; }
+if test ! -z "${cf_openssl_libdir}"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${cf_openssl_libdir}" >&5
+$as_echo "${cf_openssl_libdir}" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+  as_fn_error 1 "OpenSSL is required." "$LINENO" 5
+fi
+SSL_LIBDIR="${cf_openssl_libdir}"
 unset cf_openssl_basedir
 unset cf_openssl_basedir
+unset cf_openssl_libdir
 
 
 save_CXX="$CXX"
 save_CXX="$CXX"
 CXX="$CXX $SSL_INCLUDES"
 CXX="$CXX $SSL_INCLUDES"