]> granicus.if.org Git - pdns/commitdiff
Move verbose logging check to separate macro
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Mon, 6 Jan 2014 13:04:40 +0000 (14:04 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Mon, 6 Jan 2014 13:27:09 +0000 (14:27 +0100)
configure.ac
m4/pdns_enable_verbose_logging.m4 [new file with mode: 0644]

index f304b65c10a571f0d2c88b647e25509265759874..367ec9e62174e7de0b57b7de0537799a92228bdd 100644 (file)
@@ -144,14 +144,7 @@ AC_SUBST(THREADFLAGS)
 
 AC_SUBST(DYNLINKFLAGS)
 
-AC_MSG_CHECKING(whether we will be doing verbose logging)
-AC_ARG_ENABLE(verbose-logging,
- AS_HELP_STRING([--enable-verbose-logging],[do verbose logging]), [enable_verbose_logging=yes], [enable_verbose_logging=no])
-
-if test $enable_verbose_logging = yes; then AC_DEFINE(VERBOSELOG, 1, [If verbose logging should be enabled])
-fi
-AC_MSG_RESULT($enable_verbose_logging)
-
+PDNS_ENABLE_VERBOSE_LOGGING
 PDNS_WITH_SYSTEM_POLARSSL
 PDNS_ENABLE_BOTAN
 PDNS_WITH_CRYPTOPP
diff --git a/m4/pdns_enable_verbose_logging.m4 b/m4/pdns_enable_verbose_logging.m4
new file mode 100644 (file)
index 0000000..fe3cd9b
--- /dev/null
@@ -0,0 +1,17 @@
+AC_DEFUN([PDNS_ENABLE_VERBOSE_LOGGING],[
+  AC_MSG_CHECKING([whether to enable verbose logging])
+
+  AC_ARG_ENABLE([verbose-logging],
+    AS_HELP_STRING([--enable-verbose-logging],
+      [enable verbose logging @<:@default=no@:>@]
+    ),
+    [enable_verbose_logging=yes],
+    [enable_verbose_logging=no]
+  )
+
+  AS_IF([test "x$enable_verbose_logging" = "xyes"],
+    [AC_DEFINE([VERBOSELOG], [1], [Define to 1 if verbose logging is enabled])]
+  )
+
+  AC_MSG_RESULT([$enable_verbose_logging])
+])