From: Ruben Kerkhof Date: Mon, 6 Jan 2014 12:39:03 +0000 (+0100) Subject: Move botan checks to separate macro X-Git-Tag: rec-3.6.0-rc1~264^2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b117c5eb32c7d8dc4b5aa0c90e44d2816a3eb90;p=thirdparty%2Fpdns.git Move botan checks to separate macro --- diff --git a/configure.ac b/configure.ac index e1279a6aea..772a80edf1 100644 --- a/configure.ac +++ b/configure.ac @@ -159,39 +159,7 @@ fi AC_MSG_RESULT($enable_verbose_logging) PDNS_WITH_SYSTEM_POLARSSL - -AC_MSG_CHECKING(whether we will be linking in Botan 1.10) -AC_ARG_ENABLE(botan1.10, - AS_HELP_STRING([--enable-botan1.10],[use Botan 1.10]), [enable_botan110=yes], [enable_botan110=no]) -AC_MSG_RESULT($enable_botan110) -AM_CONDITIONAL(BOTAN110,test x"$enable_botan110" = "xyes") - -AC_MSG_CHECKING(whether we will be linking in Botan 1.8) -AC_ARG_ENABLE(botan1.8, - AS_HELP_STRING([--enable-botan1.8],[use Botan 1.8]), [enable_botan18=yes], [enable_botan18=no]) -AC_MSG_RESULT($enable_botan18) -AM_CONDITIONAL(BOTAN18,test x"$enable_botan18" = "xyes") - -AC_MSG_CHECKING(whether we will be linking in Crypto++) -AC_ARG_ENABLE(cryptopp, - AS_HELP_STRING([--enable-cryptopp],[use Crypto++]), [enable_cryptopp=yes], [enable_cryptopp=no]) -AC_MSG_RESULT($enable_cryptopp) -AM_CONDITIONAL(CRYPTOPP,test x"$enable_cryptopp" = "xyes") -if test "x$enable_botan110" = "xyes" -then - PKG_CHECK_MODULES(BOTAN110, botan-1.10, HAVE_BOTAN110=yes, AC_MSG_ERROR([Could not find botan 1.10])) - AC_SUBST(BOTAN110_LIBS) - AC_SUBST(BOTAN110_CFLAGS) - AC_DEFINE(HAVE_BOTAN110,1,[If we have botan 1.10]) -fi - -if test "x$enable_botan18" = "xyes" -then - PKG_CHECK_MODULES(BOTAN18, botan-1.8, HAVE_BOTAN18=yes, AC_MSG_ERROR([Could not find botan 1.8])) - AC_SUBST(BOTAN18_LIBS) - AC_SUBST(BOTAN18_CFLAGS) - AC_DEFINE(HAVE_BOTAN18,1,[If we have botan 1.8]) -fi +PDNS_ENABLE_BOTAN if test "x$enable_cryptopp" = "xyes" then diff --git a/m4/pdns_enable_botan.m4 b/m4/pdns_enable_botan.m4 new file mode 100644 index 0000000000..956f1d3414 --- /dev/null +++ b/m4/pdns_enable_botan.m4 @@ -0,0 +1,37 @@ +AC_DEFUN([PDNS_ENABLE_BOTAN],[ + AC_MSG_CHECKING([whether we will be linking in Botan 1.10]) + AC_ARG_ENABLE([botan1.10], [ + AS_HELP_STRING([--enable-botan1.10], + [use Botan 1.10] + )], + [enable_botan110=yes], + [enable_botan110=no] + ) + AC_MSG_RESULT([$enable_botan110]) + AM_CONDITIONAL(BOTAN110, [test "x$enable_botan110" = "xyes"]) + + AC_MSG_CHECKING([whether we will be linking in Botan 1.8]) + AC_ARG_ENABLE([botan1.8], [ + AS_HELP_STRING([--enable-botan1.8], + [use Botan 1.8] + )], + [enable_botan18=yes], + [enable_botan18=no] + ) + AC_MSG_RESULT([$enable_botan18]) + AM_CONDITIONAL([BOTAN18], [test "x$enable_botan18" = "xyes"]) + + AS_IF([test "x$enable_botan110" = "xyes"], [ + PKG_CHECK_MODULES([BOTAN110], [botan-1.10], + [AC_DEFINE([HAVE_BOTAN110],[1],[Define to 1 if you have botan 1.10])], + [AC_MSG_ERROR([Could not find botan 1.10])] + )] + ) + + AS_IF([test "x$enable_botan18" = "xyes"], [ + PKG_CHECK_MODULES([BOTAN18], [botan-1.8], + [AC_DEFINE([HAVE_BOTAN18], [1], [Define to 1 if you have botan 1.10])], + [AC_MSG_ERROR([Could not find botan 1.8])] + )] + ) +])