]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - dnscrypt/dnscrypt.m4
Vendor import of Unbound 1.6.2.
[FreeBSD/FreeBSD.git] / dnscrypt / dnscrypt.m4
1 # dnscrypt.m4
2
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],
7 [
8   AC_ARG_ENABLE([dnscrypt],
9     AS_HELP_STRING([--enable-dnscrypt],
10                    [Enable dnscrypt support (requires libsodium)]),
11     [opt_dnscrypt=$enableval], [opt_dnscrypt=no])
12
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"
18     ])
19     AC_SEARCH_LIBS([sodium_init], [sodium], [],
20       AC_MSG_ERROR([The sodium library was not found. Please install sodium!]))
21     $1
22   else
23     $2
24   fi
25 ])