summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2018-06-12 20:11:09 +0000
committerYann Ylavic <ylavic@apache.org>2018-06-12 20:11:09 +0000
commit9aefe5db8512187e194223cd411c1b63bcf0b7a8 (patch)
treedeb423ee592da99470ce93bedf8892ab29ae785e /build
parentaf39a670ca00949536be1b3d615d2ec0392d63f3 (diff)
downloadapr-9aefe5db8512187e194223cd411c1b63bcf0b7a8.tar.gz
apr_crypto: follow up to r1833359.
Link underlying crypto libraries (openssl, nss, and commoncrypto) with libapr when the corresponding --with is configured. This allows to initialize, terminate or check whether initialized respectively with apr_crypto_lib_init(), apr_crypto_lib_term() or apr_crypto_lib_is_initialized(). Users can now control the (un)initialization of those libraries, notably when they also use them independently and that doing this multiple times can cause leaks or unexpected behaviour. The initialization code is moved from "apr_crypto_{openssl,nss,commoncrypto}.c" where previously loaded dynamically (DSO) to "apr_crypto_internal.c" which is linked with libapr. Also apr_crypto_prng_init() can make sure the underlying crypto lib is ready. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1833421 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build')
-rw-r--r--build/crypto.m410
1 files changed, 10 insertions, 0 deletions
diff --git a/build/crypto.m4 b/build/crypto.m4
index 7d69ed027..c92948510 100644
--- a/build/crypto.m4
+++ b/build/crypto.m4
@@ -240,6 +240,11 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
LIBS="$old_libs"
CPPFLAGS="$old_cppflags"
LDFLAGS="$old_ldflags"
+
+ if test "$apu_have_nss" = "1"; then
+ APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lnspr4 -lnss3])
+ APR_ADDTO(LIBS, [-lnspr4 -lnss3])
+ fi
])
AC_DEFUN([APU_CHECK_CRYPTO_COMMONCRYPTO], [
@@ -296,6 +301,11 @@ AC_DEFUN([APU_CHECK_CRYPTO_COMMONCRYPTO], [
LIBS="$old_libs"
CPPFLAGS="$old_cppflags"
LDFLAGS="$old_ldflags"
+
+ if test "$apu_have_commoncrypto" = "1"; then
+ APR_ADDTO(APRUTIL_EXPORT_LIBS, [-lcrypto])
+ APR_ADDTO(LIBS, [-lcrypto])
+ fi
])
dnl