summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorVitezslav Cizek <vcizek@suse.com>2020-06-09 13:54:04 +0200
committerDaiki Ueno <ueno@gnu.org>2020-08-31 08:08:38 +0200
commitf9a12a1c0e19354b37a4733ef5b9e2b4bd7ca244 (patch)
tree18ef561d2072a5b46b58d7d63c9ad98ce17ea568 /configure.ac
parenteb6ca40995581e912e37a4bf04af699290eab425 (diff)
downloadgnutls-f9a12a1c0e19354b37a4733ef5b9e2b4bd7ca244.tar.gz
configure: improve nettle, gmp, and hogweed soname detection
Some linkers might optimize away the libraries passed on the command line if they aren't actually needed, such as gnu ld with --as-needed. The ldd output then won't list the shared libraries and the detection will fail. Make sure nettle and others are really used. Signed-off-by: Vitezslav Cizek <vcizek@suse.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 12 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 74278d5689..37f9862624 100644
--- a/configure.ac
+++ b/configure.ac
@@ -710,7 +710,10 @@ AM_CONDITIONAL(NEED_SIV, [test "$ac_cv_func_nettle_siv_cmac_aes128_set_key" != "
save_LIBS=$LIBS
LIBS="$LIBS $GMP_LIBS"
AC_MSG_CHECKING([gmp soname])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ #include <gmp.h>],[
+ mpz_t n;
+ mpz_init(n);])],
[gmp_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libgmp\.so'`],
[gmp_so=none])
if test -z "$gmp_so"; then
@@ -723,7 +726,10 @@ LIBS=$save_LIBS
save_LIBS=$LIBS
LIBS="$LIBS $NETTLE_LIBS"
AC_MSG_CHECKING([nettle soname])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ #include <nettle/sha2.h>],[
+ struct sha256_ctx ctx;
+ sha256_init(&ctx);])],
[nettle_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libnettle\.so'`],
[nettle_so=none])
if test -z "$nettle_so"; then
@@ -736,7 +742,10 @@ LIBS=$save_LIBS
save_LIBS=$LIBS
LIBS="$LIBS $HOGWEED_LIBS"
AC_MSG_CHECKING([hogweed soname])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ #include <nettle/rsa.h>],[
+ struct rsa_private_key priv;
+ nettle_rsa_private_key_init(&priv);])],
[hogweed_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libhogweed\.so'`],
[hogweed_so=none])
if test -z "$hogweed_so"; then