summaryrefslogtreecommitdiff
path: root/cf/crypto.m4
diff options
context:
space:
mode:
authorViktor Dukhovni <viktor@twosigma.com>2016-05-07 02:36:34 -0400
committerViktor Dukhovni <viktor@twosigma.com>2016-05-07 02:36:34 -0400
commit9393d53538298e8a919efb92965759789da84d9b (patch)
treec4a32a8a5f10283a076911e77f325ddc335d11ae /cf/crypto.m4
parent131c8dd30e83fb33a56b3007e71dc078420f6650 (diff)
Actually capture libcrypto autoconf results
Also infer lib path not just include path, and set rpath if not from /usr. Also need libcrypto for test_rand.
Diffstat (limited to 'cf/crypto.m4')
-rw-r--r--cf/crypto.m47
1 files changed, 7 insertions, 0 deletions
diff --git a/cf/crypto.m4 b/cf/crypto.m4
index 44b77c1d0..c6f72561e 100644
--- a/cf/crypto.m4
+++ b/cf/crypto.m4
@@ -94,6 +94,8 @@ if test "$with_openssl" = "yes"; then
with_openssl=/usr
fi
if test "$with_openssl" != "no"; then
+ saved_CFLAGS="${CFLAGS}"
+ saved_LDFLAGS="${LDFLAGS}"
INCLUDE_openssl_crypto=
LIB_openssl_crypto=
if test "$with_openssl_include" != ""; then
@@ -103,8 +105,11 @@ if test "$with_openssl" != "no"; then
fi
if test "$with_openssl_lib" != ""; then
LIB_openssl_crypto="-L${with_openssl_lib}"
+ elif test "${with_openssl}" != "/usr" -a -d "${with_openssl}/lib"; then
+ LIB_openssl_crypto="-L${with_openssl}/lib -Wl,-R,${with_openssl}/lib"
fi
CFLAGS="-DHAVE_HCRYPTO_W_OPENSSL -I${INCLUDE_openssl_crypto} ${CFLAGS}"
+ LDFLAGS="${LIB_openssl_crypto} ${LDFLAGS}"
# XXX What about rpath? Yeah...
AC_CHECK_LIB([crypto], [OPENSSL_init],
[LIB_openssl_crypto="${LIB_openssl_crypto} -lcrypto"; openssl=yes], [openssl=no], [])
@@ -122,6 +127,8 @@ if test "$with_openssl" != "no"; then
AC_CHECK_LIB([crypto], [OPENSSL_init],
[LIB_openssl_crypto="${LIB_openssl_crypto} -lcrypto -ldl -lnsl -lsocket"; openssl=yes], [openssl=no], [-ldl -lnsl -lsocket])
fi
+ CFLAGS="${saved_CFLAGS}"
+ LDFLAGS="${saved_LDFLAGS}"
fi
LIB_hcrypto='$(top_builddir)/lib/hcrypto/libhcrypto.la'