165b390aaSDag-Erling Smørgrav# dnscrypt.m4 265b390aaSDag-Erling Smørgrav 365b390aaSDag-Erling Smørgrav# dnsc_DNSCRYPT([action-if-true], [action-if-false]) 465b390aaSDag-Erling Smørgrav# -------------------------------------------------------------------------- 565b390aaSDag-Erling Smørgrav# Check for required dnscrypt libraries and add dnscrypt configure args. 665b390aaSDag-Erling SmørgravAC_DEFUN([dnsc_DNSCRYPT], 765b390aaSDag-Erling Smørgrav[ 865b390aaSDag-Erling Smørgrav AC_ARG_ENABLE([dnscrypt], 965b390aaSDag-Erling Smørgrav AS_HELP_STRING([--enable-dnscrypt], 1065b390aaSDag-Erling Smørgrav [Enable dnscrypt support (requires libsodium)]), 1165b390aaSDag-Erling Smørgrav [opt_dnscrypt=$enableval], [opt_dnscrypt=no]) 1265b390aaSDag-Erling Smørgrav 1365b390aaSDag-Erling Smørgrav if test "x$opt_dnscrypt" != "xno"; then 1465b390aaSDag-Erling Smørgrav AC_ARG_WITH([libsodium], AC_HELP_STRING([--with-libsodium=path], 1565b390aaSDag-Erling Smørgrav [Path where libsodium is installed, for dnscrypt]), [ 1665b390aaSDag-Erling Smørgrav CFLAGS="$CFLAGS -I$withval/include" 1765b390aaSDag-Erling Smørgrav LDFLAGS="$LDFLAGS -L$withval/lib" 1865b390aaSDag-Erling Smørgrav ]) 1965b390aaSDag-Erling Smørgrav AC_SEARCH_LIBS([sodium_init], [sodium], [], 2065b390aaSDag-Erling Smørgrav AC_MSG_ERROR([The sodium library was not found. Please install sodium!])) 21*c7f4d7adSDag-Erling Smørgrav AC_SEARCH_LIBS([crypto_box_curve25519xchacha20poly1305_beforenm], [sodium], 22*c7f4d7adSDag-Erling Smørgrav [ 23*c7f4d7adSDag-Erling Smørgrav AC_SUBST([ENABLE_DNSCRYPT_XCHACHA20], [1]) 24*c7f4d7adSDag-Erling Smørgrav AC_DEFINE( 25*c7f4d7adSDag-Erling Smørgrav [USE_DNSCRYPT_XCHACHA20], [1], 26*c7f4d7adSDag-Erling Smørgrav [Define to 1 to enable dnscrypt with xchacha20 support]) 27*c7f4d7adSDag-Erling Smørgrav ], 28*c7f4d7adSDag-Erling Smørgrav [ 29*c7f4d7adSDag-Erling Smørgrav AC_SUBST([ENABLE_DNSCRYPT_XCHACHA20], [0]) 30*c7f4d7adSDag-Erling Smørgrav ]) 3165b390aaSDag-Erling Smørgrav $1 3265b390aaSDag-Erling Smørgrav else 33*c7f4d7adSDag-Erling Smørgrav AC_SUBST([ENABLE_DNSCRYPT_XCHACHA20], [0]) 3465b390aaSDag-Erling Smørgrav $2 3565b390aaSDag-Erling Smørgrav fi 3665b390aaSDag-Erling Smørgrav]) 37