]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
new config option: build ATF stuff from bind [#38754]
authorFrancis Dupont <fdupont@isc.org>
Tue, 14 Apr 2015 10:44:29 +0000 (12:44 +0200)
committerFrancis Dupont <fdupont@isc.org>
Tue, 14 Apr 2015 10:44:29 +0000 (12:44 +0200)
23 files changed:
Makefile.am
Makefile.in
README
RELNOTES
client/Makefile.in
client/tests/Makefile.in
common/Makefile.in
common/tests/Makefile.in
configure
configure.ac
dhcpctl/Makefile.in
doc/devel/atf.dox
dst/Makefile.in
includes/Makefile.in
omapip/Makefile.in
relay/Makefile.in
server/Makefile.in
server/tests/Makefile.in
tests/Makefile.in
util/Makefile.bind.in [moved from util/Makefile.bind with 60% similarity]
util/bind.sh
util/bindcus.sh [deleted file]
util/bindlib.sh [deleted file]

index ab1d0d6544d632c0a3cfa2e0bf315f20ac608a32..57fd09d2391affd16017bbf7aa7d0a1dcf3ba67e 100644 (file)
@@ -22,7 +22,7 @@ EXTRA_DIST = RELNOTES LICENSE \
             doc/devel/arch.dox doc/devel/atf.dox doc/devel/contrib.dox \
             doc/devel/debug.dox doc/devel/isc-logo.jpg doc/devel/mainpage.dox \
             doc/devel/omapi.dox doc/devel/qa.dox util/bindvar.sh \
-            bind/Makefile bind/bind.tar.gz bind/version.tmp \
+            bind/Makefile.in bind/bind.tar.gz bind/version.tmp \
             common/tests/Atffile server/tests/Atffile
 
 SUBDIRS = bind includes tests common dst omapip client dhcpctl relay server
index b273fc177e38d5270585215ab2aeb0e7ba77545b..13263553239131282eb7a52258e1f09b9cc1da39 100644 (file)
@@ -81,6 +81,7 @@ host_triplet = @host@
 subdir = .
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
        $(top_srcdir)/configure $(am__configure_deps) \
+       $(top_srcdir)/bind/Makefile.in \
        $(top_srcdir)/doc/devel/doxyfile.in $(nobase_include_HEADERS) \
        README compile config.guess config.sub depcomp install-sh \
        missing
@@ -92,7 +93,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/includes/config.h
-CONFIG_CLEAN_FILES = doc/devel/doxyfile
+CONFIG_CLEAN_FILES = bind/Makefile doc/devel/doxyfile
 CONFIG_CLEAN_VPATH_FILES =
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -231,6 +232,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -344,7 +346,7 @@ EXTRA_DIST = RELNOTES LICENSE \
             doc/devel/arch.dox doc/devel/atf.dox doc/devel/contrib.dox \
             doc/devel/debug.dox doc/devel/isc-logo.jpg doc/devel/mainpage.dox \
             doc/devel/omapi.dox doc/devel/qa.dox util/bindvar.sh \
-            bind/Makefile bind/bind.tar.gz bind/version.tmp \
+            bind/Makefile.in bind/bind.tar.gz bind/version.tmp \
             common/tests/Atffile server/tests/Atffile
 
 SUBDIRS = bind includes tests common dst omapip client dhcpctl relay server
@@ -377,6 +379,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
        $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 $(am__aclocal_m4_deps):
+bind/Makefile: $(top_builddir)/config.status $(top_srcdir)/bind/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
 doc/devel/doxyfile: $(top_builddir)/config.status $(top_srcdir)/doc/devel/doxyfile.in
        cd $(top_builddir) && $(SHELL) ./config.status $@
 install-nobase_includeHEADERS: $(nobase_include_HEADERS)
diff --git a/README b/README
index 1ff685cfbcab1a1e24eebc9d1a6f3915a97fdc9a..2e0aff01169315228a4d3da9d32766ee70b80655 100644 (file)
--- a/README
+++ b/README
@@ -38,6 +38,7 @@ the ISC DHCP Distribution.
          5.8.3 Other Solaris Items
         5.9     AIX
         5.10    MacOS X
+         5.11    ATF
        6       SUPPORT
         6.1     HOW TO REPORT BUGS
        7       HISTORY
@@ -585,6 +586,18 @@ recomputed from scratch when the current location/set is changed.
 Running the dhclient-script reinstalls the resolv.conf.dhclient6
 configuration.
 
+
+                              ATF
+
+Please see the file DHCP/doc/devel/atf.dox for a description of building
+and using these tools.  
+
+The optional unit tests use ATF (Automated Testing Framework) including
+the atf-run and atf-report tools. ATF deprecated these tools in
+version 0.19 and removed these tools from its sources in version 0.20,
+requiring you to get an older version, use Kyua with an ATF compatibility
+package or use the version included in the Bind sources.
+
                               SUPPORT
 
 The Internet Systems Consortium DHCP server is developed and distributed
index b0c3dc92694f1f63e5cdc9ec68879e5ae1637358..cbffebe7dc4dfbb6dd09a25ce1b32955cf26d77d 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -54,6 +54,11 @@ by Eric Young (eay@cryptsoft.com).
 
                        Changes since 4.3.2
 
+- The ATF (Automated Testing Framework) tools used for optional unit tests
+  can now be built from its embedded sources in bind, solving the
+  atf-run / atf-report issue with recent (>= 0.20) versions of ATF.
+  The new configuration option is "./configure --with-atf=bind".
+
 - The server now does a better check to see if it can allocate the memory
   for large blocks of v4 leases and should provide a slightly better error
   message.  Note well: the server pre-allocates v4 addresses, if you use
index 7b7d606768757606d90cf745057e2ac875908ccd..72fce7c8083f6aa8017975cb6b81779afad097fe 100644 (file)
@@ -239,6 +239,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index d724a1e387179ec298127b8c5fcb29115432c421..303eb130c79761ce1ee1ed8dd543eea3dab4e904 100644 (file)
@@ -212,6 +212,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index 51e781846cfe93b802269bed124f39aefb60f3ce..ade60f17a1a33f5959756c71257c35b08d44b420 100644 (file)
@@ -246,6 +246,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index a7ebb0575770787f8d76903825cbfbfac4a0f248..8fdddf6364bb00ef950f4cbf0435fe253fa71b1d 100644 (file)
@@ -250,6 +250,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index 2f2a2c5053875b8e31e6ff1f0b863e086245834d..e652a083f9b8ecc533f89e26502e61e245796aa7 100755 (executable)
--- a/configure
+++ b/configure
@@ -632,11 +632,14 @@ HAVE_ATF_TRUE
 ATF_BIN
 ATF_LDFLAGS
 ATF_CFLAGS
+BIND_ATF_FALSE
+BIND_ATF_TRUE
 byte_order
 RANLIB
 EGREP
 GREP
 CPP
+BINDCONFIG
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
@@ -1421,7 +1424,7 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-atf=PATH         specify location where atf was installed
+  --with-atf=PATH         specify location where atf was installed (or "bind")
   --with-srv-lease-file=PATH
                           File for dhcpd leases (default is
                           LOCALSTATEDIR/db/dhcpd.leases)
@@ -4444,6 +4447,10 @@ if test "$GCC" = "yes"; then
        fi
 fi
 
+# We can have some flags to pass to bind configure
+BINDCONFIG=
+
+
 # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
 # parts of the IPv6 Advanced Socket API as a result.  This is stupid
 # as it breaks how the two halves (Basic and Advanced) of the IPv6
@@ -5428,7 +5435,25 @@ if test "${with_atf+set}" = set; then :
   withval=$with_atf; atf_path="$withval"
 fi
 
-if test "$atf_path" != "no" ; then
+ if test "$atf_path" = "bind"; then
+  BIND_ATF_TRUE=
+  BIND_ATF_FALSE='#'
+else
+  BIND_ATF_TRUE='#'
+  BIND_ATF_FALSE=
+fi
+
+if test "$atf_path" = "bind" ; then
+    atf_pcp="bind"
+    atf_path="\${top_srcdir}/bind/atf"
+    ATF_CFLAGS="-I$atf_path/include -DUNIT_TEST"
+    ATF_LDFLAGS="-L$atf_path/lib -latf-c"
+    ATF_BIN=`pwd`/bind/atf/bin
+
+
+
+    BINDCONFIG="$BINDCONFIG --with-atf"
+elif test "$atf_path" != "no" ; then
     # Config path for pkg-config
     atf_pcp=""
     if test "$atf_path" != "yes" ; then
@@ -5611,7 +5636,8 @@ _ACEOF
 fi
 
 
-echo -n "checking for dhcpd.leases location..."
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dhcpd.leases location" >&5
+$as_echo_n "checking for dhcpd.leases location... " >&6; }
 if [ "x$with_srv_lease_file" = "x" ] ; then
        if [ -d "${localstatedir}/db" ] ; then
                with_srv_lease_file="${localstatedir}/db/dhcpd.leases"
@@ -5633,7 +5659,8 @@ if [ "x$with_srv_lease_file" = "x" ] ; then
                with_srv_lease_file="/etc/dhcpd.leases"
        fi
 fi
-echo "$with_srv_lease_file"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_srv_lease_file" >&5
+$as_echo "$with_srv_lease_file" >&6; }
 
 
 # Check whether --with-srv6-lease-file was given.
@@ -5646,7 +5673,8 @@ _ACEOF
 fi
 
 
-echo -n "checking for dhcpd6.leases location..."
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dhcpd6.leases location" >&5
+$as_echo_n "checking for dhcpd6.leases location... " >&6; }
 if [ "x$with_srv6_lease_file" = "x" ] ; then
        if [ -d "${localstatedir}/db" ] ; then
                with_srv6_lease_file="${localstatedir}/db/dhcpd6.leases"
@@ -5668,7 +5696,8 @@ if [ "x$with_srv6_lease_file" = "x" ] ; then
                with_srv6_lease_file="/etc/dhcpd6.leases"
        fi
 fi
-echo "$with_srv6_lease_file"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_srv6_lease_file" >&5
+$as_echo "$with_srv6_lease_file" >&6; }
 
 
 # Check whether --with-cli-lease-file was given.
@@ -5681,7 +5710,8 @@ _ACEOF
 fi
 
 
-echo -n "checking for dhclient.leases location..."
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dhclient.leases location" >&5
+$as_echo_n "checking for dhclient.leases location... " >&6; }
 if [ "x$with_cli_lease_file" = "x" ] ; then
        if [ -d "${localstatedir}/db" ] ; then
                with_cli_lease_file="${localstatedir}/db/dhclient.leases"
@@ -5703,7 +5733,8 @@ if [ "x$with_cli_lease_file" = "x" ] ; then
                with_cli_lease_file="/etc/dhclient.leases"
        fi
 fi
-echo "$with_cli_lease_file"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cli_lease_file" >&5
+$as_echo "$with_cli_lease_file" >&6; }
 
 
 # Check whether --with-cli6-lease-file was given.
@@ -5716,7 +5747,8 @@ _ACEOF
 fi
 
 
-echo -n "checking for dhclient6.leases location..."
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dhclient6.leases location" >&5
+$as_echo_n "checking for dhclient6.leases location... " >&6; }
 if [ "x$with_cli6_lease_file" = "x" ] ; then
        if [ -d "${localstatedir}/db" ] ; then
                with_cli6_lease_file="${localstatedir}/db/dhclient6.leases"
@@ -5738,7 +5770,8 @@ if [ "x$with_cli6_lease_file" = "x" ] ; then
                with_cli6_lease_file="/etc/dhclient6.leases"
        fi
 fi
-echo "$with_cli6_lease_file"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cli6_lease_file" >&5
+$as_echo "$with_cli6_lease_file" >&6; }
 
 
 # Check whether --with-srv-pid-file was given.
@@ -6598,6 +6631,10 @@ no)
        ;;
 *)
        libbind="$use_libbind"
+       if test ! -d "bind"; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: empty bind directory" >&5
+$as_echo "$as_me: WARNING: empty bind directory" >&2;}
+       fi
        ;;
 esac
 
@@ -6812,7 +6849,7 @@ $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
   fi
 
 
-ac_config_files="$ac_config_files Makefile client/Makefile client/tests/Makefile common/Makefile common/tests/Makefile dhcpctl/Makefile dst/Makefile includes/Makefile omapip/Makefile relay/Makefile server/Makefile tests/Makefile tests/unittest.sh server/tests/Makefile doc/devel/doxyfile"
+ac_config_files="$ac_config_files Makefile bind/Makefile client/Makefile client/tests/Makefile common/Makefile common/tests/Makefile dhcpctl/Makefile dst/Makefile includes/Makefile omapip/Makefile relay/Makefile server/Makefile tests/Makefile tests/unittest.sh server/tests/Makefile doc/devel/doxyfile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -6952,6 +6989,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
+if test -z "${BIND_ATF_TRUE}" && test -z "${BIND_ATF_FALSE}"; then
+  as_fn_error $? "conditional \"BIND_ATF\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HAVE_ATF_TRUE}" && test -z "${HAVE_ATF_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_ATF\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -7551,6 +7592,7 @@ do
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "includes/config.h") CONFIG_HEADERS="$CONFIG_HEADERS includes/config.h" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "bind/Makefile") CONFIG_FILES="$CONFIG_FILES bind/Makefile" ;;
     "client/Makefile") CONFIG_FILES="$CONFIG_FILES client/Makefile" ;;
     "client/tests/Makefile") CONFIG_FILES="$CONFIG_FILES client/tests/Makefile" ;;
     "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;;
index ead0bc7740d47a75566af7a331c93c25c42f8a56..8a183bcb681272db7c72bef0ca3d67779f65bbbd 100644 (file)
@@ -32,6 +32,10 @@ if test "$GCC" = "yes"; then
        fi
 fi
 
+# We can have some flags to pass to bind configure
+BINDCONFIG=
+AC_SUBST(BINDCONFIG)
+
 # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
 # parts of the IPv6 Advanced Socket API as a result.  This is stupid
 # as it breaks how the two halves (Basic and Advanced) of the IPv6
@@ -187,9 +191,20 @@ fi
 
 atf_path="no"
 AC_ARG_WITH([atf],
-    AS_HELP_STRING([--with-atf=PATH],[specify location where atf was installed]),
+    AS_HELP_STRING([--with-atf=PATH],[specify location where atf was installed (or "bind")]),
     [atf_path="$withval"])
-if test "$atf_path" != "no" ; then
+AM_CONDITIONAL(BIND_ATF, test "$atf_path" = "bind")
+if test "$atf_path" = "bind" ; then
+    atf_pcp="bind"
+    atf_path="\${top_srcdir}/bind/atf"
+    ATF_CFLAGS="-I$atf_path/include -DUNIT_TEST"
+    ATF_LDFLAGS="-L$atf_path/lib -latf-c"
+    ATF_BIN=`pwd`/bind/atf/bin
+    AC_SUBST(ATF_CFLAGS)
+    AC_SUBST(ATF_LDFLAGS)
+    AC_SUBST(ATF_BIN)
+    BINDCONFIG="$BINDCONFIG --with-atf"
+elif test "$atf_path" != "no" ; then
     # Config path for pkg-config
     atf_pcp=""
     if test "$atf_path" != "yes" ; then
@@ -264,7 +279,7 @@ AC_ARG_WITH(srv-lease-file,
        AC_DEFINE_UNQUOTED([_PATH_DHCPD_DB], ["$withval"],
                           [File for dhcpd leases.]))
 
-echo -n "checking for dhcpd.leases location..."
+AC_MSG_CHECKING([for dhcpd.leases location])
 if [[ "x$with_srv_lease_file" = "x" ]] ; then
        if [[ -d "${localstatedir}/db" ]] ; then
                with_srv_lease_file="${localstatedir}/db/dhcpd.leases"
@@ -286,7 +301,7 @@ if [[ "x$with_srv_lease_file" = "x" ]] ; then
                with_srv_lease_file="/etc/dhcpd.leases"
        fi
 fi
-echo "$with_srv_lease_file"
+AC_MSG_RESULT($with_srv_lease_file)
 
 AC_ARG_WITH(srv6-lease-file,
        AS_HELP_STRING([--with-srv6-lease-file=PATH],[File for dhcpd6 leases 
@@ -294,7 +309,7 @@ AC_ARG_WITH(srv6-lease-file,
        AC_DEFINE_UNQUOTED([_PATH_DHCPD6_DB], ["$withval"],
                           [File for dhcpd6 leases.]))
 
-echo -n "checking for dhcpd6.leases location..."
+AC_MSG_CHECKING([for dhcpd6.leases location])
 if [[ "x$with_srv6_lease_file" = "x" ]] ; then
        if [[ -d "${localstatedir}/db" ]] ; then
                with_srv6_lease_file="${localstatedir}/db/dhcpd6.leases"
@@ -316,7 +331,7 @@ if [[ "x$with_srv6_lease_file" = "x" ]] ; then
                with_srv6_lease_file="/etc/dhcpd6.leases"
        fi
 fi
-echo "$with_srv6_lease_file"
+AC_MSG_RESULT($with_srv6_lease_file)
 
 AC_ARG_WITH(cli-lease-file,
        AS_HELP_STRING([--with-cli-lease-file=PATH],[File for dhclient leases 
@@ -324,7 +339,7 @@ AC_ARG_WITH(cli-lease-file,
        AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_DB], ["$withval"],
                           [File for dhclient leases.]))
 
-echo -n "checking for dhclient.leases location..."
+AC_MSG_CHECKING([for dhclient.leases location])
 if [[ "x$with_cli_lease_file" = "x" ]] ; then
        if [[ -d "${localstatedir}/db" ]] ; then
                with_cli_lease_file="${localstatedir}/db/dhclient.leases"
@@ -346,7 +361,7 @@ if [[ "x$with_cli_lease_file" = "x" ]] ; then
                with_cli_lease_file="/etc/dhclient.leases"
        fi
 fi
-echo "$with_cli_lease_file"
+AC_MSG_RESULT($with_cli_lease_file)
 
 AC_ARG_WITH(cli6-lease-file,
        AS_HELP_STRING([--with-cli6-lease-file=PATH],[File for dhclient6 leases 
@@ -354,7 +369,7 @@ AC_ARG_WITH(cli6-lease-file,
        AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_DB], ["$withval"],
                           [File for dhclient6 leases.]))
 
-echo -n "checking for dhclient6.leases location..."
+AC_MSG_CHECKING([for dhclient6.leases location])
 if [[ "x$with_cli6_lease_file" = "x" ]] ; then
        if [[ -d "${localstatedir}/db" ]] ; then
                with_cli6_lease_file="${localstatedir}/db/dhclient6.leases"
@@ -376,7 +391,7 @@ if [[ "x$with_cli6_lease_file" = "x" ]] ; then
                with_cli6_lease_file="/etc/dhclient6.leases"
        fi
 fi
-echo "$with_cli6_lease_file"
+AC_MSG_RESULT($with_cli6_lease_file)
 
 AC_ARG_WITH(srv-pid-file,
        AS_HELP_STRING([--with-srv-pid-file=PATH],[File for dhcpd process information
@@ -594,6 +609,9 @@ no)
        ;;
 *)
        libbind="$use_libbind"
+       if test ! -d "bind"; then
+               AC_MSG_WARN(empty bind directory)
+       fi      
        ;;
 esac
 
@@ -641,6 +659,7 @@ AC_C_FLEXIBLE_ARRAY_MEMBER
 
 AC_CONFIG_FILES([
   Makefile
+  bind/Makefile
   client/Makefile
   client/tests/Makefile
   common/Makefile
index 105ceb6997c69f5611ce5b1f50bcbb83c7ca4cd2..0141b7482599a66d522807cc8d5b502b44daf42a 100644 (file)
@@ -214,6 +214,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index dd596841ce7a39a355b8d1872147a9b05012f635..0bf82d134a4f1da99ae9c64402a4b1224aa792fe 100644 (file)
@@ -31,9 +31,19 @@ Test Framework)</a> as a framework to run our unittests.
 ATF stands for Automated Test Framework, and is the framework used for unit
 tests in ISC DHCP and BIND9. ATF sources can be downloaded from
 https://github.com/jmmv/kyua . ATF itself must be configured, compiled
-and then installed to be available during the DHCP configure procedure.  Please
+and then installed to be available during the DHCP configure procedure.
+
+There are three options for installing ATF.  1) Get the ATF sources and
 follow INSTALL file supplied with ATF sources (it's essentially the typical
-./configure && make && make install procedure).
+./configure && make && make install procedure).  2) install Kyua with the ATF
+compatibility package, or 3) use the ATF version included in bind sources.
+
+To configure and build the ATF from BIND you should set the "--with-atf" option
+to "bind".
+@verbatim
+./configure --with-atf=bind
+@endverbatim
+
 
 Beginning with ATF version 0.16, it is necessary to include the following
 options --enable-tools and --disable-shared when configuring ATF:
@@ -46,10 +56,11 @@ ISC DHCP unittests will run with ATF releases upto 0.19.  Beginning with
 ATF 0.20, the tools, atf-run and atf-report required by ISC DHCP, were
 deprecated and are no longer included with ATF.
 
-The ATF successor, called Kyua, is being developed. As of August 2012, the
-latest available release of Kyua is 0.5. It claims to offer feature parity with
-ATF. Migration to Kyua may be planned some time in the future, but DHCP uses ATF
-for now. Such an upgrade should be done in coordination with BIND.
+The ATF successor, called Kyua, is being developed. As of August 2012,
+the latest available release of Kyua is 0.5. It claims to offer
+feature parity with ATF. Migration to Kyua may be planned some time in
+the future, but DHCP uses ATF for now. Such an upgrade should be done
+in coordination with BIND.
 
 To build and run the unit-tests, use the following:
 
@@ -86,21 +97,23 @@ or
 $ sh ../../tests/unittests.sh
 @endverbatim
 
-atf-run will read the Atffile in the current directory and execute all the tests
-specified in it. Using atf-run - rather than calling the test binary directly -
-has several major benefits. The main one is that atf-run is able to recover from
-test segfault and continue execution from the next case onwards. Another is that
-it is possible to specify a timeout for a test. atf-run will kill the test in
-case of any infinite loops and will continue running next tests.
+atf-run will read the Atffile in the current directory and execute all
+the tests specified in it. Using atf-run - rather than calling the
+test binary directly - has several major benefits. The main one is
+that atf-run is able to recover from test segfault and continue
+execution from the next case onwards. Another is that it is possible
+to specify a timeout for a test. atf-run will kill the test in case of
+any infinite loops and will continue running next tests.
 
 It is possible to run atf-run without passing its output to atf-report, but its
 output is somewhat convoluted. That is useful in some situations, e.g. when one
 wants to see test output.
 
-It is possible to run test binary directly. The only required parameter is the
-test case name. The binary will print out a warning that direct binary execution
-is not recommended as it won't be able to recover from crash.  However, such an
-approach is convenient for running the test under the debugger.
+It is possible to run test binary directly. The only required
+parameter is the test case name. The binary will print out a warning
+that direct binary execution is not recommended as it won't be able to
+recover from crash.  However, such an approach is convenient for
+running the test under the debugger.
 
 @section testsAtfAdding Adding new unit-tests
 
@@ -162,27 +175,30 @@ See existing Makefile.am for examples, and the Automake documentation:
 
     http://www.gnu.org/software/automake/manual/html_node/Tests.html
 
-<b>2. Implement the test.</b> That typically means that you create a new file that will
-hold test code. It is recommended you name it (tested_feature_name)_unittest.c
-and put the file in specified tests directory.  For example tests related to
-hash tables used on the server side should be named
-server/tests/hash_unittest.c. If in doubt, it is convenient to name the test
-code after the file that holds tested code, e.g. server/mdb6.c is tested in
+<b>2. Implement the test.</b> That typically means that you create a
+new file that will hold test code. It is recommended you name it
+(tested_feature_name)_unittest.c and put the file in specified tests
+directory.  For example tests related to hash tables used on the
+server side should be named server/tests/hash_unittest.c. If in doubt,
+it is convenient to name the test code after the file that holds
+tested code, e.g. server/mdb6.c is tested in
 server/tests/mdb6_unittest.c.
 
-The file server/tests/simple_unittest.c holds a template explaining the basic
-layout of the ATF tests.  There may be many test cases in a single *_unittest.c
-file. Make sure that you register all your test cases using ATF_TP_ADD_TC()
-macro, and try to minimize modifications to the tested code if possible. Keep in
-mind that we are using modernized \ref codingGuidelines for test
-development. You are advised to also look at atf-c-api(3) man page.
-
-To add a new test, such as when a new module is added or when you want to start
-testing existing code, you can copy the server/tests/simple_unittest.c as a new
-new file, add the new file as a target in Makefile.am, and begin adding
-tests. Reviewing that file is a good idea, even if you decide to write your test
-from scratch, as it give you quick overview of the essential capabilities of the
-ATF framework (how to write test, how to make checks, pass or fail test
+The file server/tests/simple_unittest.c holds a template explaining
+the basic layout of the ATF tests.  There may be many test cases in a
+single *_unittest.c file. Make sure that you register all your test
+cases using ATF_TP_ADD_TC() macro, and try to minimize modifications
+to the tested code if possible. Keep in mind that we are using
+modernized \ref codingGuidelines for test development. You are advised
+to also look at atf-c-api(3) man page.
+
+To add a new test, such as when a new module is added or when you want
+to start testing existing code, you can copy the
+server/tests/simple_unittest.c as a new new file, add the new file as
+a target in Makefile.am, and begin adding tests. Reviewing that file
+is a good idea, even if you decide to write your test from scratch, as
+it give you quick overview of the essential capabilities of the ATF
+framework (how to write test, how to make checks, pass or fail test
 etc.). Do not forget to add your new file to git via "git add
 yourtest_unittest.c".
 
@@ -190,14 +206,15 @@ yourtest_unittest.c".
 name to ATF_TESTS. The tests directory will be built only in case where
 ATF is enabled, using --with-atf during configure phase.
 
-<b>4. Modify Atffile to include your new test</b>, if needed. Tests in the
-specified directory must be registered in Atffile. See server/tests/Atffile for
-an example. Currently every executable with name of the form *_unittest will be
-executed automatically. If you followed naming convention proposed in a previous
-step, your test will be included and will be included automatically.
+<b>4. Modify Atffile to include your new test</b>, if needed. Tests in
+the specified directory must be registered in Atffile. See
+server/tests/Atffile for an example. Currently every executable with
+name of the form *_unittest will be executed automatically. If you
+followed naming convention proposed in a previous step, your test will
+be included and will be included automatically.
 
-<b>5. Enjoy your improved confidence in the code</b>, as you can run the tests after
-any change you may want to do:
+<b>5. Enjoy your improved confidence in the code</b>, as you can run
+the tests after any change you may want to do:
 
 @verbatim
 $ make check
index ff12ff955959b9e19e933d0953603ab4f841adfd..846877de6835623aec14e5807ef6fd2090efa8e5 100644 (file)
@@ -195,6 +195,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index b453cddb76636d7213e049a55a63006cb78a608f..45c318896a4d7d6c68197c70d118c8d5f4c36b05 100644 (file)
@@ -168,6 +168,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index 35e2f7f3b65f234543524841419aa0263e7c40af..6086e9f0592bc62be752cf23c7dd88ce24f763d1 100644 (file)
@@ -211,6 +211,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index 2fc955d763f01dad29bc7d9e1351cad9bde15587..5d9f98597056f86a34a187ccca94dddd8e20fa8e 100644 (file)
@@ -192,6 +192,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index 806523133e6da3ebfa27e9c32c1726e8e81b80aa..939e47eec59c4d6f87932ab63bfe5cdf9110b971 100644 (file)
@@ -253,6 +253,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index 33669fe52abdbfb85229123a409d8216ac2a3a75..a103666efe61491bd2e27edaee5b8a6fa4cd17d5 100644 (file)
@@ -259,6 +259,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
index 629339d769af600c6330c47b6ba4dcb16f11ac96..64297ae4ea18a722a19de912a831e4a16a5885ed 100644 (file)
@@ -163,6 +163,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BINDCONFIG = @BINDCONFIG@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
similarity index 60%
rename from util/Makefile.bind
rename to util/Makefile.bind.in
index bd68319ef7ed70fcc62cc7cadb6afd2d1d3ddbe5..f972c71aa4387d32eb15ad0d043b6bfb40b1a730 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2009-2012  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2009-2012, 2015  Internet Systems Consortium, Inc. ("ISC")
 #
 # Permission to use, copy, modify, and/or distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: Makefile.bind,v 1.8 2012/04/05 22:16:47 sar Exp $
-
 # Configure and build the bind libraries for use by DHCP
 
 include ./version.tmp
 version=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
 
-# bindvar.tmp is constructed by configure, it has the paths for
+# bindvar.tmp is constructed by configure, it has the paths for bind
 # if GMAKE is blank the shell script couldn't find a gmake to use.
 # binddir=
 # GMAKE=
@@ -28,6 +26,16 @@ include ./bindvar.tmp
 
 bindsrcdir=bind-${version}
 
+bindconfig = --disable-kqueue --disable-epoll --disable-devpoll
+bindconfig += --without-openssl --without-libxml2 --enable-exportlib
+bindconfig += --enable-threads=no --with-export-includedir=${binddir}/include
+bindconfig += --with-export-libdir=${binddir}/lib --with-gssapi=no
+bindconfig += @BINDCONFIG@
+
+cleandirs = ./lib ./include
+@BIND_ATF_TRUE@cleandirs += ./atf
+cleanfiles = ./configure.log ./build.log ./install.log
+
 all:
 # Extract the source from the tarball, if it hasn't been already.
        @if test -d ${bindsrcdir} ; then                    \
@@ -42,19 +50,30 @@ all:
        fi
 
 # Configure the export libraries
-# Currently disable the epoll and devpoll options as they don't interact
-# well with the DHCP code.
+# Currently disable the epoll, devpoll and kqueue options as they
+# don't interact well with the DHCP code.
 # If the top-level Bind Makefile exists we skip the configuration step
 # as we assume it's done and won't change.  Doing a make clean will
 # reset things if necessary.
-       @if test -f ${bindsrcdir}/Makefile ; then                  \
-               echo Bind export libraries already configured ;    \
-       else                                                       \
-               echo Configuring BIND Export libraries for DHCP. ; \
-               rm -rf ./lib ./include ./configure.log ./build.log ./install.log ; \
-               (cd ${bindsrcdir} && ./configure --disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib --with-gssapi=no > ${binddir}/configure.log); \
+       @if test -f ${bindsrcdir}/Makefile ; then                       \
+               echo Bind export libraries already configured ;         \
+       else                                                            \
+               echo Configuring BIND Export libraries for DHCP. ;      \
+               rm -rf ${cleandirs} ${cleanfiles} ;                     \
+               (cd ${bindsrcdir} &&                                    \
+                 ./configure ${bindconfig} > ${binddir}/configure.log); \
        fi
 
+# Build and copy the ATF support if not yet installed.
+@BIND_ATF_TRUE@        @if test -d ./atf ; then                                      \
+@BIND_ATF_TRUE@                echo ATF support already installed ;                  \
+@BIND_ATF_TRUE@        else                                                          \
+@BIND_ATF_TRUE@                echo Building ATF support ;                           \
+@BIND_ATF_TRUE@                (cd ${bindsrcdir}/unit;                               \
+@BIND_ATF_TRUE@                 MAKE=${GMAKE} ${GMAKE} atf > ${binddir}/build.log ;  \
+@BIND_ATF_TRUE@                 cp -rp atf ${binddir}) ;                             \
+@BIND_ATF_TRUE@        fi
+
 # Build and install the export libraries
 # No need to do anything if we already have something installed.
        @if test -d ${binddir}/lib ; then                                    \
@@ -63,7 +82,7 @@ all:
                echo Building BIND Export libraries - this takes some time. ;\
                (cd ${bindsrcdir}/lib/export ;                               \
                  echo building in `pwd` ;                                   \
-                 MAKE=${GMAKE} ${GMAKE} > ${binddir}/build.log) ;           \
+                 MAKE=${GMAKE} ${GMAKE} >> ${binddir}/build.log) ;          \
                                                                              \
                echo Installing BIND Export libraries to ${binddir}. ;       \
                (cd ${bindsrcdir}/lib/export ;                               \
@@ -72,8 +91,7 @@ all:
 
 clean:
        @echo Cleaning BIND export library.
-       rm -rf ${bindsrcdir} ./lib ./include ./configure.log ./build.log \
-               ./install.log
+       rm -rf ${bindsrcdir} ${cleandirs} ${cleanfiles}
 
 # Include the following so that this Makefile is happy when the parent
 # tries to use them.
index c03639f5766f5956910995da652dde01aab8fb09..81e4d9a44a6ad825f502075e7bb021c8ee7cda90 100644 (file)
@@ -99,7 +99,7 @@ rm -rf bind
 
 # Make and move to our directory for all things bind
 mkdir $binddir
-cp util/Makefile.bind bind/Makefile
+cp util/Makefile.bind.in bind/Makefile.in
 cd $binddir
 
 # Get the bind version file and move it to version.tmp
diff --git a/util/bindcus.sh b/util/bindcus.sh
deleted file mode 100644 (file)
index 6f0388a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: bindcus.sh,v 1.2 2009/10/28 04:12:30 sar Exp $
-
-# Configure and build the bind libraries for use by DHCP
-#
-# Usage: sh bindcus.sh
-#
-# Currently no arguments
-#
-
-
-topdir=`pwd`
-binddir=$topdir/bind
-cd bind
-
-. ./version.tmp
-version=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
-bindsrcdir=bind-$version
-
-# Extract the source from the tarball
-gunzip -c bind.tar.gz | tar xf - 
-
-# Run the script to build and install the export libraries
-sh $topdir/util/bindlib.sh $binddir $bindsrcdir
diff --git a/util/bindlib.sh b/util/bindlib.sh
deleted file mode 100644 (file)
index 23cafef..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# $Id: bindlib.sh,v 1.5 2009/11/19 23:49:57 sar Exp $
-
-# Configure, build and install the bind export libraries for use by DHCP
-#
-# Usage: sh bindlib.sh <bind directory> <bind source directory>
-# The intention is for this script to be called by other scrips
-# (bind.sh or bindcus.sh) rather than be called directly.
-#
-# <bind directory> = directory for bind stuff within DHCP, typically
-# <dhcp>/bind
-#
-# <bind source directory> = directory for the unpacked bind source code
-# typically <dhcp>/bind/bind-<version>
-#
-
-binddir="$1"
-bindsrcdir="$2"
-
-gmake=
-for x in gmake gnumake make; do
-       if $x --version 2>/dev/null | grep GNU > /dev/null; then
-               gmake=$x
-               break;
-       fi
-done
-if test -z "$gmake"; then
-       echo "unable to find gmake" 1>&2
-       exit 1;
-fi
-
-# Configure the export libraries
-# Currently disable the epoll and devpoll options as they don't interact
-# well with the DHCP code.
-cd $bindsrcdir
-./configure --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=$binddir/include --with-export-libdir=$binddir/lib > $binddir/configure.log
-
-# Build the export libraries
-cd lib/export
-MAKE=$gmake $gmake > $binddir/build.log
-
-# Install the libraries and includes
-MAKE=$gmake $gmake install > $binddir/install.log