apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1389154 - /apr/apr/trunk/build/crypto.m4
Date Sun, 23 Sep 2012 22:01:41 GMT
Author: trawick
Date: Sun Sep 23 22:01:40 2012
New Revision: 1389154

URL: http://svn.apache.org/viewvc?rev=1389154&view=rev
Log:
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.


Modified:
    apr/apr/trunk/build/crypto.m4

Modified: apr/apr/trunk/build/crypto.m4
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/crypto.m4?rev=1389154&r1=1389153&r2=1389154&view=diff
==============================================================================
--- apr/apr/trunk/build/crypto.m4 (original)
+++ apr/apr/trunk/build/crypto.m4 Sun Sep 23 22:01:40 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
   ], [



Mime
View raw message