]> git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/dnsdistdist/m4/dnsdist_with_libssl.m4
624a3d688f5ff20501355436c91937766340fab4
[thirdparty/pdns.git] / pdns / dnsdistdist / m4 / dnsdist_with_libssl.m4
1 AC_DEFUN([DNSDIST_WITH_LIBSSL], [
2 AC_MSG_CHECKING([whether we will be linking in OpenSSL libssl])
3 HAVE_LIBSSL=0
4 AC_ARG_WITH([libssl],
5 AS_HELP_STRING([--with-libssl],[use OpenSSL libssl @<:@default=auto@:>@]),
6 [with_libssl=$withval],
7 [with_libssl=auto],
8 )
9 AC_MSG_RESULT([$with_libssl])
10
11 AS_IF([test "x$with_libssl" != "xno"], [
12 AS_IF([test "x$with_libssl" = "xyes" -o "x$with_libssl" = "xauto"], [
13 PKG_CHECK_MODULES([LIBSSL], [libssl], [
14 [HAVE_LIBSSL=1]
15 AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have OpenSSL libssl])
16 save_CFLAGS=$CFLAGS
17 save_LIBS=$LIBS
18 CFLAGS="$LIBSSL_CFLAGS $CFLAGS"
19 LIBS="$LIBSSL_LIBS $LIBS"
20 AC_CHECK_FUNCS([SSL_CTX_set_ciphersuites])
21 CFLAGS=$save_CFLAGS
22 LIBS=$save_LIBS
23
24 ], [ : ])
25 ])
26 ])
27 AM_CONDITIONAL([HAVE_LIBSSL], [test "x$LIBSSL_LIBS" != "x"])
28 AS_IF([test "x$with_libssl" = "xyes"], [
29 AS_IF([test x"$LIBSSL_LIBS" = "x"], [
30 AC_MSG_ERROR([OpenSSL libssl requested but libraries were not found])
31 ])
32 ])
33 ])