]> granicus.if.org Git - pdns/commitdiff
(Finally) move sqlite3 to separate checks
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Wed, 24 Dec 2014 18:42:56 +0000 (19:42 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Wed, 24 Dec 2014 23:17:06 +0000 (00:17 +0100)
configure.ac
m4/pdns_check_sqlite3.m4 [new file with mode: 0644]
m4/pdns_with_sqlite3.m4 [new file with mode: 0644]

index a67f5c5d936f22496e13c5762b97c8877cd43e4f..a244d1ab230bad36df2c82dc430e65c4006a602e 100644 (file)
@@ -85,18 +85,7 @@ BOOST_SERIALIZATION([mt])
 
 PDNS_ENABLE_UNIT_TESTS
 
-dnl Allow user to require SQLite3
-AC_MSG_CHECKING([whether user requires sqlite3])
-AC_ARG_WITH([sqlite3],
-  [AS_HELP_STRING([--with-sqlite3],[include sqlite3 driver @<:@default=no@:>@])],
-  [with_sqlite3=$withval],
-  [with_sqlite3=no]
-)
-AC_MSG_RESULT([$with_sqlite3])
-
-AS_IF([test "x$with_sqlite3" != "xno"], [
-  needsqlite3=yes
-])
+PDNS_WITH_SQLITE3
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_SIZE_T
@@ -279,13 +268,8 @@ AM_CONDITIONAL([ORACLE],[test "x$needoracle" = "xyes"])
 
 AM_CONDITIONAL([LMDB],[test "x$needlmdb" = "xyes"])
 
+PDNS_CHECK_SQLITE3
 AM_CONDITIONAL([SQLITE3], [test "x$needsqlite3" = "xyes"])
-AS_IF([test "x$needsqlite3" = "xyes"], [
-  PKG_CHECK_MODULES([SQLITE3], [sqlite3],
-    [AC_DEFINE([HAVE_SQLITE3], [1], [Define to 1 if you have sqlite3])],
-    [AC_MSG_ERROR([Could not find libsqlite3])]
-  )
-])
 
 for a in $modules; do
   moduledirs="$moduledirs ${a}backend"
diff --git a/m4/pdns_check_sqlite3.m4 b/m4/pdns_check_sqlite3.m4
new file mode 100644 (file)
index 0000000..e2a5e78
--- /dev/null
@@ -0,0 +1,8 @@
+AC_DEFUN([PDNS_CHECK_SQLITE3], [
+  AS_IF([test "x$needsqlite3" = "xyes"], [
+    PKG_CHECK_MODULES([SQLITE3], [sqlite3],
+      [AC_DEFINE([HAVE_SQLITE3], [1], [Define to 1 if you have sqlite3])],
+      [AC_MSG_ERROR([Could not find libsqlite3])]
+    )
+  ])
+])
diff --git a/m4/pdns_with_sqlite3.m4 b/m4/pdns_with_sqlite3.m4
new file mode 100644 (file)
index 0000000..952ad10
--- /dev/null
@@ -0,0 +1,13 @@
+AC_DEFUN([PDNS_WITH_SQLITE3], [
+  AC_MSG_CHECKING([whether user requires sqlite3])
+  AC_ARG_WITH([sqlite3],
+    [AS_HELP_STRING([--with-sqlite3],[include sqlite3 driver @<:@default=no@:>@])],
+    [with_sqlite3=$withval],
+    [with_sqlite3=no]
+  )
+  AC_MSG_RESULT([$with_sqlite3])
+
+  AS_IF([test "x$with_sqlite3" != "xno"], [
+    needsqlite3=yes
+  ])
+])