3 # dnsc_DNSCRYPT([action-if-true], [action-if-false])
4 # --------------------------------------------------------------------------
5 # Check for required dnscrypt libraries and add dnscrypt configure args.
6 AC_DEFUN([dnsc_DNSCRYPT],
8 AC_ARG_ENABLE([dnscrypt],
9 AS_HELP_STRING([--enable-dnscrypt],
10 [Enable dnscrypt support (requires libsodium)]),
11 [opt_dnscrypt=$enableval], [opt_dnscrypt=no])
13 if test "x$opt_dnscrypt" != "xno"; then
14 AC_ARG_WITH([libsodium], AC_HELP_STRING([--with-libsodium=path],
15 [Path where libsodium is installed, for dnscrypt]), [
16 CFLAGS="$CFLAGS -I$withval/include"
17 LDFLAGS="$LDFLAGS -L$withval/lib"
19 AC_SEARCH_LIBS([sodium_init], [sodium], [],
20 AC_MSG_ERROR([The sodium library was not found. Please install sodium!]))