From: Ruben Kerkhof Date: Mon, 6 Jan 2014 13:05:57 +0000 (+0100) Subject: Move remotebackend_http check to separate macro X-Git-Tag: rec-3.6.0-rc1~264^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5107f74cf9f6e37d1f2fe748d99ea8f0826fe88d;p=pdns Move remotebackend_http check to separate macro --- diff --git a/configure.ac b/configure.ac index 367ec9e62..6c3cd10f1 100644 --- a/configure.ac +++ b/configure.ac @@ -148,21 +148,7 @@ PDNS_ENABLE_VERBOSE_LOGGING PDNS_WITH_SYSTEM_POLARSSL PDNS_ENABLE_BOTAN PDNS_WITH_CRYPTOPP - -AC_ARG_ENABLE(remotebackend_http, AS_HELP_STRING([--enable-remotebackend-http],[enable HTTP connector for remotebackend]),[enable_remotebackend_http=yes], [enable_remotebackend_http=no]) -AC_MSG_CHECKING(whether to enable http connector in remotebackend) -AC_MSG_RESULT($enable_remotebackend_http) -AM_CONDITIONAL(REMOTEBACKEND_HTTP,test x"$enable_remotebackend_http" = "xyes") -if test "x$enable_remotebackend_http" = "xyes" -then - PKG_CHECK_MODULES(LIBCURL, libcurl, HAVE_LIBCURL=yes, AC_MSG_ERROR([Could not find libcurl])) - REMOTEBACKEND_HTTP=yes - AC_SUBST(LIBCURL_LIBS) - AC_SUBST(LIBCURL_CFLAGS) - AC_DEFINE(HAVE_LIBCURL,1,[If we have libcurl]) - AC_DEFINE(REMOTEBACKEND_HTTP,1,[If we want HTTP connector]) - AC_SUBST(REMOTEBACKEND_HTTP) -fi +PDNS_ENABLE_REMOTEBACKEND_HTTP AC_ARG_ENABLE(remotebackend_zeromq, AS_HELP_STRING([--enable-remotebackend-zeromq],[enable ZeroMQ connector for remotebackend]),[enable_remotebackend_zeromq=yes], [enable_remotebackend_zeromq=no]) AC_MSG_CHECKING(whether to enable ZeroMQ connector in remotebackend) diff --git a/m4/pdns_enable_remotebackend_http.m4 b/m4/pdns_enable_remotebackend_http.m4 new file mode 100644 index 000000000..90306bcac --- /dev/null +++ b/m4/pdns_enable_remotebackend_http.m4 @@ -0,0 +1,26 @@ +AC_DEFUN([PDNS_ENABLE_REMOTEBACKEND_HTTP],[ + AC_MSG_CHECKING([whether to enable http connector in remotebackend]) + AC_ARG_ENABLE([remotebackend_http], + AS_HELP_STRING([--enable-remotebackend-http], + [enable HTTP connector for remotebackend @<:@default=no@:>@] + ), + [enable_remotebackend_http=yes], + [enable_remotebackend_http=no] + ) + + AC_MSG_RESULT([$enable_remotebackend_http]) + + AM_CONDITIONAL([REMOTEBACKEND_HTTP],[test "x$enable_remotebackend_http" = "xyes"]) + AC_SUBST(REMOTEBACKEND_HTTP) + AS_IF([test "x$enable_remotebackend_http" = "xyes"], + [PKG_CHECK_MODULES([LIBCURL], [libcurl], + [ + AC_DEFINE([HAVE_LIBCURL], [1], [Define to 1 if you have libcurl]) + AC_DEFINE([REMOTEBACKEND_HTTP], [1], [Define to 1 if you have http connector]) + REMOTEBACKEND_HTTP=yes + ], + [AC_MSG_ERROR([Could not find libcurl])] + )] + ) +]) +