summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2018-06-12 20:11:09 +0000
committerylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2018-06-12 20:11:09 +0000
commit71eced3a19109e035dc53d01368f0ec568851be9 (patch)
treedeb423ee592da99470ce93bedf8892ab29ae785e /build
parentfd605b72366a9b4771c9ab9b56e331be1e8b323a (diff)
downloadlibapr-71eced3a19109e035dc53d01368f0ec568851be9.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: http://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