summaryrefslogtreecommitdiffstats
path: root/m4/pdns_with_libsodium.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:34:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:34:30 +0000
commit4fc2f55f761d71aae1f145d5aa94ba929cc39676 (patch)
tree5c1e1db3b46dd4edbe11f612d93cb94b96891ce3 /m4/pdns_with_libsodium.m4
parentInitial commit. (diff)
downloaddnsdist-4fc2f55f761d71aae1f145d5aa94ba929cc39676.tar.xz
dnsdist-4fc2f55f761d71aae1f145d5aa94ba929cc39676.zip
Adding upstream version 1.7.3.upstream/1.7.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/pdns_with_libsodium.m4')
-rw-r--r--m4/pdns_with_libsodium.m430
1 files changed, 30 insertions, 0 deletions
diff --git a/m4/pdns_with_libsodium.m4 b/m4/pdns_with_libsodium.m4
new file mode 100644
index 0000000..fbe60d2
--- /dev/null
+++ b/m4/pdns_with_libsodium.m4
@@ -0,0 +1,30 @@
+AC_DEFUN([PDNS_WITH_LIBSODIUM], [
+ AC_MSG_CHECKING([whether we will be linking in libsodium])
+ AC_ARG_WITH([libsodium],
+ AS_HELP_STRING([--with-libsodium],[use libsodium @<:@default=auto@:>@]),
+ [with_libsodium=$withval],
+ [with_libsodium=auto],
+ )
+ AC_MSG_RESULT([$with_libsodium])
+
+ AS_IF([test "x$with_libsodium" != "xno"], [
+ AS_IF([test "x$with_libsodium" = "xyes" -o "x$with_libsodium" = "xauto"], [
+ PKG_CHECK_MODULES([LIBSODIUM], [libsodium], [
+ AC_DEFINE([HAVE_LIBSODIUM], [1], [Define to 1 if you have libsodium])
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$LIBSODIUM_CFLAGS $CFLAGS"
+ LIBS="$LIBSODIUM_LIBS $LIBS"
+ AC_CHECK_FUNCS([crypto_box_easy_afternm crypto_box_curve25519xchacha20poly1305_easy randombytes_stir sodium_memcmp crypto_shorthash])
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+ ], [ : ])
+ ])
+ ])
+ AM_CONDITIONAL([LIBSODIUM], [test "x$LIBSODIUM_LIBS" != "x"])
+ AS_IF([test "x$with_libsodium" = "xyes"], [
+ AS_IF([test x"$LIBSODIUM_LIBS" = "x"], [
+ AC_MSG_ERROR([libsodium requested but libraries were not found])
+ ])
+ ])
+])