summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2021-02-09 06:02:46 +0100
committerGuillem Jover <guillem@hadrons.org>2021-02-09 06:23:38 +0100
commit43d34c9d3b2a24113d3901c3c7d229656cd4ce98 (patch)
tree8c168a40ddd3bcc1de890763c80de954e3dae528
parent1c3ff61699a6343ea4b5b6a757300581c5374d35 (diff)
build: Fix message digest library checks
They were not failing when not finding the SHA-2 functions and were hardcoding -lmd regardless of what library had been found.
-rw-r--r--configure.ac13
1 files changed, 10 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index f100045..7afc7af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,11 +65,18 @@ AM_CONDITIONAL([HAVE_LIBTESTU01],
saved_LIBS="$LIBS"
AC_SEARCH_LIBS([MD5Update], [md], [
- AC_SEARCH_LIBS([SHA512Update], [md], [
- MD_LIBS="-lmd"
+ AS_IF([test "x$ac_cv_search_MD5Update" != "xnone required"], [
+ MD_LIBS="$ac_cv_search_MD5Update"
])
], [
- AC_MSG_ERROR([cannot find required message digest functions in libc or libmd])
+ AC_MSG_ERROR([cannot find required MD5 functions in libc or libmd])
+])
+AC_SEARCH_LIBS([SHA512Update], [md], [
+ AS_IF([test "x$ac_cv_search_SHA512Update" != "xnone required"], [
+ MD_LIBS="$ac_cv_search_SHA512Update"
+ ])
+], [
+ AC_MSG_ERROR([cannot find required SHA-2 functions in libc or libmd])
])
AC_SUBST([MD_LIBS])
LIBS="$saved_LIBS"