apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1390545 - in /apr/apr-util/branches/1.5.x: ./ CHANGES build/crypto.m4
Date Wed, 26 Sep 2012 15:03:49 GMT
Author: trawick
Date: Wed Sep 26 15:03:49 2012
New Revision: 1390545

URL: http://svn.apache.org/viewvc?rev=1390545&view=rev
Log:
merge r1389154 and r1389169 from trunk

r1389154:
If --with-crypto was specified without enabling a crypto library, try to
autodetect possible crypto libraries, as long as they haven't been explicitly
disabled.

If you just want OpenSSL regardless of what is available on the system:

  --with-crypto --with-openssl

or

  --with-crypto --without-nss --without-<other>

If a library has to be specified explicitly so that it is found in a
non-default location (--with-nss=$HOME/install/nss), other libraries
won't be automatically enabled.

r1389169:

fix AC_CHECK_HEADER() usage with APU_CHECK_CRYPTO_NSS

The action-if-found is executed if *any* of the headers listed
are found, so only equivalent headers should be searched
with one invocation if action-if-found is used to flag success.

This catches an error such as missing prerror.h at at configure
time instead of at build time.

Modified:
    apr/apr-util/branches/1.5.x/   (props changed)
    apr/apr-util/branches/1.5.x/CHANGES
    apr/apr-util/branches/1.5.x/build/crypto.m4

Propchange: apr/apr-util/branches/1.5.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1389154,1389169

Modified: apr/apr-util/branches/1.5.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/CHANGES?rev=1390545&r1=1390544&r2=1390545&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/CHANGES [utf-8] (original)
+++ apr/apr-util/branches/1.5.x/CHANGES [utf-8] Wed Sep 26 15:03:49 2012
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes with APR-util 1.5.2
 
+  *) apr_crypto: If --with-crypto is passed to configure but no crypto
+     libraries are enabled, autodetect available libraries.  [Jeff Trawick]
+
   *) apr_memcache_server_create(): Fix handling of the ttl parameter.
      It is documented as a number of seconds but was treated as 
      microseconds.  PR: 51511.  [Tim Whittington <timw apache.org>]

Modified: apr/apr-util/branches/1.5.x/build/crypto.m4
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/build/crypto.m4?rev=1390545&r1=1390544&r2=1390545&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/build/crypto.m4 (original)
+++ apr/apr-util/branches/1.5.x/build/crypto.m4 Wed Sep 26 15:03:49 2012
@@ -32,12 +32,38 @@ AC_DEFUN([APU_CHECK_CRYPTO], [
 
   AC_ARG_WITH([crypto], [APR_HELP_STRING([--with-crypto], [enable crypto support])],
   [
+    cryptolibs="openssl nss"
+
     if test "$withval" = "yes"; then
+
+      crypto_library_enabled=0
+      for cryptolib in $cryptolibs; do
+        eval v=\$with_$cryptolib
+        if test "$v" != "" -a "$v" != "no"; then
+          crypto_library_enabled=1
+        fi
+      done
+
+      if test "$crypto_library_enabled" = "0"; then
+        for cryptolib in $cryptolibs; do
+          eval v=\$with_$cryptolib
+          if test "$v" != "no"; then
+            eval with_$cryptolib=yes
+            crypto_library_enabled=1
+          fi
+        done
+	if test "$crypto_library_enabled" = "1"; then
+          AC_MSG_NOTICE([Crypto was requested but no crypto library was found; autodetecting
possible libraries])
+        else
+          AC_ERROR([Crypto was requested but all possible crypto libraries were disabled.])
+	fi
+      fi
+
       APU_CHECK_CRYPTO_OPENSSL
       APU_CHECK_CRYPTO_NSS
       dnl add checks for other varieties of ssl here
       if test "$apu_have_crypto" = "0"; then
-        AC_ERROR(Crypto was requested but no crypto library was enabled)
+        AC_ERROR([Crypto was requested but no crypto library could be enabled; specify the
location of a crypto library using --with-openssl, --with-nss, etc.])
       fi
     fi
   ], [
@@ -138,7 +164,6 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [
 ])
 
 AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
-  nss_have_headers=0
   nss_have_libs=0
 
   old_libs="$LIBS"
@@ -148,7 +173,6 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
   AC_ARG_WITH([nss], 
   [APR_HELP_STRING([--with-nss=DIR], [specify location of NSS])],
   [
-
     if test "$withval" = "yes"; then
       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
       if test -n "$PKG_CONFIG"; then
@@ -157,9 +181,15 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
         APR_ADDTO(CPPFLAGS, [$nss_CPPFLAGS])
         APR_ADDTO(LDFLAGS, [$nss_LDFLAGS])
       fi
-      AC_CHECK_HEADERS(prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h, [nss_have_headers=1])
+      nss_have_prerrorh=0
+      nss_have_nssh=0
+      nss_have_pk11pubh=0
+      AC_CHECK_HEADERS(prerror.h, [nss_have_prerrorh=1])
+      AC_CHECK_HEADERS(nss/nss.h nss.h, [nss_have_nssh=1])
+      AC_CHECK_HEADERS(nss/pk11pub.h pk11pub.h, [nss_have_pk11pubh=1])
+      nss_have_headers=${nss_have_prerrorh}${nss_have_nssh}${nss_have_pk11pubh}
       AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID,
[nss_have_libs=1],,-lnspr4))
-      if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then
+      if test "$nss_have_headers" = "111" && test "$nss_have_libs" != "0"; then
         apu_have_nss=1
       fi
     elif test "$withval" = "no"; then
@@ -173,9 +203,15 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
       APR_ADDTO(LDFLAGS, [$nss_LDFLAGS])
 
       AC_MSG_NOTICE(checking for nss in $withval)
-      AC_CHECK_HEADERS(prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h, [nss_have_headers=1])
+      nss_have_prerrorh=0
+      nss_have_nssh=0
+      nss_have_pk11pubh=0
+      AC_CHECK_HEADERS(prerror.h, [nss_have_prerrorh=1])
+      AC_CHECK_HEADERS(nss/nss.h nss.h, [nss_have_nssh=1])
+      AC_CHECK_HEADERS(nss/pk11pub.h pk11pub.h, [nss_have_pk11pubh=1])
+      nss_have_headers=${nss_have_prerrorh}${nss_have_nssh}${nss_have_pk11pubh}
       AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID,
[nss_have_libs=1],,-lnspr4))
-      if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then
+      if test "$nss_have_headers" = "111" && test "$nss_have_libs" != "0"; then
         apu_have_nss=1
       fi
 



Mime
View raw message