Browse Source

Merge branch 'trac2367_3'

Mukund Sivaraman 11 years ago
parent
commit
81a689b61b

+ 60 - 15
configure.ac

@@ -24,6 +24,55 @@ AC_CONFIG_MACRO_DIR([m4macros])
 # Checks for programs.
 AC_PROG_CXX
 
+want_dns=yes
+AC_ARG_ENABLE(dns,
+  [AC_HELP_STRING([--disable-dns],
+  [disable DNS components])],
+  [want_dns=$enableval])
+AM_CONDITIONAL([WANT_DNS], [test "$want_dns" = "yes"])
+if test "$want_dns" = "yes"; then
+   WANT_DNS=yes
+else
+   WANT_DNS=no
+fi
+AC_SUBST(WANT_DNS)
+
+want_dhcp=yes
+AC_ARG_ENABLE(dhcp,
+  [AC_HELP_STRING([--disable-dhcp],
+  [disable DHCP components])],
+  [want_dhcp=$enableval])
+AM_CONDITIONAL([WANT_DHCP], [test "$want_dhcp" = "yes"])
+if test "$want_dhcp" = "yes"; then
+   WANT_DHCP=yes
+else
+   WANT_DHCP=no
+fi
+AC_SUBST(WANT_DHCP)
+
+want_experimental_resolver=no
+AC_ARG_ENABLE(experimental-resolver,
+  [AC_HELP_STRING([--enable-experimental-resolver],
+  [enable the experimental resolver [default=no]])],
+  [want_experimental_resolver=$enableval])
+AM_CONDITIONAL([WANT_EXPERIMENTAL_RESOLVER], [test "$want_experimental_resolver" = "yes"])
+if test "$want_experimental_resolver" = "yes"; then
+   WANT_EXPERIMENTAL_RESOLVER=yes
+else
+   WANT_EXPERIMENTAL_RESOLVER=no
+fi
+AC_SUBST(WANT_EXPERIMENTAL_RESOLVER)
+
+# At least DNS or DHCP components must be enabled
+if test "$want_dns" != "yes" -a "$want_dhcp" != "yes"; then
+    AC_MSG_ERROR([At least one of DNS or DHCP components must be enabled to do a BIND 10 build.])
+fi
+
+# Experimental resolver requires DNS components to be enabled
+if test "$want_experimental_resolver" = "yes" -a "$want_dns" != "yes"; then
+    AC_MSG_ERROR([You must also enable DNS components if you want to enable the experimental resolver.])
+fi
+
 # Enable low-performing debugging facilities? This option optionally
 # enables some debugging aids that perform slowly and hence aren't built
 # by default.
@@ -875,6 +924,10 @@ elif test "${mysql_config}" != "no" ; then
 fi
 
 if test "$MYSQL_CONFIG" != "" ; then
+    if test "$want_dhcp" != "yes"; then
+        AC_MSG_ERROR([--with-dhcp-mysql should not be used when DHCP components are disabled])
+    fi
+
     if test -d "$MYSQL_CONFIG" -o ! -x "$MYSQL_CONFIG" ; then
         AC_MSG_ERROR([--with-dhcp-mysql should point to a mysql_config program])
     fi
@@ -1001,25 +1054,12 @@ if test "$BOOST_NUMERIC_CAST_WOULDFAIL" = "yes" -a X"$werror_ok" = X1 -a $CLANGP
     AC_MSG_ERROR([Failed to compile a required header file.  If you are using FreeBSD and Boost installed via ports, retry with specifying --without-werror.  See the ChangeLog entry for Trac no. 1991 for more details.])
 fi
 
-build_experimental_resolver=no
-AC_ARG_ENABLE(experimental-resolver,
-  [AC_HELP_STRING([--enable-experimental-resolver],
-  [enable building of the experimental resolver [default=no]])],
-  [build_experimental_resolver=$enableval])
-AM_CONDITIONAL([BUILD_EXPERIMENTAL_RESOLVER], [test "$build_experimental_resolver" = "yes"])
-if test "$build_experimental_resolver" = "yes"; then
-   BUILD_EXPERIMENTAL_RESOLVER=yes
-else
-   BUILD_EXPERIMENTAL_RESOLVER=no
-fi
-AC_SUBST(BUILD_EXPERIMENTAL_RESOLVER)
-
 use_shared_memory=yes
 AC_ARG_WITH(shared-memory,
     AC_HELP_STRING([--with-shared-memory],
     [Build with Boost shared memory support; for large scale authoritative DNS servers]),
     [use_shared_memory=$withval])
-if test X$use_shared_memory = Xyes -a "$BOOST_MAPPED_FILE_WOULDFAIL" = "yes"; then
+if test X$use_shared_memory = Xyes -a "$BOOST_MAPPED_FILE_WOULDFAIL" = "yes" -a "$want_dns" = "yes"; then
     AC_MSG_ERROR([Boost shared memory does not compile on this system.  If you don't need it (most normal users won't) build without it by rerunning this script with --without-shared-memory; using a different compiler or a different version of Boost may also help.])
 fi
 AM_CONDITIONAL([USE_SHARED_MEMORY], [test x$use_shared_memory = xyes])
@@ -1028,7 +1068,7 @@ if test "x$use_shared_memory" = "xyes"; then
 fi
 AC_SUBST(BOOST_MAPPED_FILE_CXXFLAG)
 
-if test "$BOOST_OFFSET_PTR_OLD" = "yes" -a "$use_shared_memory" = "yes" ; then
+if test "$BOOST_OFFSET_PTR_OLD" = "yes" -a "$use_shared_memory" = "yes" -a "$want_dns" = "yes"; then
     AC_MSG_ERROR([You're trying to compile against boost older than 1.48 with
 shared memory. Older versions of boost have a bug which causes segfaults in
 offset_ptr implementation when compiled by GCC with optimisations enabled.
@@ -1719,6 +1759,11 @@ fi
 
 cat >> config.report << END
 
+Components:
+  DHCP: $want_dhcp
+  DNS: $want_dns
+  Experimental resolver: $want_experimental_resolver
+
 Features:
   $enable_features
 

+ 4 - 1
m4macros/ax_python_sqlite3.m4

@@ -11,7 +11,10 @@ if "$PYTHON" -c 'import sqlite3' 2>/dev/null ; then
     AC_MSG_RESULT(ok)
 else
     AC_MSG_RESULT(missing)
-    AC_MSG_ERROR([Missing sqlite3 python module.])
+
+    if test "x$want_dns" = "xyes" ; then
+        AC_MSG_ERROR([Missing sqlite3 python module that is required by DNS components.])
+    fi
 fi
 
 ])dnl AX_PYTHON_SQLITE3

+ 7 - 3
src/Makefile.am

@@ -1,6 +1,10 @@
-SUBDIRS = lib bin
-# @todo hooks lib could be a configurable switch
-SUBDIRS += hooks
+if WANT_DHCP
+
+want_hooks = hooks
+
+endif # WANT_DHCP
+
+SUBDIRS = lib bin $(want_hooks)
 
 EXTRA_DIST = \
 	cppcheck-suppress.lst		\

+ 30 - 8
src/bin/Makefile.am

@@ -1,16 +1,38 @@
-if BUILD_EXPERIMENTAL_RESOLVER
-# Build resolver only with --enable-experimental-resolver
-experimental_resolver = resolver
-endif
+if WANT_DHCP
+
+want_d2 = d2
+want_dhcp4 = dhcp4
+want_dhcp6 = dhcp6
+
+endif # WANT_DHCP
+
+if WANT_DNS
 
-SUBDIRS = bind10 bindctl cfgmgr ddns loadzone msgq cmdctl auth xfrin \
-	xfrout usermgr zonemgr stats tests $(experimental_resolver) \
-	sockcreator dhcp4 dhcp6 d2 dbutil sysinfo
+want_auth = auth
+want_dbutil = dbutil
+want_ddns = ddns
+want_loadzone = loadzone
+want_xfrin = xfrin
+want_xfrout = xfrout
+want_zonemgr = zonemgr
+
+if WANT_EXPERIMENTAL_RESOLVER
+want_resolver = resolver
+endif
 
 if USE_SHARED_MEMORY
 # Build the memory manager only if we have shared memory.
 # It is useless without it.
-SUBDIRS += memmgr
+want_memmgr = memmgr
 endif
 
+endif # WANT_DNS
+
+# The following build order must be maintained. So we create the
+# variables above and add directories in that order to SUBDIRS.
+SUBDIRS = bind10 bindctl cfgmgr $(want_ddns) $(want_loadzone) msgq cmdctl \
+	$(want_auth) $(want_xfrin) $(want_xfrout) usermgr $(want_zonemgr) \
+	stats tests $(want_resolver) sockcreator $(want_dhcp4) $(want_dhcp6) \
+	$(want_d2) $(want_dbutil) sysinfo $(want_memmgr)
+
 check-recursive: all-recursive

+ 9 - 2
src/bin/cfgmgr/plugins/Makefile.am

@@ -6,13 +6,20 @@ datasrc.spec: datasrc.spec.pre
 	$(SED) -e "s|@@STATIC_ZONE_FILE@@|$(pkgdatadir)/static.zone|;s|@@SQLITE3_DATABASE_FILE@@|$(localstatedir)/$(PACKAGE)/zone.sqlite3|" datasrc.spec.pre >$@
 
 config_plugindir = @prefix@/share/@PACKAGE@/config_plugins
-config_plugin_DATA = logging.spec tsig_keys.spec datasrc.spec
+config_plugin_DATA = logging.spec tsig_keys.spec
 
-python_PYTHON = b10logging.py tsig_keys.py datasrc_config_plugin.py
+python_PYTHON = b10logging.py tsig_keys.py
 pythondir = $(config_plugindir)
 
 CLEANFILES = b10logging.pyc tsig_keys.pyc datasrc.spec
 CLEANDIRS = __pycache__
 
+if WANT_DNS
+
+config_plugin_DATA += datasrc.spec
+python_PYTHON += datasrc_config_plugin.py
+
+endif
+
 clean-local:
 	rm -rf $(CLEANDIRS)

+ 9 - 1
src/bin/cfgmgr/plugins/tests/Makefile.am

@@ -1,5 +1,13 @@
 PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
-PYTESTS = tsig_keys_test.py logging_test.py datasrc_test.py
+PYTESTS = tsig_keys_test.py logging_test.py
+
+if WANT_DNS
+
+PYTESTS += datasrc_test.py
+
+endif
+
+
 
 EXTRA_DIST = $(PYTESTS)
 

+ 31 - 6
src/lib/Makefile.am

@@ -1,8 +1,33 @@
-if BUILD_EXPERIMENTAL_RESOLVER
-# Build resolver only with --enable-experimental-resolver
-experimental_resolver = resolve
+if WANT_DHCP
+
+want_dhcp = dhcp
+want_dhcp_ddns = dhcp_ddns
+want_dhcpsrv = dhcpsrv
+want_hooks = hooks
+
+endif # WANT_DHCP
+
+if WANT_DNS
+
+want_acl = acl
+want_bench = bench
+want_datasrc = datasrc
+want_nsas = nsas
+want_server_common = server_common
+want_statistics = statistics
+want_xfr = xfr
+
+if WANT_EXPERIMENTAL_RESOLVER
+want_cache = cache
+want_resolve = resolve
 endif
 
-SUBDIRS = exceptions util log hooks cryptolink dns cc config acl xfr bench \
-          asiolink asiodns nsas cache $(experimental_resolver) testutils \
-          datasrc server_common python dhcp dhcp_ddns dhcpsrv statistics
+endif # WANT_DNS
+
+# The following build order must be maintained. So we create the
+# variables above and add directories in that order to SUBDIRS.
+SUBDIRS = exceptions util log $(want_hooks) cryptolink dns cc config \
+          $(want_acl) $(want_xfr) $(want_bench) asiolink asiodns \
+          $(want_nsas) $(want_cache) $(want_resolve) testutils \
+          $(want_datasrc) $(want_server_common) python $(want_dhcp) \
+          $(want_dhcp_ddns) $(want_dhcpsrv) $(want_statistics)

+ 0 - 1
src/lib/cache/Makefile.am

@@ -6,7 +6,6 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/lib/util -I$(top_builddir)/src/lib/util
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/nsas -I$(top_builddir)/src/lib/nsas
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/cache -I$(top_builddir)/src/lib/cache
-AM_CPPFLAGS += $(SQLITE_CFLAGS)
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 # Some versions of GCC warn about some versions of Boost regarding

+ 0 - 1
src/lib/nsas/Makefile.am

@@ -6,7 +6,6 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/util -I$(top_builddir)/src/lib/util
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/log -I$(top_builddir)/src/lib/log
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/nsas -I$(top_builddir)/src/lib/nsas
-AM_CPPFLAGS += $(SQLITE_CFLAGS)
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 # Some versions of GCC warn about some versions of Boost regarding missing

+ 22 - 4
src/lib/python/isc/Makefile.am

@@ -1,10 +1,28 @@
-SUBDIRS = datasrc util cc config dns log net notify testutils acl bind10
-SUBDIRS += xfrin log_messages server_common ddns sysinfo statistics
+if WANT_DNS
+
+want_acl = acl
+want_datasrc = datasrc
+want_ddns = ddns
+want_notify = notify
+want_server_common = server_common
+want_statistics = statistics
+want_xfrin = xfrin
+
 if USE_SHARED_MEMORY
-# The memory manager is useless without shared memory support
-SUBDIRS += memmgr
+# Build the memory manager only if we have shared memory.
+# It is useless without it.
+want_memmgr = memmgr
 endif
 
+endif # WANT_DNS
+
+# The following build order must be maintained. So we create the
+# variables above and add directories in that order to SUBDIRS.
+SUBDIRS = $(want_datasrc) util cc config dns log net $(want_notify) \
+	testutils $(want_acl) bind10 $(want_xfrin) log_messages \
+	$(want_server_common) $(want_ddns) sysinfo $(want_statistics) \
+	$(want_memmgr)
+
 python_PYTHON = __init__.py
 
 pythondir = $(pyexecdir)/isc

+ 0 - 1
src/lib/resolve/Makefile.am

@@ -3,7 +3,6 @@ SUBDIRS = . tests
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
 AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += $(SQLITE_CFLAGS)
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 

+ 1 - 1
tests/lettuce/README

@@ -7,7 +7,7 @@ tests could be separated, so that we can test other systems as well.
 
 Prerequisites:
 - BIND 10 must be compiled or installed (even when testing in-tree build;
-  see below)
+  see below) with both DNS and DHCP components enabled
 - dig
 - lettuce (http://lettuce.it)
 

+ 2 - 2
tests/lettuce/setup_intree_bind10.sh.in

@@ -34,8 +34,8 @@ if test $SET_ENV_LIBRARY_PATH = yes; then
 	export @ENV_LIBRARY_PATH@
 fi
 
-BUILD_EXPERIMENTAL_RESOLVER=@BUILD_EXPERIMENTAL_RESOLVER@
-if test $BUILD_EXPERIMENTAL_RESOLVER = yes; then
+WANT_EXPERIMENTAL_RESOLVER=@WANT_EXPERIMENTAL_RESOLVER@
+if test $WANT_EXPERIMENTAL_RESOLVER = yes; then
     cp -f @srcdir@/features/resolver_basic.feature.disabled @srcdir@/features/resolver_basic.feature
 fi
 

+ 9 - 1
tests/tools/Makefile.am

@@ -1 +1,9 @@
-SUBDIRS = badpacket perfdhcp
+if WANT_DNS
+want_badpacket = badpacket
+endif
+
+if WANT_DHCP
+want_perfdhcp = perfdhcp
+endif
+
+SUBDIRS = . $(want_badpacket) $(want_perfdhcp)