summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2016-10-21 09:51:12 +0200
committerFrancis Dupont <fdupont@isc.org>2016-10-21 09:51:12 +0200
commit6077a4bba8481ae0914cdc7a7ccf0ac05fcdedfe (patch)
tree75b48348e1e0226394f4484d6e6091721d8f91a4
parent047719bc0e959be62793296e4dfda848a8144e1d (diff)
parent236c987c1af90bccece379ee0f85e8b9c2561c1f (diff)
downloadisc-dhcp-6077a4bba8481ae0914cdc7a7ccf0ac05fcdedfe.tar.gz
Merged rt29402c (footprint/libtool)
-rw-r--r--.gitignore6
-rw-r--r--Makefile.am8
-rw-r--r--Makefile.in19
-rw-r--r--README27
-rw-r--r--RELNOTES6
-rw-r--r--client/Makefile.am10
-rw-r--r--client/Makefile.in19
-rw-r--r--client/tests/Makefile.am14
-rw-r--r--client/tests/Makefile.in24
-rw-r--r--common/.gitignore1
-rw-r--r--common/Makefile.am10
-rw-r--r--common/Makefile.am.in17
-rw-r--r--common/Makefile.in138
-rw-r--r--common/comapi.c1
-rw-r--r--common/parse.c3
-rw-r--r--common/tests/Makefile.am40
-rw-r--r--common/tests/Makefile.in77
-rwxr-xr-xconfig+lt22
-rwxr-xr-xconfigure106
-rw-r--r--configure.ac95
-rw-r--r--configure.ac+lt1057
-rw-r--r--configure.ac-base1093
-rw-r--r--configure.ac-lt1051
-rw-r--r--dhcpctl/.gitignore1
-rw-r--r--dhcpctl/Makefile.am21
-rw-r--r--dhcpctl/Makefile.am.in26
-rw-r--r--dhcpctl/Makefile.in40
-rw-r--r--dhcpctl/cltest.c30
-rw-r--r--includes/.gitignore1
-rw-r--r--includes/Makefile.in5
-rw-r--r--includes/dhcpd.h8
-rw-r--r--m4/.gitignore1
-rw-r--r--minires/OBSOLETE1
-rw-r--r--omapip/.gitignore1
-rw-r--r--omapip/Makefile.am19
-rw-r--r--omapip/Makefile.am.in22
-rw-r--r--omapip/Makefile.in32
-rw-r--r--relay/Makefile.am10
-rw-r--r--relay/Makefile.in19
-rw-r--r--server/Makefile.am12
-rw-r--r--server/Makefile.in24
-rw-r--r--server/class.c7
-rw-r--r--server/dhcpd.c3
-rw-r--r--server/tests/Makefile.am13
-rw-r--r--server/tests/Makefile.in17
-rw-r--r--tests/Makefile.am.in33
-rw-r--r--tests/Makefile.in13
-rw-r--r--util/Makefile.bind.in15
-rw-r--r--util/lt.pl133
-rw-r--r--util/regen-conf.sh20
50 files changed, 4096 insertions, 275 deletions
diff --git a/.gitignore b/.gitignore
index 80d7da00..6fec730c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*.lo
*.o
bind
doc/html
@@ -17,8 +18,10 @@ config.status
dhcpctl/cltest
dhcpctl/omshell
doc/devel/doxyfile
-dst/libdst.a
includes/stamp-h1
+.libs
+libtool
+ltmain.sh
omapip/svtest
relay/dhcrelay
server/dhcpd
@@ -29,4 +32,5 @@ server/tests/leaseq_unittests
server/tests/load_bal_unittests
server/tests/test-suite.log
tests/libt_api.a
+tests/libt_api.la
tests/unittest.sh
diff --git a/Makefile.am b/Makefile.am
index caea8833..f66f456c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,9 +4,14 @@
Makefile:
#
+# for libtool
+#
+ACLOCAL_AMFLAGS = -I m4
+
+#
# We have a lot of files that we want shipped with the distribution.
#
-EXTRA_DIST = RELNOTES LICENSE \
+EXTRA_DIST = RELNOTES LICENSE configure.ac+lt config+lt \
contrib/3.0b1-lease-convert contrib/dhclient-tz-exithook.sh \
contrib/dhcp.spec contrib/sethostname.sh contrib/solaris.init \
contrib/ms2isc/Registry.pm contrib/ms2isc/ms2isc.pl \
@@ -41,6 +46,7 @@ nobase_include_HEADERS = dhcpctl/dhcpctl.h
DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_CONFIGURE_FLAGS += @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_CONFIGURE_FLAGS += @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
distcheck-hook:
if HAVE_BINDDIR
diff --git a/Makefile.in b/Makefile.in
index 5166446c..8735e660 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -233,6 +233,7 @@ distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -251,6 +252,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -261,8 +263,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -292,6 +296,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -352,11 +357,16 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
#
+# for libtool
+#
+ACLOCAL_AMFLAGS = -I m4
+
+#
# We have a lot of files that we want shipped with the distribution.
#
-EXTRA_DIST = RELNOTES LICENSE contrib/3.0b1-lease-convert \
- contrib/dhclient-tz-exithook.sh contrib/dhcp.spec \
- contrib/sethostname.sh contrib/solaris.init \
+EXTRA_DIST = RELNOTES LICENSE configure.ac+lt config+lt \
+ contrib/3.0b1-lease-convert contrib/dhclient-tz-exithook.sh \
+ contrib/dhcp.spec contrib/sethostname.sh contrib/solaris.init \
contrib/ms2isc/Registry.pm contrib/ms2isc/ms2isc.pl \
contrib/ms2isc/readme.txt contrib/ldap/dhcpd-conf-to-ldap \
contrib/ldap/dhcp.schema contrib/ldap/README.ldap \
@@ -383,7 +393,8 @@ nobase_include_HEADERS = dhcpctl/dhcpctl.h
# distcheck tuning
#
DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_ATF_CONFIGURE_FLAG@ \
- @DISTCHECK_LIBBIND_CONFIGURE_FLAG@ $(am__empty)
+ @DISTCHECK_LIBBIND_CONFIGURE_FLAG@ \
+ @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@ $(am__empty)
all: all-recursive
.SUFFIXES:
diff --git a/README b/README
index 75846327..08945625 100644
--- a/README
+++ b/README
@@ -163,6 +163,33 @@ You can get a list of these by typing:
./configure --help
+If you want to use dynamic shared libraries automake, autoconf
+(aka GNU autotools) and libtool must be available. The DHCP
+distribution provides 3 configure.ac* files: the -lt version
+has no libtool support and was copied to the configure.ac
+standard file in the distribution. To enable libtool support
+you should perform these steps:
+
+ cp configure.ac+lt configure.ac
+ autoreconf -i
+
+after you can use the regenerated configure as usual
+(with libtool support (--enable-libtool) on by default):
+
+ ./configure
+
+For compatibility (and people who don't read this documentation)
+the --enable-libtool configuration file is supported even by
+the distributed configure (and off by default). The previous
+steps are performed and the regenerated configure called with
+almost the same parameters (this "almost" makes the use of
+this feature not recommended).
+
+Note you can't go back from with libtool support to without libtool
+support by restoring configure.ac and rerun autoreconf. If you
+want or need to restore the without libtool support state the
+required way is to simply restore the whole distribution.
+
DYNAMIC DNS UPDATES
A fully-featured implementation of dynamic DNS updates is included in
diff --git a/RELNOTES b/RELNOTES
index c387dfdd..1e3b124e 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -134,6 +134,12 @@ by Eric Young (eay@cryptsoft.com).
arguments.
[ISC-Bugs #39318]
+- Added support of dynamic shared libraries with libtool. A new
+ --enable-libtool configuration parameter is available but
+ should not be used directly: *please* read the build configuration
+ section in the README file for the recommended procedure.
+ [ISC-Bugs #29402]
+
Changes since 4.3.0 (bug fixes)
- Tidy up several small tickets.
diff --git a/client/Makefile.am b/client/Makefile.am
index 4730536f..b6a45c64 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -13,10 +13,10 @@ dhclient_SOURCES = clparse.c dhclient.c dhc6.c \
scripts/bsdos scripts/freebsd scripts/linux scripts/macos \
scripts/netbsd scripts/nextstep scripts/openbsd \
scripts/solaris scripts/openwrt
-dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+dhclient_LDADD = ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
+ @BINDLIBIRSDIR@/libirs.@A@ \
+ @BINDLIBDNSDIR@/libdns.@A@ \
+ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+ @BINDLIBISCDIR@/libisc.@A@
man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
EXTRA_DIST = $(man_MANS)
diff --git a/client/Makefile.in b/client/Makefile.in
index c2ac8448..a2510ea1 100644
--- a/client/Makefile.in
+++ b/client/Makefile.in
@@ -107,9 +107,7 @@ PROGRAMS = $(sbin_PROGRAMS)
am_dhclient_OBJECTS = clparse.$(OBJEXT) dhclient.$(OBJEXT) \
dhc6.$(OBJEXT)
dhclient_OBJECTS = $(am_dhclient_OBJECTS)
-dhclient_DEPENDENCIES = ../common/libdhcp.a ../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a @BINDLIBISCDIR@/libisc.a
+dhclient_DEPENDENCIES = ../common/libdhcp.@A@ ../omapip/libomapi.@A@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -240,6 +238,7 @@ am__relativize = \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -258,6 +257,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -268,8 +268,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -299,6 +301,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -371,11 +374,11 @@ dhclient_SOURCES = clparse.c dhclient.c dhc6.c \
scripts/netbsd scripts/nextstep scripts/openbsd \
scripts/solaris scripts/openwrt
-dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+dhclient_LDADD = ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
+ @BINDLIBIRSDIR@/libirs.@A@ \
+ @BINDLIBDNSDIR@/libdns.@A@ \
+ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+ @BINDLIBISCDIR@/libisc.@A@
man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
EXTRA_DIST = $(man_MANS)
diff --git a/client/tests/Makefile.am b/client/tests/Makefile.am
index 4fe26fb0..04561375 100644
--- a/client/tests/Makefile.am
+++ b/client/tests/Makefile.am
@@ -15,13 +15,13 @@ info:
DHCPSRC = ../clparse.c ../dhc6.c ../dhclient.c
-DHCPLIBS = $(top_builddir)/common/libdhcp.a \
- $(top_builddir)/omapip/libomapi.a \
- $(top_builddir)/dhcpctl/libdhcpctl.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+DHCPLIBS = $(top_builddir)/common/libdhcp.@A@ \
+ $(top_builddir)/omapip/libomapi.@A@ \
+ $(top_builddir)/dhcpctl/libdhcpctl.@A@ \
+ @BINDLIBIRSDIR@/libirs.@A@ \
+ @BINDLIBDNSDIR@/libdns.@A@ \
+ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+ @BINDLIBISCDIR@/libisc.@A@
ATF_TESTS =
if HAVE_ATF
diff --git a/client/tests/Makefile.in b/client/tests/Makefile.in
index fef932e0..f0a0525f 100644
--- a/client/tests/Makefile.in
+++ b/client/tests/Makefile.in
@@ -108,8 +108,11 @@ am__objects_1 = clparse.$(OBJEXT) dhc6.$(OBJEXT) dhclient.$(OBJEXT)
@HAVE_ATF_TRUE@ duid_unittest.$(OBJEXT)
duid_unittests_OBJECTS = $(am_duid_unittests_OBJECTS)
am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = $(top_builddir)/common/libdhcp.@A@ \
+ $(top_builddir)/omapip/libomapi.@A@ \
+ $(top_builddir)/dhcpctl/libdhcpctl.@A@
@HAVE_ATF_TRUE@duid_unittests_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-@HAVE_ATF_TRUE@ $(DHCPLIBS)
+@HAVE_ATF_TRUE@ $(am__DEPENDENCIES_2)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -212,6 +215,7 @@ am__relativize = \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -230,6 +234,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -240,8 +245,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -271,6 +278,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -335,13 +343,13 @@ AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes \
-DCLIENT_PATH='"."'
EXTRA_DIST = Atffile duid0_test.txt duid1_test.txt duid2_test.txt duid3_test.txt
DHCPSRC = ../clparse.c ../dhc6.c ../dhclient.c
-DHCPLIBS = $(top_builddir)/common/libdhcp.a \
- $(top_builddir)/omapip/libomapi.a \
- $(top_builddir)/dhcpctl/libdhcpctl.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+DHCPLIBS = $(top_builddir)/common/libdhcp.@A@ \
+ $(top_builddir)/omapip/libomapi.@A@ \
+ $(top_builddir)/dhcpctl/libdhcpctl.@A@ \
+ @BINDLIBIRSDIR@/libirs.@A@ \
+ @BINDLIBDNSDIR@/libdns.@A@ \
+ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+ @BINDLIBISCDIR@/libisc.@A@
ATF_TESTS = $(am__append_1)
@HAVE_ATF_TRUE@duid_unittests_SOURCES = $(DHCPSRC) duid_unittest.c
diff --git a/common/.gitignore b/common/.gitignore
index 06479b35..b7d2b3df 100644
--- a/common/.gitignore
+++ b/common/.gitignore
@@ -1 +1,2 @@
libdhcp.a
+libdhcp.la
diff --git a/common/Makefile.am b/common/Makefile.am
index 113aee84..91dd2358 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -1,12 +1,12 @@
AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
AM_CFLAGS = $(LDAP_CFLAGS)
-noinst_LIBRARIES = libdhcp.a
+lib_LIBRARIES = libdhcp.a
libdhcp_a_SOURCES = alloc.c bpf.c comapi.c conflex.c ctrace.c dhcp4o6.c \
- discover.c dispatch.c dlpi.c dns.c ethernet.c execute.c \
- fddi.c icmp.c inet.c lpf.c memory.c nit.c ns_name.c \
- options.c packet.c parse.c print.c raw.c resolv.c \
- socket.c tables.c tr.c tree.c upf.c
+ discover.c dispatch.c dlpi.c dns.c ethernet.c execute.c \
+ fddi.c icmp.c inet.c lpf.c memory.c nit.c ns_name.c \
+ options.c packet.c parse.c print.c raw.c resolv.c \
+ socket.c tables.c tr.c tree.c upf.c
man_MANS = dhcp-eval.5 dhcp-options.5
EXTRA_DIST = $(man_MANS)
diff --git a/common/Makefile.am.in b/common/Makefile.am.in
new file mode 100644
index 00000000..266974ba
--- /dev/null
+++ b/common/Makefile.am.in
@@ -0,0 +1,17 @@
+AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@Q@localstatedir@Q@"'
+AM_CFLAGS = $(LDAP_CFLAGS)
+
+lib_@DHLIBS@ = libdhcp.@A@
+libdhcp_@A@_SOURCES = alloc.c bpf.c comapi.c conflex.c ctrace.c dhcp4o6.c \
+ discover.c dispatch.c dlpi.c dns.c ethernet.c execute.c \
+ fddi.c icmp.c inet.c lpf.c memory.c nit.c ns_name.c \
+ options.c packet.c parse.c print.c raw.c resolv.c \
+ socket.c tables.c tr.c tree.c upf.c
+man_MANS = dhcp-eval.5 dhcp-options.5
+EXTRA_DIST = $(man_MANS)
+
+# We want to build this directory first, before descending into tests subdir.
+# The reason is that ideally the tests should link existing objects from this
+# directory. That eliminates any discrepancies between tested code and
+# production code. Sadly, we are not there yet.
+SUBDIRS = . tests
diff --git a/common/Makefile.in b/common/Makefile.in
index e4d09ef4..b8eafe77 100644
--- a/common/Makefile.in
+++ b/common/Makefile.in
@@ -96,9 +96,37 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/includes/config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = Makefile.am
CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man5dir)"
+LIBRARIES = $(lib_LIBRARIES)
ARFLAGS = cru
AM_V_AR = $(am__v_AR_@AM_V@)
am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
@@ -160,35 +188,7 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
man5dir = $(mandir)/man5
-am__installdirs = "$(DESTDIR)$(man5dir)"
NROFF = nroff
MANS = $(man_MANS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
@@ -219,7 +219,8 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+am__DIST_COMMON = $(srcdir)/Makefile.am.in $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -246,6 +247,7 @@ am__relativize = \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -264,6 +266,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -274,8 +277,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -305,6 +310,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -365,12 +371,12 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
AM_CFLAGS = $(LDAP_CFLAGS)
-noinst_LIBRARIES = libdhcp.a
+lib_LIBRARIES = libdhcp.a
libdhcp_a_SOURCES = alloc.c bpf.c comapi.c conflex.c ctrace.c dhcp4o6.c \
- discover.c dispatch.c dlpi.c dns.c ethernet.c execute.c \
- fddi.c icmp.c inet.c lpf.c memory.c nit.c ns_name.c \
- options.c packet.c parse.c print.c raw.c resolv.c \
- socket.c tables.c tr.c tree.c upf.c
+ discover.c dispatch.c dlpi.c dns.c ethernet.c execute.c \
+ fddi.c icmp.c inet.c lpf.c memory.c nit.c ns_name.c \
+ options.c packet.c parse.c print.c raw.c resolv.c \
+ socket.c tables.c tr.c tree.c upf.c
man_MANS = dhcp-eval.5 dhcp-options.5
EXTRA_DIST = $(man_MANS)
@@ -413,9 +419,39 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+Makefile.am: $(top_builddir)/config.status $(srcdir)/Makefile.am.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-libLIBRARIES: $(lib_LIBRARIES)
+ @$(NORMAL_INSTALL)
+ @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+ echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
+ @$(POST_INSTALL)
+ @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ if test -f $$p; then \
+ $(am__strip_dir) \
+ echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
+ ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
+ else :; fi; \
+ done
+
+uninstall-libLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir)
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+clean-libLIBRARIES:
+ -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
libdhcp.a: $(libdhcp_a_OBJECTS) $(libdhcp_a_DEPENDENCIES) $(EXTRA_libdhcp_a_DEPENDENCIES)
$(AM_V_at)-rm -f libdhcp.a
@@ -675,7 +711,7 @@ check: check-recursive
all-am: Makefile $(LIBRARIES) $(MANS)
installdirs: installdirs-recursive
installdirs-am:
- for dir in "$(DESTDIR)$(man5dir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man5dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
@@ -710,7 +746,7 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
-clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
+clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
@@ -736,7 +772,7 @@ install-dvi: install-dvi-recursive
install-dvi-am:
-install-exec-am:
+install-exec-am: install-libLIBRARIES
install-html: install-html-recursive
@@ -775,26 +811,26 @@ ps: ps-recursive
ps-am:
-uninstall-am: uninstall-man
+uninstall-am: uninstall-libLIBRARIES uninstall-man
uninstall-man: uninstall-man5
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
- check-am clean clean-generic clean-noinstLIBRARIES \
- cscopelist-am ctags ctags-am distclean distclean-compile \
- distclean-generic distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-man5 install-pdf \
+ check-am clean clean-generic clean-libLIBRARIES cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libLIBRARIES install-man install-man5 install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am uninstall-man \
- uninstall-man5
+ tags tags-am uninstall uninstall-am uninstall-libLIBRARIES \
+ uninstall-man uninstall-man5
.PRECIOUS: Makefile
diff --git a/common/comapi.c b/common/comapi.c
index 230ea483..fc95e97a 100644
--- a/common/comapi.c
+++ b/common/comapi.c
@@ -42,7 +42,6 @@ OMAPI_OBJECT_ALLOC (shared_network, struct shared_network,
OMAPI_OBJECT_ALLOC (group_object, struct group_object, dhcp_type_group)
OMAPI_OBJECT_ALLOC (dhcp_control, dhcp_control_object_t, dhcp_type_control)
-omapi_object_type_t *dhcp_type_interface;
omapi_object_type_t *dhcp_type_group;
omapi_object_type_t *dhcp_type_shared_network;
omapi_object_type_t *dhcp_type_subnet;
diff --git a/common/parse.c b/common/parse.c
index b8ccf9df..6f16c33c 100644
--- a/common/parse.c
+++ b/common/parse.c
@@ -29,6 +29,9 @@
#include "dhcpd.h"
#include <syslog.h>
+struct collection default_collection = { NULL, "default", NULL };
+struct collection *collections = &default_collection;
+
/* Enumerations can be specified in option formats, and are used for
parsing, so we define the routines that manage them here. */
diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am
index 3a49f69a..84e21591 100644
--- a/common/tests/Makefile.am
+++ b/common/tests/Makefile.am
@@ -12,35 +12,35 @@ ATF_TESTS += alloc_unittest dns_unittest misc_unittest ns_name_unittest
alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c
alloc_unittest_LDADD = $(ATF_LDFLAGS)
-alloc_unittest_LDADD += ../libdhcp.a ../../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+alloc_unittest_LDADD += ../libdhcp.@A@ ../../omapip/libomapi.@A@ \
+ @BINDLIBIRSDIR@/libirs.@A@ \
+ @BINDLIBDNSDIR@/libdns.@A@ \
+ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+ @BINDLIBISCDIR@/libisc.@A@
dns_unittest_SOURCES = dns_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
dns_unittest_LDADD = $(ATF_LDFLAGS)
-dns_unittest_LDADD += ../libdhcp.a ../../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+dns_unittest_LDADD += ../libdhcp.@A@ ../../omapip/libomapi.@A@ \
+ @BINDLIBIRSDIR@/libirs.@A@ \
+ @BINDLIBDNSDIR@/libdns.@A@ \
+ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+ @BINDLIBISCDIR@/libisc.@A@
misc_unittest_SOURCES = misc_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
misc_unittest_LDADD = $(ATF_LDFLAGS)
-misc_unittest_LDADD += ../libdhcp.a ../../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+misc_unittest_LDADD += ../libdhcp.@A@ ../../omapip/libomapi.@A@ \
+ @BINDLIBIRSDIR@/libirs.@A@ \
+ @BINDLIBDNSDIR@/libdns.@A@ \
+ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+ @BINDLIBISCDIR@/libisc.@A@
ns_name_unittest_SOURCES = ns_name_test.c $(top_srcdir)/tests/t_api_dhcp.c
ns_name_unittest_LDADD = $(ATF_LDFLAGS)
-ns_name_unittest_LDADD += ../libdhcp.a ../../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+ns_name_unittest_LDADD += ../libdhcp.@A@ ../../omapip/libomapi.@A@ \
+ @BINDLIBIRSDIR@/libirs.@A@ \
+ @BINDLIBDNSDIR@/libdns.@A@ \
+ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+ @BINDLIBISCDIR@/libisc.@A@
check: $(ATF_TESTS)
@if test $(top_srcdir) != ${top_builddir}; then \
diff --git a/common/tests/Makefile.in b/common/tests/Makefile.in
index 18e71be1..3818764d 100644
--- a/common/tests/Makefile.in
+++ b/common/tests/Makefile.in
@@ -110,44 +110,28 @@ am__alloc_unittest_SOURCES_DIST = test_alloc.c \
alloc_unittest_OBJECTS = $(am_alloc_unittest_OBJECTS)
am__DEPENDENCIES_1 =
@HAVE_ATF_TRUE@alloc_unittest_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-@HAVE_ATF_TRUE@ ../libdhcp.a ../../omapip/libomapi.a \
-@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.a \
-@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.a
+@HAVE_ATF_TRUE@ ../libdhcp.@A@ ../../omapip/libomapi.@A@
am__dns_unittest_SOURCES_DIST = dns_unittest.c \
$(top_srcdir)/tests/t_api_dhcp.c
@HAVE_ATF_TRUE@am_dns_unittest_OBJECTS = dns_unittest.$(OBJEXT) \
@HAVE_ATF_TRUE@ t_api_dhcp.$(OBJEXT)
dns_unittest_OBJECTS = $(am_dns_unittest_OBJECTS)
@HAVE_ATF_TRUE@dns_unittest_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-@HAVE_ATF_TRUE@ ../libdhcp.a ../../omapip/libomapi.a \
-@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.a \
-@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.a
+@HAVE_ATF_TRUE@ ../libdhcp.@A@ ../../omapip/libomapi.@A@
am__misc_unittest_SOURCES_DIST = misc_unittest.c \
$(top_srcdir)/tests/t_api_dhcp.c
@HAVE_ATF_TRUE@am_misc_unittest_OBJECTS = misc_unittest.$(OBJEXT) \
@HAVE_ATF_TRUE@ t_api_dhcp.$(OBJEXT)
misc_unittest_OBJECTS = $(am_misc_unittest_OBJECTS)
@HAVE_ATF_TRUE@misc_unittest_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-@HAVE_ATF_TRUE@ ../libdhcp.a ../../omapip/libomapi.a \
-@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.a \
-@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.a
+@HAVE_ATF_TRUE@ ../libdhcp.@A@ ../../omapip/libomapi.@A@
am__ns_name_unittest_SOURCES_DIST = ns_name_test.c \
$(top_srcdir)/tests/t_api_dhcp.c
@HAVE_ATF_TRUE@am_ns_name_unittest_OBJECTS = ns_name_test.$(OBJEXT) \
@HAVE_ATF_TRUE@ t_api_dhcp.$(OBJEXT)
ns_name_unittest_OBJECTS = $(am_ns_name_unittest_OBJECTS)
@HAVE_ATF_TRUE@ns_name_unittest_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-@HAVE_ATF_TRUE@ ../libdhcp.a ../../omapip/libomapi.a \
-@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.a \
-@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.a
+@HAVE_ATF_TRUE@ ../libdhcp.@A@ ../../omapip/libomapi.@A@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -254,6 +238,7 @@ am__relativize = \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -272,6 +257,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -282,8 +268,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -313,6 +301,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -376,33 +365,33 @@ AM_CPPFLAGS = $(ATF_CFLAGS) -I$(top_srcdir)/includes
EXTRA_DIST = Atffile
ATF_TESTS = $(am__append_1)
@HAVE_ATF_TRUE@alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c
-@HAVE_ATF_TRUE@alloc_unittest_LDADD = $(ATF_LDFLAGS) ../libdhcp.a \
-@HAVE_ATF_TRUE@ ../../omapip/libomapi.a \
-@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.a \
-@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.a
+@HAVE_ATF_TRUE@alloc_unittest_LDADD = $(ATF_LDFLAGS) ../libdhcp.@A@ \
+@HAVE_ATF_TRUE@ ../../omapip/libomapi.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.@A@
@HAVE_ATF_TRUE@dns_unittest_SOURCES = dns_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
-@HAVE_ATF_TRUE@dns_unittest_LDADD = $(ATF_LDFLAGS) ../libdhcp.a \
-@HAVE_ATF_TRUE@ ../../omapip/libomapi.a \
-@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.a \
-@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.a
+@HAVE_ATF_TRUE@dns_unittest_LDADD = $(ATF_LDFLAGS) ../libdhcp.@A@ \
+@HAVE_ATF_TRUE@ ../../omapip/libomapi.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.@A@
@HAVE_ATF_TRUE@misc_unittest_SOURCES = misc_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
-@HAVE_ATF_TRUE@misc_unittest_LDADD = $(ATF_LDFLAGS) ../libdhcp.a \
-@HAVE_ATF_TRUE@ ../../omapip/libomapi.a \
-@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.a \
-@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.a
+@HAVE_ATF_TRUE@misc_unittest_LDADD = $(ATF_LDFLAGS) ../libdhcp.@A@ \
+@HAVE_ATF_TRUE@ ../../omapip/libomapi.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.@A@
@HAVE_ATF_TRUE@ns_name_unittest_SOURCES = ns_name_test.c $(top_srcdir)/tests/t_api_dhcp.c
-@HAVE_ATF_TRUE@ns_name_unittest_LDADD = $(ATF_LDFLAGS) ../libdhcp.a \
-@HAVE_ATF_TRUE@ ../../omapip/libomapi.a \
-@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.a \
-@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.a \
-@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.a
+@HAVE_ATF_TRUE@ns_name_unittest_LDADD = $(ATF_LDFLAGS) ../libdhcp.@A@ \
+@HAVE_ATF_TRUE@ ../../omapip/libomapi.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBIRSDIR@/libirs.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBDNSDIR@/libdns.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+@HAVE_ATF_TRUE@ @BINDLIBISCDIR@/libisc.@A@
all: all-recursive
.SUFFIXES:
diff --git a/config+lt b/config+lt
new file mode 100755
index 00000000..86af4bbf
--- /dev/null
+++ b/config+lt
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Copyright (C) 2016 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.
+
+# called by the legacy configure when libtool is enabled
+
+cp configure.ac+lt configure.ac
+autoreconf -i
+echo Reconfiguring with "$@"
+./configure "$@"
diff --git a/configure b/configure
index 6d8c1a9e..eff92d16 100755
--- a/configure
+++ b/configure
@@ -629,6 +629,11 @@ LDAP_CFLAGS
LDAP_LIBS
INSTALL_BIND_FALSE
INSTALL_BIND_TRUE
+Q
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG
+BINDLT
+A
+DHLIBS
HAVE_BINDDIR_FALSE
HAVE_BINDDIR_TRUE
DISTCHECK_LIBBIND_CONFIGURE_FLAG
@@ -787,6 +792,7 @@ enable_epoll
enable_devpoll
with_bind_extra_config
with_libbind
+enable_libtool
enable_bind_install
with_ldap
with_ldapcrypto
@@ -1454,6 +1460,8 @@ Optional Features:
--enable-kqueue use BSD kqueue (default is no)
--enable-epoll use Linux epoll (default is no)
--enable-devpoll use /dev/poll (default is no)
+ --enable-libtool use GNU libtool for dynamic shared libraries
+ (default is no).
--enable-bind-install install bind includes and libraries (default is no).
Optional Packages:
@@ -2721,6 +2729,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
# we specify "foreign" to avoid having to have the GNU mandated files,
# like AUTHORS, COPYING, and such
am__api_version='1.15'
@@ -7009,10 +7018,15 @@ no)
if test ! -d "$use_libbind"; then
as_fn_error $? "Cannot find bind directory at $use_libbind" "$LINENO" 5
fi
- if test ! -d "$use_libbind/include"; then
+ if test ! -d "$use_libbind/include" -o \
+ ! -f "$use_libbind/include/isc/buffer.h"
+ then
as_fn_error $? "Cannot find bind includes at $use_libbind/include" "$LINENO" 5
fi
- if test ! -d "$use_libbind/lib"; then
+ if test ! -d "$use_libbind/lib" -o \
+ \( ! -f "$use_libbind/lib/libisc.a" -a \
+ ! -f "$use_libbind/lib/libisc.la" \)
+ then
as_fn_error $? "Cannot find bind libraries at $use_libbind/lib" "$LINENO" 5
fi
BINDDIR="$use_libbind"
@@ -7040,16 +7054,89 @@ else
fi
+#
+# GNU libtool support
+#
+case "$build_os" in
+ sunos*)
+ # Just set the maximum command line length for sunos
+ # as it otherwise takes a exceptionally long time to
+ # work it out. Required for libtool.
+
+ lt_cv_sys_max_cmd_len=4096
+ ;;
+esac
+
+want_libtool="no"
+
+BINDLT=
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG=
+# Check whether --enable-libtool was given.
+if test "${enable_libtool+set}" = set; then :
+ enableval=$enable_libtool; want_libtool="$enableval"
+fi
+
+
+if test "$use_libbind" != "no"; then
+ if test "$want_libtool" = "yes" -a \
+ ! -f "$use_libbind/lib/libisc.la"
+ then
+ as_fn_error $? "Cannot find dynamic libraries at $use_libbind/lib" "$LINENO" 5
+ fi
+ if test "$want_libtool" = "no" -a \
+ ! -f "$use_libbind/lib/libisc.a"
+ then
+ as_fn_error $? "Cannot find static libraries at $use_libbind/lib" "$LINENO" 5
+ fi
+fi
+
+
+if test "$want_libtool" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: legacy configure is used but libtool is enabled. Trying to recover..." >&5
+$as_echo "$as_me: WARNING: legacy configure is used but libtool is enabled. Trying to recover..." >&2;}
+ # expand $ac_configure_args
+ eval "set my_configure_args $ac_configure_args"
+ shift
+ cd $srcdir; exec ./config+lt "$@"
+ as_fn_error $? "Recovering failed" "$LINENO" 5
+fi
+
+DHLIBS=LIBRARIES
+A=a
+
+
+
+
+
+
+# quoting in Makefile.am.in
+Q=@
+
+
+# install bind includes and libraries
+
+want_install_bind="no"
+if test "$want_libtool" = "yes"; then
+ want_install_bind="yes"
+fi
+if test "$use_libbind" != "no"; then
+ want_install_bind="no"
+fi
# Check whether --enable-bind_install was given.
if test "${enable_bind_install+set}" = set; then :
- enableval=$enable_bind_install;
+ enableval=$enable_bind_install; want_install_bind="$enableval"
fi
-if test "$enable_bind_install" = "yes" -a "$use_libbind" != "no"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-bind-install does nothing when --with-libbind is set" >&5
+if test "$want_install_bind" = "yes"; then
+ if test "$use_libbind" != "no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-bind-install does nothing when --with-libbind is set" >&5
$as_echo "$as_me: WARNING: --enable-bind-install does nothing when --with-libbind is set" >&2;}
+ fi
+elif test "$want_libtool" = "yes" -a "$use_libbind" = "no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: embedded dynamic bind libraries must be installed" >&5
+$as_echo "$as_me: WARNING: embedded dynamic bind libraries must be installed" >&2;}
fi
- if test "$enable_bind_install" = "yes"; then
+ if test "$want_install_bind" = "yes"; then
INSTALL_BIND_TRUE=
INSTALL_BIND_FALSE='#'
else
@@ -7439,7 +7526,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 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 client/Makefile client/tests/Makefile common/Makefile.am common/Makefile common/tests/Makefile dhcpctl/Makefile.am dhcpctl/Makefile includes/Makefile omapip/Makefile.am omapip/Makefile relay/Makefile server/Makefile tests/Makefile.am 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
@@ -8193,13 +8280,17 @@ do
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"client/Makefile") CONFIG_FILES="$CONFIG_FILES client/Makefile" ;;
"client/tests/Makefile") CONFIG_FILES="$CONFIG_FILES client/tests/Makefile" ;;
+ "common/Makefile.am") CONFIG_FILES="$CONFIG_FILES common/Makefile.am" ;;
"common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;;
"common/tests/Makefile") CONFIG_FILES="$CONFIG_FILES common/tests/Makefile" ;;
+ "dhcpctl/Makefile.am") CONFIG_FILES="$CONFIG_FILES dhcpctl/Makefile.am" ;;
"dhcpctl/Makefile") CONFIG_FILES="$CONFIG_FILES dhcpctl/Makefile" ;;
"includes/Makefile") CONFIG_FILES="$CONFIG_FILES includes/Makefile" ;;
+ "omapip/Makefile.am") CONFIG_FILES="$CONFIG_FILES omapip/Makefile.am" ;;
"omapip/Makefile") CONFIG_FILES="$CONFIG_FILES omapip/Makefile" ;;
"relay/Makefile") CONFIG_FILES="$CONFIG_FILES relay/Makefile" ;;
"server/Makefile") CONFIG_FILES="$CONFIG_FILES server/Makefile" ;;
+ "tests/Makefile.am") CONFIG_FILES="$CONFIG_FILES tests/Makefile.am" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"tests/unittest.sh") CONFIG_FILES="$CONFIG_FILES tests/unittest.sh" ;;
"server/tests/Makefile") CONFIG_FILES="$CONFIG_FILES server/tests/Makefile" ;;
@@ -8892,6 +8983,7 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
+
if test "$enable_dhcpv4o6" = "yes"; then
DHCP_VERSIONS="DHCPv4, DHCPv6 and DHCPv4-over-DHCPv6"
elif test "$enable_dhcpv6" != "no"; then
diff --git a/configure.ac b/configure.ac
index 2a1cc150..b4d5bc3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,6 @@
AC_INIT([DHCP],[4.4.0-dev],[dhcp-users@isc.org])
+
# we specify "foreign" to avoid having to have the GNU mandated files,
# like AUTHORS, COPYING, and such
AM_INIT_AUTOMAKE([foreign])
@@ -784,10 +785,15 @@ no)
if test ! -d "$use_libbind"; then
AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
fi
- if test ! -d "$use_libbind/include"; then
+ if test ! -d "$use_libbind/include" -o \
+ ! -f "$use_libbind/include/isc/buffer.h"
+ then
AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
fi
- if test ! -d "$use_libbind/lib"; then
+ if test ! -d "$use_libbind/lib" -o \
+ \( ! -f "$use_libbind/lib/libisc.a" -a \
+ ! -f "$use_libbind/lib/libisc.la" \)
+ then
AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
fi
BINDDIR="$use_libbind"
@@ -808,12 +814,84 @@ AC_SUBST(BINDLIBISCDIR)
AC_SUBST(DISTCHECK_LIBBIND_CONFIGURE_FLAG)
AM_CONDITIONAL(HAVE_BINDDIR, test "$use_libbind" = "no")
+#
+# GNU libtool support
+#
+case "$build_os" in
+ sunos*)
+ # Just set the maximum command line length for sunos
+ # as it otherwise takes a exceptionally long time to
+ # work it out. Required for libtool.
+
+ lt_cv_sys_max_cmd_len=4096
+ ;;
+esac
+
+want_libtool="no"
+
+BINDLT=
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG=
+AC_ARG_ENABLE(libtool,
+ AS_HELP_STRING([--enable-libtool],
+[use GNU libtool for dynamic shared libraries (default is no).]),
+ want_libtool="$enableval")
+
+if test "$use_libbind" != "no"; then
+ if test "$want_libtool" = "yes" -a \
+ ! -f "$use_libbind/lib/libisc.la"
+ then
+ AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
+ fi
+ if test "$want_libtool" = "no" -a \
+ ! -f "$use_libbind/lib/libisc.a"
+ then
+ AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
+ fi
+fi
+
+
+if test "$want_libtool" = "yes"; then
+ AC_MSG_WARN([legacy configure is used but libtool is enabled. Trying to recover...])
+ # expand $ac_configure_args
+ eval "set my_configure_args $ac_configure_args"
+ shift
+ cd $srcdir; exec ./config+lt "$@"
+ AC_MSG_ERROR([Recovering failed])
+fi
+
+DHLIBS=LIBRARIES
+A=a
+
+AC_SUBST(DHLIBS)
+AC_SUBST(A)
+AC_SUBST(BINDLT)
+AC_SUBST(DISTCHECK_LIBTOOL_CONFIGURE_FLAG)
+
+# quoting in Makefile.am.in
+Q=@
+AC_SUBST(Q)
+
+# install bind includes and libraries
+
+want_install_bind="no"
+if test "$want_libtool" = "yes"; then
+ want_install_bind="yes"
+fi
+if test "$use_libbind" != "no"; then
+ want_install_bind="no"
+fi
AC_ARG_ENABLE(bind_install,
- AS_HELP_STRING([--enable-bind-install],[install bind includes and libraries (default is no).]))
-if test "$enable_bind_install" = "yes" -a "$use_libbind" != "no"; then
- AC_MSG_WARN([--enable-bind-install does nothing when --with-libbind is set])
+ AS_HELP_STRING([--enable-bind-install],
+[install bind includes and libraries (default is no).]),
+ want_install_bind="$enableval")
+if test "$want_install_bind" = "yes"; then
+ if test "$use_libbind" != "no"; then
+ AC_MSG_WARN([--enable-bind-install does nothing when --with-libbind is set])
+ fi
+elif test "$want_libtool" = "yes" -a "$use_libbind" = "no"; then
+ AC_MSG_WARN([embedded dynamic bind libraries must be installed])
fi
-AM_CONDITIONAL(INSTALL_BIND, test "$enable_bind_install" = "yes")
+AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes")
# OpenLDAP support.
AC_ARG_WITH(ldap,
@@ -910,13 +988,17 @@ AC_CONFIG_FILES([
Makefile
client/Makefile
client/tests/Makefile
+ common/Makefile.am
common/Makefile
common/tests/Makefile
+ dhcpctl/Makefile.am
dhcpctl/Makefile
includes/Makefile
+ omapip/Makefile.am
omapip/Makefile
relay/Makefile
server/Makefile
+ tests/Makefile.am
tests/Makefile
tests/unittest.sh
server/tests/Makefile
@@ -924,6 +1006,7 @@ AC_CONFIG_FILES([
])
AC_OUTPUT
+
if test "$enable_dhcpv4o6" = "yes"; then
DHCP_VERSIONS="DHCPv4, DHCPv6 and DHCPv4-over-DHCPv6"
elif test "$enable_dhcpv6" != "no"; then
diff --git a/configure.ac+lt b/configure.ac+lt
new file mode 100644
index 00000000..b1edb6da
--- /dev/null
+++ b/configure.ac+lt
@@ -0,0 +1,1057 @@
+AC_INIT([DHCP],[4.4.0-dev],[dhcp-users@isc.org])
+
+# for libtool
+AC_CONFIG_MACRO_DIR([m4])
+
+# we specify "foreign" to avoid having to have the GNU mandated files,
+# like AUTHORS, COPYING, and such
+AM_INIT_AUTOMAKE([foreign])
+
+# we specify AM_MAINTAINER_MODE to avoid problems with rebuilding
+# the configure and makefiles. Without it users doing things that
+# change the timestamps on the code, like checking it into a cvs
+# tree, could trigger a rebuild of the infrastructure files which
+# might fail if they don't have the correct tools.
+AM_MAINTAINER_MODE
+
+AC_CANONICAL_HOST
+
+# We want to turn on warnings if we are using gcc and the user did
+# not specify CFLAGS. The autoconf check for the C compiler sets the
+# CFLAGS if gcc is used, so we will save it before we run that check.
+SAVE_CFLAGS="$CFLAGS"
+
+# Now find our C compiler.
+AC_PROG_CC
+
+# Suppress warnings about --datarootdir
+AC_DEFUN([AC_DATAROOTDIR_CHECKED])
+
+# If we have gcc, and AC_PROG_CC changed the flags, then we know the
+# user did not specify any flags. Add warnings in this case.
+if test "$GCC" = "yes"; then
+ if test "$CFLAGS" != "$SAVE_CFLAGS"; then
+ STD_CWARNINGS="$STD_CWARNINGS -Wall -Werror -fno-strict-aliasing"
+ fi
+fi
+
+# We can have some flags to pass to bind configure
+BINDCONFIG=
+if test "$cross_compiling" = "yes"; then
+ BINDCONFIG="--host=$host"
+fi
+# Pass CFLAGS and co. $ac_configure_args looks like "'arg1' 'arg2' ..."
+# and as there can be a space inside an argument some magic is required.
+# This sets $1 ... $N to my_configure_args, arg1 ... argN
+eval "set my_configure_args $ac_configure_args"
+# remove my_configure_args, i.e., the guard against empty $ac_configure_args
+shift
+# iterate on arguments and copying 'arg' when it begins by an upper case
+for a
+do
+ case $a in
+ [[A-Z]]*) BINDCONFIG="$BINDCONFIG '$a'" ;;
+ esac
+done
+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
+# Socket API were designed to be used but we have to live with it.
+# Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+AC_USE_SYSTEM_EXTENSIONS
+
+
+AC_PATH_PROG(AR, ar)
+AC_SUBST(AR)
+
+if test "X$AR" = "X"; then
+ AC_MSG_ERROR([
+ar program not found. Please fix your PATH to include the directory in
+which ar resides, or set AR in the environment with the full path to ar.])
+fi
+
+AC_CONFIG_HEADERS([includes/config.h])
+
+# we sometimes need to know byte order for building packets
+AC_C_BIGENDIAN(AC_SUBST(byte_order, BIG_ENDIAN),
+ AC_SUBST(byte_order, LITTLE_ENDIAN))
+AC_DEFINE_UNQUOTED([DHCP_BYTE_ORDER], [$byte_order],
+ [Define to BIG_ENDIAN for MSB (Motorola or SPARC CPUs)
+ or LITTLE_ENDIAN for LSB (Intel CPUs).])
+
+# Optional compile-time DEBUGging.
+AC_ARG_ENABLE(debug,
+ AS_HELP_STRING([--enable-debug],[create a debug-only version of the software (default is no).]),
+ [case "${enableval}" in
+ yes) enable_debug=yes
+ AC_DEFINE([DEBUG], [1],
+ [Define to compile debug-only DHCP software.])
+ # Just override CFLAGS totally to remove optimization.
+ CFLAGS="-g";;
+ no) enable_debug=no ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
+ esac],[enable_debug=no])
+
+# XXX: there are actually quite a lot more DEBUG_ features we could enable,
+# but I don't want to pollute the --help space.
+#
+#/* #define DEBUG_TOKENS */
+#/* #define DEBUG_PACKET */
+#/* #define DEBUG_EXPRESSIONS */
+#/* #define DEBUG_FIND_LEASE */
+#/* #define DEBUG_EXPRESSION_PARSE */
+#/* #define DEBUG_CLASS_MATCHING */
+#/* #define DEBUG_MEMORY_LEAKAGE */
+#/* #define DEBUG_MALLOC_POOL */
+#/* #define DEBUG_LEASE_STATE_TRANSITIONS */
+#/* #define DEBUG_RC_HISTORY */
+#/* #define DEBUG_RC_HISTORY_EXHAUSTIVELY */
+#/* #define RC_HISTORY_MAX 10240 */
+#/* #define POINTER_DEBUG */
+#/* #define DEBUG_FAILOVER_MESSAGES */
+#/* #define DEBUG_FAILOVER_TIMING */
+#/* #define DEBUG_DUMP_ALL_LEASES */
+
+# Failover optional compile-time feature.
+AC_ARG_ENABLE(failover,
+ AS_HELP_STRING([--enable-failover],[enable support for failover (default is yes)]))
+# Failover is on by default, so define if it is not explicitly disabled.
+if test "$enable_failover" != "no"; then
+ enable_failover="yes"
+ AC_DEFINE([FAILOVER_PROTOCOL], [1],
+ [Define to include Failover Protocol support.])
+fi
+
+# execute() support.
+AC_ARG_ENABLE(execute,
+ AS_HELP_STRING([--enable-execute],[enable support for execute() in config (default is yes)]))
+# execute() is on by default, so define if it is not explicitly disabled.
+if test "$enable_execute" != "no" ; then
+ enable_execute="yes"
+ AC_DEFINE([ENABLE_EXECUTE], [1],
+ [Define to include execute() config language support.])
+fi
+
+# Server tracing support.
+AC_ARG_ENABLE(tracing,
+ AS_HELP_STRING([--enable-tracing],[enable support for server activity tracing (default is yes)]))
+# tracing is on by default, so define if it is not explicitly disabled.
+if test "$enable_tracing" != "no" ; then
+ AC_DEFINE([TRACING], [1],
+ [Define to include server activity tracing support.])
+fi
+
+# Delayed-ack feature support (experimental).
+AC_ARG_ENABLE(delayed_ack,
+ AS_HELP_STRING([--enable-delayed-ack],[queues multiple DHCPACK replies (default is no)]))
+if test "$enable_delayed_ack" = "yes"; then
+ AC_DEFINE([DELAYED_ACK], [1],
+ [Define to queue multiple DHCPACK replies per fsync.])
+else
+ enable_delayed_ack="no"
+fi
+
+# DHCPv6 optional compile-time feature.
+AC_ARG_ENABLE(dhcpv6,
+ AS_HELP_STRING([--enable-dhcpv6],[enable support for DHCPv6 (default is yes)]))
+# DHCPv6 is on by default, so define if it is not explicitly disabled.
+if test "$enable_dhcpv6" != "no"; then
+ enable_dhcpv6="yes"
+ AC_DEFINE([DHCPv6], [1],
+ [Define to 1 to include DHCPv6 support.])
+fi
+
+# DHCPv4o6 optional compile-time feature.
+AC_ARG_ENABLE(dhcpv4o6,
+ AS_HELP_STRING([--enable-dhcpv4o6],[enable support for DHCPv4-over-DHCPv6 (default is no)]))
+# DHCPv4o6 is off by default, so define if it is explicitly enabled.
+if test "$enable_dhcpv4o6" = "yes"; then
+ # DHCPv4o6 requires DHCPv6
+ if test "$enable_dhcpv6" = "no"; then
+ AC_MSG_ERROR([dhcpv4o6 requires dhcpv6])
+ fi
+ # DHCPv4o6 is not yet compatible with delayed-ack
+ if test "$enable_delayed_ack" = "yes"; then
+ AC_MSG_ERROR([dhcpv4o6 is not compatible with delayed-ack])
+ fi
+ AC_DEFINE([DHCP4o6], [1],
+ [Define to 1 to include DHCPv4 over DHCPv6 support.])
+fi
+
+# PARANOIA is off by default (until we can test it with all features)
+AC_ARG_ENABLE(paranoia,
+ AS_HELP_STRING([--enable-paranoia],[enable support for chroot/setuid (default is no)]))
+AC_ARG_ENABLE(early_chroot,
+ AS_HELP_STRING([--enable-early-chroot],[enable chrooting prior to configuration (default is no)]))
+# If someone enables early chroot, but does not enable paranoia, do so for
+# them.
+if test "$enable_paranoia" != "yes" && \
+ test "$enable_early_chroot" = "yes" ; then
+ enable_paranoia="yes"
+fi
+
+if test "$enable_paranoia" = "yes" ; then
+ AC_DEFINE([PARANOIA], [1],
+ [Define to any value to include Ari's PARANOIA patch.])
+fi
+if test "$enable_early_chroot" = "yes" ; then
+ AC_DEFINE([EARLY_CHROOT], [1],
+ [Define to any value to chroot() prior to loading config.])
+fi
+
+AC_ARG_ENABLE(ipv4_pktinfo,
+ AS_HELP_STRING([--enable-ipv4-pktinfo],[enable use of pktinfo on IPv4 sockets (default is no)]))
+
+if test "$enable_ipv4_pktinfo" = "yes"; then
+ AC_DEFINE([USE_V4_PKTINFO], [1],
+ [Define to 1 to enable IPv4 packet info support.])
+fi
+
+AC_ARG_ENABLE(use_sockets,
+ AS_HELP_STRING([--enable-use-sockets],[use the standard BSD socket API (default is no)]))
+
+if test "$enable_use_sockets" = "yes"; then
+ AC_DEFINE([USE_SOCKETS], [1],
+ [Define to 1 to use the standard BSD socket API.])
+fi
+
+# Try to hnadle incorrect byte order for secs field
+# This is off by default
+AC_ARG_ENABLE(secs_byteorder,
+ AS_HELP_STRING([--enable-secs-byteorder],[Correct bad byteorders in the secs field (default is no).]))
+
+if test "$enable_secs_byteorder" = "yes" ; then
+ AC_DEFINE([SECS_BYTEORDER], [1],
+ [Define to correct bad byteorders in secs field.])
+fi
+
+# Include the PID in the log messages. This is useful when there may
+# be multiple instances of a program.
+# This is off by default
+AC_ARG_ENABLE(log_pid,
+ AS_HELP_STRING([--enable-log-pid],[Include PIDs in syslog messages (default is no).]))
+if test "$enable_log_pid" = "yes" ; then
+ AC_DEFINE([USE_LOG_PID], [1],
+ [Define to include PIDs in syslog messages.])
+fi
+
+# Allow for binary search when inserting v4 leases into queues
+AC_ARG_ENABLE(binary_leases,
+ AS_HELP_STRING([--enable-binary-leases],[enable support for binary insertion of leases (default is no)]))
+# binary_leases is off by default.
+if test "$enable_binary_leases" = "yes"; then
+ AC_DEFINE([BINARY_LEASES], [1],
+ [Define to support binary insertion of leases into queues.])
+else
+ enable_binary_leases="no"
+fi
+
+# Testing section
+
+DISTCHECK_ATF_CONFIGURE_FLAG=
+atf_path="no"
+AC_ARG_WITH([atf],
+ AS_HELP_STRING([--with-atf=PATH],[specify location where atf was installed (or "bind")]),
+ [atf_path="$withval"])
+AM_CONDITIONAL(BIND_ATF, test "$atf_path" = "bind")
+if test "$atf_path" = "bind" ; then
+ DISTCHECK_ATF_CONFIGURE_FLAG="--with-atf=bind"
+ 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=`cd $srcdir; 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
+ DISTCHECK_ATF_CONFIGURE_FLAG="--with-atf=$atf_path"
+ # Config path for pkg-config
+ atf_pcp=""
+ if test "$atf_path" != "yes" ; then
+ if test -f $atf_path/lib/pkgconfig/atf-c.pc ; then
+ atf_pcp=$atf_path/lib/pkgconfig
+ elif test -f $atf_path/lib64/pkgconfig/atf-c.pc ; then
+ atf_pcp=$atf_path/lib64/pkgconfig
+ fi
+ else
+ # Not specified, try some common paths
+ atf_dirs="/usr /usr/local /usr/pkg /opt /opt/local"
+ for d in $atf_dirs
+ do
+ if test -f $d/lib/pkgconfig/atf-c.pc ; then
+ atf_pcp=$d/lib/pkgconfig
+ atf_path=$d
+ elif test -f $d/lib64/pkgconfig/atf-c.pc ; then
+ atf_pcp=$d/lib64/pkgconfig
+ atf_path=$d
+ fi
+ done
+ fi
+
+ if test "$atf_pcp" = "" ; then
+ AC_MSG_ERROR([Unable to find atf files in location specified])
+ else
+ AC_CHECK_PROG([pkgcfg_found],[pkg-config],[pkg-config],[])
+ if test "$pkgcfg_found" = ""; then
+ AC_MSG_ERROR([Could not locate ATF, pkg-config not installed])
+ fi
+ ATF_CFLAGS="`PKG_CONFIG_PATH=$atf_pcp pkg-config --cflags atf-c` -DUNIT_TEST"
+ ATF_LDFLAGS="`PKG_CONFIG_PATH=$atf_pcp pkg-config --libs atf-c`"
+ if test -f $atf_pcp/atf-sh.pc ; then
+ ATF_BIN="`PKG_CONFIG_PATH=$atf_pcp pkg-config --variable=exec_prefix atf-sh`/bin"
+ else
+ # older versions don't have atf-sh, try usual place
+ ATF_BIN=$atf_path/bin
+ fi
+
+ if test ! -x $ATF_BIN/atf-run -o ! -x $ATF_BIN/atf-report ; then
+ AC_MSG_WARN([atf-run/atf-report not found, assuming they are in your path])
+ fi
+
+ AC_SUBST(ATF_CFLAGS)
+ AC_SUBST(ATF_LDFLAGS)
+ AC_SUBST(ATF_BIN)
+ fi
+fi
+
+AM_CONDITIONAL(HAVE_ATF, test "$atf_pcp" != "")
+AM_COND_IF([HAVE_ATF], [AC_DEFINE([HAVE_ATF], [1], [ATF framework specified?])])
+AC_SUBST(DISTCHECK_ATF_CONFIGURE_FLAG)
+
+###
+### Path fun. Older versions of DHCP were installed in /usr/sbin, so we
+### need to look there and potentially overwrite by default (but not if
+### the user configures an alternate value). LOCALSTATEDIR is totally
+### braindead. No one uses /usr/local/var/db/ nor /usr/local/var/run, and
+### they would be insane for suggesting it. We need to look in /var/for
+### 'db' and 'state/dhcp' for db files, and /var/run for pid files by
+### default.
+###
+AC_PREFIX_PROGRAM(dhcpd)
+
+# XXX - isn't there SOME WAY to default autoconf to /var instead of
+# /usr/local/var/no/one/has/this/please/stop/trying?
+case "$localstatedir" in
+ '${prefix}/var')
+ localstatedir=/var
+ ;;
+esac
+
+# Allow specification of alternate state files
+AC_ARG_WITH(srv-lease-file,
+ AS_HELP_STRING([--with-srv-lease-file=PATH],[File for dhcpd leases
+ (default is LOCALSTATEDIR/db/dhcpd.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD_DB], ["$withval"],
+ [File for dhcpd leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_srv_lease_file="${localstatedir}/state/dhcp/dhcpd.leases"
+ else
+ with_srv_lease_file="${localstatedir}/state/dhcpd.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_srv_lease_file="${localstatedir}/lib/dhcp/dhcpd.leases"
+ else
+ with_srv_lease_file="${localstatedir}/lib/dhcpd.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_srv_lease_file="${localstatedir}/etc/dhcpd.leases"
+ else
+ with_srv_lease_file="/etc/dhcpd.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/db/dhcpd6.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD6_DB], ["$withval"],
+ [File for dhcpd6 leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_srv6_lease_file="${localstatedir}/state/dhcp/dhcpd6.leases"
+ else
+ with_srv6_lease_file="${localstatedir}/state/dhcpd6.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_srv6_lease_file="${localstatedir}/lib/dhcp/dhcpd6.leases"
+ else
+ with_srv6_lease_file="${localstatedir}/lib/dhcpd6.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_srv6_lease_file="${localstatedir}/etc/dhcpd6.leases"
+ else
+ with_srv6_lease_file="/etc/dhcpd6.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/db/dhclient.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_DB], ["$withval"],
+ [File for dhclient leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_cli_lease_file="${localstatedir}/state/dhcp/dhclient.leases"
+ else
+ with_cli_lease_file="${localstatedir}/state/dhclient.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_cli_lease_file="${localstatedir}/lib/dhcp/dhclient.leases"
+ else
+ with_cli_lease_file="${localstatedir}/lib/dhclient.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_cli_lease_file="${localstatedir}/etc/dhclient.leases"
+ else
+ with_cli_lease_file="/etc/dhclient.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/db/dhclient6.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_DB], ["$withval"],
+ [File for dhclient6 leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_cli6_lease_file="${localstatedir}/state/dhcp/dhclient6.leases"
+ else
+ with_cli6_lease_file="${localstatedir}/state/dhclient6.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_cli6_lease_file="${localstatedir}/lib/dhcp/dhclient6.leases"
+ else
+ with_cli6_lease_file="${localstatedir}/lib/dhclient6.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_cli6_lease_file="${localstatedir}/etc/dhclient6.leases"
+ else
+ with_cli6_lease_file="/etc/dhclient6.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/run/dhcpd.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD_PID], ["$withval"],
+ [File for dhcpd process information.]))
+AC_ARG_WITH(srv6-pid-file,
+ AS_HELP_STRING([--with-srv6-pid-file=PATH],[File for dhcpd6 process information
+ (default is LOCALSTATEDIR/run/dhcpd6.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD6_PID], ["$withval"],
+ [File for dhcpd6 process information.]))
+AC_ARG_WITH(cli-pid-file,
+ AS_HELP_STRING([--with-cli-pid-file=PATH],[File for dhclient process information
+ (default is LOCALSTATEDIR/run/dhclient.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_PID], ["$withval"],
+ [File for dhclient process information.]))
+AC_ARG_WITH(cli6-pid-file,
+ AS_HELP_STRING([--with-cli6-pid-file=PATH],[File for dhclient6 process information
+ (default is LOCALSTATEDIR/run/dhclient6.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_PID], ["$withval"],
+ [File for dhclient6 process information.]))
+AC_ARG_WITH(relay-pid-file,
+ AS_HELP_STRING([--with-relay-pid-file=PATH],[File for dhcrelay process information
+ (default is LOCALSTATEDIR/run/dhcrelay.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCRELAY_PID], ["$withval"],
+ [File for dhcrelay process information.]))
+AC_ARG_WITH(relay6-pid-file,
+ AS_HELP_STRING([--with-relay6-pid-file=PATH],[File for dhcrelay6 process information
+ (default is LOCALSTATEDIR/run/dhcrelay6.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCRELAY6_PID], ["$withval"],
+ [File for dhcrelay6 process information.]))
+
+# Check basic types.
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+
+# Some systems need the u_intX_t types defined across.
+AC_CHECK_TYPE([u_int8_t], [], [
+ AC_TYPE_UINT8_T
+ AC_DEFINE(u_int8_t, [uint8_t], [Define a type for 8-bit unsigned
+ integers.])
+])
+AC_CHECK_TYPE([u_int16_t], [], [
+ AC_TYPE_UINT16_T
+ AC_DEFINE(u_int16_t, [uint16_t], [Define a type for 16-bit unsigned
+ integers.])
+])
+AC_CHECK_TYPE([u_int32_t], [], [
+ AC_TYPE_UINT32_T
+ AC_DEFINE(u_int32_t, [uint32_t], [Define a type for 32-bit unsigned
+ integers.])
+])
+AC_CHECK_TYPE([u_int64_t], [], [
+ AC_TYPE_UINT64_T
+ AC_DEFINE(u_int64_t, [uint64_t], [Define a type for 64-bit unsigned
+ integers.])
+])
+
+# see if ifaddrs.h is available
+AC_CHECK_HEADERS(ifaddrs.h)
+
+# figure out what IPv4 interface code to use
+AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems
+
+AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, ,
+[
+#ifdef HAVE_LINUX_TYPES_H
+#include <linux/types.h>
+#endif
+])
+if test -n "$DO_LPF"
+then
+ AC_DEFINE([HAVE_LPF], [1],
+ [Define to 1 to use the Linux Packet Filter interface code.])
+else
+ AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1)
+ if test -n "$DO_DLPI"
+ then
+ AC_DEFINE([HAVE_DLPI], [1],
+ [Define to 1 to use DLPI interface code.])
+ else
+ AC_CHECK_HEADER(net/bpf.h, DO_BPF=1)
+ if test -n "$DO_BPF"
+ then
+ AC_DEFINE([HAVE_BPF], [1],
+ [Define to 1 to use the
+ Berkeley Packet Filter interface code.])
+ fi
+ fi
+fi
+
+# SIOCGLIFCONF uses some transport structures. Trick is not all platforms
+# use the same structures. We like to use 'struct lifconf' and 'struct
+# lifreq', but we'll use these other structures if they're present. HPUX
+# does not define 'struct lifnum', but does use SIOCGLIFNUM - they use an
+# int value.
+#
+AC_MSG_CHECKING([for struct lifnum])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <net/if.h>
+]], [[ struct lifnum a;
+]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_PLATFORM_HAVELIFNUM], [1],
+ [Define to 1 if the system has 'struct lifnum'.])],[AC_MSG_RESULT(no)])
+
+AC_MSG_CHECKING([for struct if_laddrconf])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h>
+ #include <net/if6.h>
+]], [[ struct if_laddrconf a;
+]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRCONF], [1],
+ [Define to 1 if the system has 'struct if_laddrconf'.])],[AC_MSG_RESULT(no)])
+
+AC_MSG_CHECKING([for struct if_laddrreq])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <net/if6.h>
+]], [[ struct if_laddrreq a;
+]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRREQ], [1],
+ [Define to 1 if the system has 'struct if_laddrreq'.])],[AC_MSG_RESULT(no)])
+
+#
+# check for GCC noreturn attribute
+#
+AC_MSG_CHECKING(for GCC noreturn attribute)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[void foo() __attribute__((noreturn));]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_DHCP_NORETURN], [__attribute__((noreturn))],
+ [Define to the string for a noreturn attribute.])],[AC_MSG_RESULT(no)
+ AC_DEFINE([ISC_DHCP_NORETURN], [],
+ [Define to the string for a noreturn attribute.])])
+
+# Look for optional headers.
+AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
+
+# Solaris needs some libraries for functions
+AC_SEARCH_LIBS(socket, [socket])
+AC_SEARCH_LIBS(inet_ntoa, [nsl])
+
+AC_SEARCH_LIBS(inet_aton, [socket nsl], ,
+ AC_DEFINE([NEED_INET_ATON], [1],
+ [Define to 1 if the inet_aton() function is missing.]))
+
+# Check for a standalone regex library.
+AC_SEARCH_LIBS(regcomp, [regex])
+
+AC_CHECK_FUNCS(strlcat)
+
+# For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
+AC_SEARCH_LIBS(if_nametoindex, [ipv6])
+
+# check for /dev/random (declares HAVE_DEV_RANDOM)
+AC_MSG_CHECKING(for random device)
+AC_ARG_WITH(randomdev,
+ AS_HELP_STRING([--with-randomdev=PATH],[Path for random device
+ (default is /dev/random)]),
+ use_randomdev="$withval", use_randomdev="unspec")
+if test "$use_randomdev" = "unspec"; then
+ if test "$cross_compiling" = "yes"; then
+ AC_MSG_RESULT(unspecified)
+ AC_MSG_ERROR([ need --with-randomdev=PATH or --with-randomdev=no])
+ fi
+ use_randomdev="/dev/random"
+elif test "$use_randomdev" = "yes"; then
+ use_randomdev="/dev/random"
+fi
+if test "$use_randomdev" = "no"; then
+ AC_MSG_RESULT(disabled)
+ BINDCONFIG="$BINDCONFIG --with-randomdev=no"
+else
+ if test "$cross_compiling" = "yes"; then
+ AC_MSG_RESULT($use_randomdev (unchecked))
+ else
+ AC_MSG_RESULT($use_randomdev)
+ AC_CHECK_FILE($use_randomdev,
+ AC_DEFINE([HAVE_DEV_RANDOM], [1],
+ [Define to 1 if you have the /dev/random or other configured file.]),
+ AC_MSG_ERROR(cannot find $use_randomdev))
+ fi
+ BINDCONFIG="$BINDCONFIG --with-randomdev=$use_randomdev"
+fi
+
+BINDIOMUX="--disable-kqueue --disable-epoll --disable-devpoll"
+# check kqueue/epoll/devpoll alternative to select
+AC_ARG_ENABLE(kqueue,
+ AS_HELP_STRING([--enable-kqueue],[use BSD kqueue (default is no)]),
+ want_kqueue="$enableval", want_kqueue="no")
+if test "$want_kqueue" = "yes"; then
+ BINDIOMUX="--enable-kqueue"
+ AC_MSG_WARN([--enable-kqueue is not supported: it may lead to issues such as server looping])
+fi
+AC_ARG_ENABLE(epoll,
+ AS_HELP_STRING([--enable-epoll],[use Linux epoll (default is no)]),
+ want_epoll="$enableval", want_epoll="no")
+if test "$want_epoll" = "yes"; then
+ BINDIOMUX="--enable-epoll"
+ AC_MSG_WARN([--enable-epoll is not supported: it may lead to issues such as server looping])
+fi
+AC_ARG_ENABLE(devpoll,
+ AS_HELP_STRING([--enable-devpoll],[use /dev/poll (default is no)]),
+ want_devpoll="$enableval", want_devpoll="no")
+if test "$want_devpoll" = "yes"; then
+ BINDIOMUX="--enable-devpoll"
+ AC_MSG_WARN([--enable-devpoll is not supported: it may lead to issues such as server looping])
+fi
+AC_SUBST(BINDIOMUX)
+
+# general extra bind configure arguments
+AC_ARG_WITH(bind-extra-config,
+ AS_HELP_STRING([--with-bind-extra-config],[configure bind librairies
+ with some extra options (default is none)]),
+ use_xbindconfig="$withval", use_xbindconfig="")
+case "$use_xbindconfig" in
+yes|no|'')
+ ;;
+*)
+ BINDCONFIG="$BINDCONFIG $use_xbindconfig"
+ AC_MSG_WARN([Most options to bind configure are not supported when used by ISC DHCP])
+ ;;
+esac
+
+# see if there is a "sa_len" field in our interface information structure
+AC_CHECK_MEMBER(struct sockaddr.sa_len,
+ AC_DEFINE([HAVE_SA_LEN], [],
+ [Define to 1 if the sockaddr structure has a length field.]),
+ ,
+ [#include <sys/socket.h>])
+
+# figure out pointer size
+SAVE_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -I$srcdir"
+AC_CHECK_SIZEOF(struct iaddr *, , [
+#include "includes/inet.h"
+#include <stdio.h>
+])
+CFLAGS="$SAVE_CFLAGS"
+
+# Solaris does not have the msg_control or msg_controlen members
+# in the msghdr structure unless you define:
+#
+# _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, and __EXTENSIONS__
+#
+# See the "standards" man page for details.
+#
+# We check for the msg_control member, and if it is not found, we check
+# again with the appropriate defines added to the CFLAGS. (In order to
+# do this we have to remove the check from the cache, which is what the
+# "unset" is for.)
+AC_CHECK_MEMBER(struct msghdr.msg_control,,
+ [CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
+ CFLAGS="$CFLAGS -D__EXTENSIONS__"
+ unset ac_cv_member_struct_msghdr_msg_control
+ AC_CHECK_MEMBER(struct msghdr.msg_control,,
+ [AC_MSG_ERROR([Missing msg_control member in
+ msg_control structure.])],
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+ ])
+ ],
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+ ])
+
+AC_CHECK_MEMBER(struct tpacket_auxdata.tp_vlan_tci,
+ [AC_DEFINE([VLAN_TCI_PRESENT], [1], [tpacket_auxdata.tp_vlan_tci present])]
+ ,, [#include <linux/if_packet.h>])
+
+# bind/Makefile.in is not from automake so we need 2 variables for bind dir
+BINDSUBDIR=
+BINDDIR=
+BINDSRCDIR=
+BINDLIBIRSDIR=
+BINDLIBDNSDIR=
+BINDLIBISCCFGDIR=
+BINDLIBISCDIR=
+DISTCHECK_LIBBIND_CONFIGURE_FLAG=
+AC_ARG_WITH(libbind,
+ AS_HELP_STRING([--with-libbind=PATH],[bind includes and libraries are in PATH]),
+ use_libbind="$withval", use_libbind="no")
+case "$use_libbind" in
+yes)
+ AC_MSG_ERROR([PATH is required in --with-libbind=PATH])
+ ;;
+no)
+ BINDSUBDIR="\${top_srcdir}/bind"
+ my_abs_srcdir=`cd $srcdir && pwd`
+ BINDDIR="${my_abs_srcdir}/bind"
+ if test ! -d "$srcdir/bind"; then
+ AC_MSG_ERROR([Where to find or build bind includes and libraries must be specified])
+ fi
+ if test -d "$srcdir/bind/bind9"; then
+ BINDSRCDIR="${my_abs_srcdir}/bind/bind9"
+ else
+ if test ! -f "$srcdir/bind/version.tmp"; then
+ AC_MSG_ERROR([Cannot find $srcdir/bind/version.tmp])
+ fi
+ . "$srcdir/bind/version.tmp"
+ bindversion=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
+ BINDSRCDIR="${my_abs_srcdir}/bind/bind-$bindversion"
+ fi
+ AC_CONFIG_FILES([$srcdir/bind/Makefile])
+
+ BINDLIBIRSDIR="$BINDSRCDIR/lib/irs"
+ BINDLIBDNSDIR="$BINDSRCDIR/lib/dns"
+ BINDLIBISCCFGDIR="$BINDSRCDIR/lib/isccfg"
+ BINDLIBISCDIR="$BINDSRCDIR/lib/isc"
+ ;;
+*)
+ if test ! -d "$use_libbind"; then
+ AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
+ fi
+ if test ! -d "$use_libbind/include" -o \
+ ! -f "$use_libbind/include/isc/buffer.h"
+ then
+ AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
+ fi
+ if test ! -d "$use_libbind/lib" -o \
+ \( ! -f "$use_libbind/lib/libisc.a" -a \
+ ! -f "$use_libbind/lib/libisc.la" \)
+ then
+ AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
+ fi
+ BINDDIR="$use_libbind"
+ BINDLIBIRSDIR="$BINDDIR/lib"
+ BINDLIBDNSDIR="$BINDDIR/lib"
+ BINDLIBISCCFGDIR="$BINDDIR/lib"
+ BINDLIBISCDIR="$BINDDIR/lib"
+ DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
+ ;;
+esac
+AC_SUBST(BINDSUBDIR)
+AC_SUBST(BINDDIR)
+AC_SUBST(BINDSRCDIR)
+AC_SUBST(BINDLIBIRSDIR)
+AC_SUBST(BINDLIBDNSDIR)
+AC_SUBST(BINDLIBISCCFGDIR)
+AC_SUBST(BINDLIBISCDIR)
+AC_SUBST(DISTCHECK_LIBBIND_CONFIGURE_FLAG)
+AM_CONDITIONAL(HAVE_BINDDIR, test "$use_libbind" = "no")
+
+#
+# GNU libtool support
+#
+case "$build_os" in
+ sunos*)
+ # Just set the maximum command line length for sunos
+ # as it otherwise takes a exceptionally long time to
+ # work it out. Required for libtool.
+
+ lt_cv_sys_max_cmd_len=4096
+ ;;
+esac
+
+want_libtool="no"
+LT_INIT
+want_libtool="yes"
+
+BINDLT=
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG=
+AC_ARG_ENABLE(libtool,
+ AS_HELP_STRING([--enable-libtool],
+[use GNU libtool for dynamic shared libraries (default is yes).]),
+ want_libtool="$enableval")
+
+if test "$use_libbind" != "no"; then
+ if test "$want_libtool" = "yes" -a \
+ ! -f "$use_libbind/lib/libisc.la"
+ then
+ AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
+ fi
+ if test "$want_libtool" = "no" -a \
+ ! -f "$use_libbind/lib/libisc.a"
+ then
+ AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
+ fi
+fi
+
+if test "$want_libtool" = "no"; then
+ AC_MSG_ERROR([libtool configure is used but libtool is disabled?])
+fi
+
+DHLIBS=LTLIBRARIES
+A=la
+BINDLT="--with-libtool --disable-symtable"
+# BIND does not provide uninstall
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG="--enable-libtool --disable-bind-install"
+
+
+AC_SUBST(DHLIBS)
+AC_SUBST(A)
+AC_SUBST(BINDLT)
+AC_SUBST(DISTCHECK_LIBTOOL_CONFIGURE_FLAG)
+
+# quoting in Makefile.am.in
+Q=@
+AC_SUBST(Q)
+
+# install bind includes and libraries
+
+want_install_bind="no"
+want_install_bind="yes"
+if test "$want_libtool" = "yes"; then
+ want_install_bind="yes"
+fi
+if test "$use_libbind" != "no"; then
+ want_install_bind="no"
+fi
+AC_ARG_ENABLE(bind_install,
+ AS_HELP_STRING([--enable-bind-install],
+[install bind includes and libraries.]),
+ want_install_bind="$enableval")
+if test "$want_install_bind" = "yes"; then
+ if test "$use_libbind" != "no"; then
+ AC_MSG_WARN([--enable-bind-install does nothing when --with-libbind is set])
+ fi
+elif test "$want_libtool" = "yes" -a "$use_libbind" = "no"; then
+ AC_MSG_WARN([embedded dynamic bind libraries must be installed])
+fi
+AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes")
+
+# OpenLDAP support.
+AC_ARG_WITH(ldap,
+ AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]),
+ [ldap=$withval],
+ [ldap=no])
+
+# OpenLDAP with SSL support.
+AC_ARG_WITH(ldapcrypto,
+ AS_HELP_STRING([--with-ldapcrypto],[enable OpenLDAP crypto support in dhcpd (default is no)]),
+ [ldapcrypto=$withval],
+ [ldapcrypto=no])
+
+# Gssapi to allow LDAP to authenticate with a keytab
+AC_ARG_WITH(ldap-gssapi,
+ AC_HELP_STRING([--with-ldap-gssapi],
+ [enable krb5/gssapi authentication for OpenLDAP in dhcpd (default is no)]),
+ [ldap_gssapi=$withval],
+ [ldap_gssapi=no])
+
+
+# LDAP CASA auth support.
+AC_ARG_WITH(ldapcasa,
+ AC_HELP_STRING([--with-ldapcasa],
+ [enable LDAP CASA auth support in dhcpd (default is no)]),
+ [ldapcasa=$withval],
+ [ldapcasa=no])
+
+# OpenLDAP support is disabled by default, if enabled then SSL support is an
+# extra optional that is also disabled by default. Enabling LDAP SSL support
+# implies enabling LDAP support. Similarly, KRB5 support implies LDAP support,
+# but doesn't include SSL. The two are not dependant.
+if test x$ldap = xyes || test x$ldapcrypto = xyes || test x$ldap_gssapi = xyes; then
+ saved_LIBS="$LIBS"
+ LIBS=""
+ AC_SEARCH_LIBS(ldap_initialize, [ldap], ,
+ AC_MSG_FAILURE([*** Cannot find ldap_initialize with -lldap - do you need to install an OpenLDAP2 Devel package?]))
+ AC_SEARCH_LIBS(ber_pvt_opt_on, [lber], ,
+ AC_MSG_FAILURE([*** Cannot find ber_pvt_opt_on with -llber - do you need to install an OpenLDAP2 Devel package?]))
+ if test x$ldap_gssapi = xyes ; then
+ AC_SEARCH_LIBS(krb5_init_context, [krb5], ,
+ AC_MSG_FAILURE([*** Cannot find krb5_init_context with -lkrb5 - do you need to install a Kerberos Devel package?]))
+ fi
+
+ # Create LDAP_LIBS which we specify them explicitly rather than lumping them in with LIBS
+ AC_SUBST(LDAP_LIBS, [$LIBS])
+ LIBS="$saved_LIBS"
+
+
+ AC_CHECK_HEADERS([ldap.h])
+ AC_CHECK_FUNCS([inet_pton inet_ntop])
+
+
+ LDAP_CFLAGS="-DLDAP_CONFIGURATION"
+
+ if test x$ldapcasa = xyes ; then
+ AC_CHECK_HEADERS([micasa_mgmd.h],[
+ LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_CASA_AUTH"
+ ], AC_MSG_FAILURE([*** Cannot find micasa_mgmd.h for ldap casa auth support]))
+ fi
+
+ if test x$ldapcrypto = xyes ; then
+ LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_USE_SSL"
+ fi
+
+ if test x$ldap_gssapi = xyes; then
+ LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_USE_GSSAPI"
+ fi
+
+ AC_SUBST(LDAP_CFLAGS, [$LDAP_CFLAGS])
+fi
+
+# Append selected warning levels to CFLAGS before substitution (but after
+# AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) & etc).
+CFLAGS="$CFLAGS $STD_CWARNINGS"
+
+# Try to add the bind and dhcp include directories
+CFLAGS="$CFLAGS -I\$(top_srcdir)/includes -I$BINDDIR/include"
+
+case "$host" in
+*-darwin*)
+ CFLAGS="$CFLAGS -D__APPLE_USE_RFC_3542";;
+*-solaris*)
+ # As of Solaris 11, ethernet dev files are in /dev/net
+ AC_CHECK_FILE(/dev/net,
+ [AC_DEFINE([USE_DEV_NET], [1],
+ [Define to 1 if ethernet devices are in /dev/net])])
+ ;;
+esac
+
+AC_C_FLEXIBLE_ARRAY_MEMBER
+
+AC_CONFIG_FILES([
+ Makefile
+ client/Makefile
+ client/tests/Makefile
+ common/Makefile.am
+ common/Makefile
+ common/tests/Makefile
+ dhcpctl/Makefile.am
+ dhcpctl/Makefile
+ includes/Makefile
+ omapip/Makefile.am
+ omapip/Makefile
+ relay/Makefile
+ server/Makefile
+ tests/Makefile.am
+ tests/Makefile
+ tests/unittest.sh
+ server/tests/Makefile
+ doc/devel/doxyfile
+])
+AC_OUTPUT
+
+AC_MSG_NOTICE([postconfig: run automake in $srcdir])
+(cd $srcdir; automake)
+AC_MSG_NOTICE([postconfig: rerun config.status])
+sh ./config.status
+
+if test "$enable_dhcpv4o6" = "yes"; then
+ DHCP_VERSIONS="DHCPv4, DHCPv6 and DHCPv4-over-DHCPv6"
+elif test "$enable_dhcpv6" != "no"; then
+ DHCP_VERSIONS="DHCPv4 and DHCPv6"
+else
+ DHCP_VERSIONS="DHCPv4"
+fi
+
+cat > config.report << END
+
+ ISC DHCP source configure results:
+ -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+Package:
+ Name: $PACKAGE_NAME
+ Version: $PACKAGE_VERSION
+
+C Compiler: $CC
+
+Flags:
+ DEFS: $DEFS
+ CFLAGS: $CFLAGS
+
+DHCP versions: $DHCP_VERSIONS
+
+Features:
+ debug: $enable_debug
+ failover: $enable_failover
+ execute: $enable_execute
+ binary-leases: $enable_binary_leases
+ dhcpv6: $enable_dhcpv6
+ delayed-ack: $enable_delayed_ack
+
+Developer:
+ ATF unittests : $atf_path
+
+END
+# TODO: Add Perl system tests
+
+if test "$atf_path" != "no"
+then
+echo "ATF_CFLAGS : $ATF_CFLAGS" >> config.report
+echo "ATF_LDFLAGS : $ATF_LDFLAGS" >> config.report
+echo "ATF_BIN : $ATF_BIN" >> config.report
+echo
+fi
+
+cat config.report
+
+echo
+echo Now you can type "make" to build ISC DHCP
+echo
diff --git a/configure.ac-base b/configure.ac-base
new file mode 100644
index 00000000..6bd236ce
--- /dev/null
+++ b/configure.ac-base
@@ -0,0 +1,1093 @@
+AC_INIT([DHCP],[4.4.0-dev],[dhcp-users@isc.org])
+
+@BEGIN WITH LIBTOOL
+# for libtool
+AC_CONFIG_MACRO_DIR([m4])
+@END WITH LIBTOOL
+
+# we specify "foreign" to avoid having to have the GNU mandated files,
+# like AUTHORS, COPYING, and such
+AM_INIT_AUTOMAKE([foreign])
+
+# we specify AM_MAINTAINER_MODE to avoid problems with rebuilding
+# the configure and makefiles. Without it users doing things that
+# change the timestamps on the code, like checking it into a cvs
+# tree, could trigger a rebuild of the infrastructure files which
+# might fail if they don't have the correct tools.
+AM_MAINTAINER_MODE
+
+AC_CANONICAL_HOST
+
+# We want to turn on warnings if we are using gcc and the user did
+# not specify CFLAGS. The autoconf check for the C compiler sets the
+# CFLAGS if gcc is used, so we will save it before we run that check.
+SAVE_CFLAGS="$CFLAGS"
+
+# Now find our C compiler.
+AC_PROG_CC
+
+# Suppress warnings about --datarootdir
+AC_DEFUN([AC_DATAROOTDIR_CHECKED])
+
+# If we have gcc, and AC_PROG_CC changed the flags, then we know the
+# user did not specify any flags. Add warnings in this case.
+if test "$GCC" = "yes"; then
+ if test "$CFLAGS" != "$SAVE_CFLAGS"; then
+ STD_CWARNINGS="$STD_CWARNINGS -Wall -Werror -fno-strict-aliasing"
+ fi
+fi
+
+# We can have some flags to pass to bind configure
+BINDCONFIG=
+if test "$cross_compiling" = "yes"; then
+ BINDCONFIG="--host=$host"
+fi
+# Pass CFLAGS and co. $ac_configure_args looks like "'arg1' 'arg2' ..."
+# and as there can be a space inside an argument some magic is required.
+# This sets $1 ... $N to my_configure_args, arg1 ... argN
+eval "set my_configure_args $ac_configure_args"
+# remove my_configure_args, i.e., the guard against empty $ac_configure_args
+shift
+# iterate on arguments and copying 'arg' when it begins by an upper case
+for a
+do
+ case $a in
+ [[A-Z]]*) BINDCONFIG="$BINDCONFIG '$a'" ;;
+ esac
+done
+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
+# Socket API were designed to be used but we have to live with it.
+# Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+AC_USE_SYSTEM_EXTENSIONS
+
+@BEGIN WITHOUT LIBTOOL
+AC_PROG_RANLIB
+@END WITHOUT LIBTOOL
+
+AC_PATH_PROG(AR, ar)
+AC_SUBST(AR)
+
+if test "X$AR" = "X"; then
+ AC_MSG_ERROR([
+ar program not found. Please fix your PATH to include the directory in
+which ar resides, or set AR in the environment with the full path to ar.])
+fi
+
+AC_CONFIG_HEADERS([includes/config.h])
+
+# we sometimes need to know byte order for building packets
+AC_C_BIGENDIAN(AC_SUBST(byte_order, BIG_ENDIAN),
+ AC_SUBST(byte_order, LITTLE_ENDIAN))
+AC_DEFINE_UNQUOTED([DHCP_BYTE_ORDER], [$byte_order],
+ [Define to BIG_ENDIAN for MSB (Motorola or SPARC CPUs)
+ or LITTLE_ENDIAN for LSB (Intel CPUs).])
+
+# Optional compile-time DEBUGging.
+AC_ARG_ENABLE(debug,
+ AS_HELP_STRING([--enable-debug],[create a debug-only version of the software (default is no).]),
+ [case "${enableval}" in
+ yes) enable_debug=yes
+ AC_DEFINE([DEBUG], [1],
+ [Define to compile debug-only DHCP software.])
+ # Just override CFLAGS totally to remove optimization.
+ CFLAGS="-g";;
+ no) enable_debug=no ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
+ esac],[enable_debug=no])
+
+# XXX: there are actually quite a lot more DEBUG_ features we could enable,
+# but I don't want to pollute the --help space.
+#
+#/* #define DEBUG_TOKENS */
+#/* #define DEBUG_PACKET */
+#/* #define DEBUG_EXPRESSIONS */
+#/* #define DEBUG_FIND_LEASE */
+#/* #define DEBUG_EXPRESSION_PARSE */
+#/* #define DEBUG_CLASS_MATCHING */
+#/* #define DEBUG_MEMORY_LEAKAGE */
+#/* #define DEBUG_MALLOC_POOL */
+#/* #define DEBUG_LEASE_STATE_TRANSITIONS */
+#/* #define DEBUG_RC_HISTORY */
+#/* #define DEBUG_RC_HISTORY_EXHAUSTIVELY */
+#/* #define RC_HISTORY_MAX 10240 */
+#/* #define POINTER_DEBUG */
+#/* #define DEBUG_FAILOVER_MESSAGES */
+#/* #define DEBUG_FAILOVER_TIMING */
+#/* #define DEBUG_DUMP_ALL_LEASES */
+
+# Failover optional compile-time feature.
+AC_ARG_ENABLE(failover,
+ AS_HELP_STRING([--enable-failover],[enable support for failover (default is yes)]))
+# Failover is on by default, so define if it is not explicitly disabled.
+if test "$enable_failover" != "no"; then
+ enable_failover="yes"
+ AC_DEFINE([FAILOVER_PROTOCOL], [1],
+ [Define to include Failover Protocol support.])
+fi
+
+# execute() support.
+AC_ARG_ENABLE(execute,
+ AS_HELP_STRING([--enable-execute],[enable support for execute() in config (default is yes)]))
+# execute() is on by default, so define if it is not explicitly disabled.
+if test "$enable_execute" != "no" ; then
+ enable_execute="yes"
+ AC_DEFINE([ENABLE_EXECUTE], [1],
+ [Define to include execute() config language support.])
+fi
+
+# Server tracing support.
+AC_ARG_ENABLE(tracing,
+ AS_HELP_STRING([--enable-tracing],[enable support for server activity tracing (default is yes)]))
+# tracing is on by default, so define if it is not explicitly disabled.
+if test "$enable_tracing" != "no" ; then
+ AC_DEFINE([TRACING], [1],
+ [Define to include server activity tracing support.])
+fi
+
+# Delayed-ack feature support (experimental).
+AC_ARG_ENABLE(delayed_ack,
+ AS_HELP_STRING([--enable-delayed-ack],[queues multiple DHCPACK replies (default is no)]))
+if test "$enable_delayed_ack" = "yes"; then
+ AC_DEFINE([DELAYED_ACK], [1],
+ [Define to queue multiple DHCPACK replies per fsync.])
+else
+ enable_delayed_ack="no"
+fi
+
+# DHCPv6 optional compile-time feature.
+AC_ARG_ENABLE(dhcpv6,
+ AS_HELP_STRING([--enable-dhcpv6],[enable support for DHCPv6 (default is yes)]))
+# DHCPv6 is on by default, so define if it is not explicitly disabled.
+if test "$enable_dhcpv6" != "no"; then
+ enable_dhcpv6="yes"
+ AC_DEFINE([DHCPv6], [1],
+ [Define to 1 to include DHCPv6 support.])
+fi
+
+# DHCPv4o6 optional compile-time feature.
+AC_ARG_ENABLE(dhcpv4o6,
+ AS_HELP_STRING([--enable-dhcpv4o6],[enable support for DHCPv4-over-DHCPv6 (default is no)]))
+# DHCPv4o6 is off by default, so define if it is explicitly enabled.
+if test "$enable_dhcpv4o6" = "yes"; then
+ # DHCPv4o6 requires DHCPv6
+ if test "$enable_dhcpv6" = "no"; then
+ AC_MSG_ERROR([dhcpv4o6 requires dhcpv6])
+ fi
+ # DHCPv4o6 is not yet compatible with delayed-ack
+ if test "$enable_delayed_ack" = "yes"; then
+ AC_MSG_ERROR([dhcpv4o6 is not compatible with delayed-ack])
+ fi
+ AC_DEFINE([DHCP4o6], [1],
+ [Define to 1 to include DHCPv4 over DHCPv6 support.])
+fi
+
+# PARANOIA is off by default (until we can test it with all features)
+AC_ARG_ENABLE(paranoia,
+ AS_HELP_STRING([--enable-paranoia],[enable support for chroot/setuid (default is no)]))
+AC_ARG_ENABLE(early_chroot,
+ AS_HELP_STRING([--enable-early-chroot],[enable chrooting prior to configuration (default is no)]))
+# If someone enables early chroot, but does not enable paranoia, do so for
+# them.
+if test "$enable_paranoia" != "yes" && \
+ test "$enable_early_chroot" = "yes" ; then
+ enable_paranoia="yes"
+fi
+
+if test "$enable_paranoia" = "yes" ; then
+ AC_DEFINE([PARANOIA], [1],
+ [Define to any value to include Ari's PARANOIA patch.])
+fi
+if test "$enable_early_chroot" = "yes" ; then
+ AC_DEFINE([EARLY_CHROOT], [1],
+ [Define to any value to chroot() prior to loading config.])
+fi
+
+AC_ARG_ENABLE(ipv4_pktinfo,
+ AS_HELP_STRING([--enable-ipv4-pktinfo],[enable use of pktinfo on IPv4 sockets (default is no)]))
+
+if test "$enable_ipv4_pktinfo" = "yes"; then
+ AC_DEFINE([USE_V4_PKTINFO], [1],
+ [Define to 1 to enable IPv4 packet info support.])
+fi
+
+AC_ARG_ENABLE(use_sockets,
+ AS_HELP_STRING([--enable-use-sockets],[use the standard BSD socket API (default is no)]))
+
+if test "$enable_use_sockets" = "yes"; then
+ AC_DEFINE([USE_SOCKETS], [1],
+ [Define to 1 to use the standard BSD socket API.])
+fi
+
+# Try to hnadle incorrect byte order for secs field
+# This is off by default
+AC_ARG_ENABLE(secs_byteorder,
+ AS_HELP_STRING([--enable-secs-byteorder],[Correct bad byteorders in the secs field (default is no).]))
+
+if test "$enable_secs_byteorder" = "yes" ; then
+ AC_DEFINE([SECS_BYTEORDER], [1],
+ [Define to correct bad byteorders in secs field.])
+fi
+
+# Include the PID in the log messages. This is useful when there may
+# be multiple instances of a program.
+# This is off by default
+AC_ARG_ENABLE(log_pid,
+ AS_HELP_STRING([--enable-log-pid],[Include PIDs in syslog messages (default is no).]))
+if test "$enable_log_pid" = "yes" ; then
+ AC_DEFINE([USE_LOG_PID], [1],
+ [Define to include PIDs in syslog messages.])
+fi
+
+# Allow for binary search when inserting v4 leases into queues
+AC_ARG_ENABLE(binary_leases,
+ AS_HELP_STRING([--enable-binary-leases],[enable support for binary insertion of leases (default is no)]))
+# binary_leases is off by default.
+if test "$enable_binary_leases" = "yes"; then
+ AC_DEFINE([BINARY_LEASES], [1],
+ [Define to support binary insertion of leases into queues.])
+else
+ enable_binary_leases="no"
+fi
+
+# Testing section
+
+DISTCHECK_ATF_CONFIGURE_FLAG=
+atf_path="no"
+AC_ARG_WITH([atf],
+ AS_HELP_STRING([--with-atf=PATH],[specify location where atf was installed (or "bind")]),
+ [atf_path="$withval"])
+AM_CONDITIONAL(BIND_ATF, test "$atf_path" = "bind")
+if test "$atf_path" = "bind" ; then
+ DISTCHECK_ATF_CONFIGURE_FLAG="--with-atf=bind"
+ 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=`cd $srcdir; 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
+ DISTCHECK_ATF_CONFIGURE_FLAG="--with-atf=$atf_path"
+ # Config path for pkg-config
+ atf_pcp=""
+ if test "$atf_path" != "yes" ; then
+ if test -f $atf_path/lib/pkgconfig/atf-c.pc ; then
+ atf_pcp=$atf_path/lib/pkgconfig
+ elif test -f $atf_path/lib64/pkgconfig/atf-c.pc ; then
+ atf_pcp=$atf_path/lib64/pkgconfig
+ fi
+ else
+ # Not specified, try some common paths
+ atf_dirs="/usr /usr/local /usr/pkg /opt /opt/local"
+ for d in $atf_dirs
+ do
+ if test -f $d/lib/pkgconfig/atf-c.pc ; then
+ atf_pcp=$d/lib/pkgconfig
+ atf_path=$d
+ elif test -f $d/lib64/pkgconfig/atf-c.pc ; then
+ atf_pcp=$d/lib64/pkgconfig
+ atf_path=$d
+ fi
+ done
+ fi
+
+ if test "$atf_pcp" = "" ; then
+ AC_MSG_ERROR([Unable to find atf files in location specified])
+ else
+ AC_CHECK_PROG([pkgcfg_found],[pkg-config],[pkg-config],[])
+ if test "$pkgcfg_found" = ""; then
+ AC_MSG_ERROR([Could not locate ATF, pkg-config not installed])
+ fi
+ ATF_CFLAGS="`PKG_CONFIG_PATH=$atf_pcp pkg-config --cflags atf-c` -DUNIT_TEST"
+ ATF_LDFLAGS="`PKG_CONFIG_PATH=$atf_pcp pkg-config --libs atf-c`"
+ if test -f $atf_pcp/atf-sh.pc ; then
+ ATF_BIN="`PKG_CONFIG_PATH=$atf_pcp pkg-config --variable=exec_prefix atf-sh`/bin"
+ else
+ # older versions don't have atf-sh, try usual place
+ ATF_BIN=$atf_path/bin
+ fi
+
+ if test ! -x $ATF_BIN/atf-run -o ! -x $ATF_BIN/atf-report ; then
+ AC_MSG_WARN([atf-run/atf-report not found, assuming they are in your path])
+ fi
+
+ AC_SUBST(ATF_CFLAGS)
+ AC_SUBST(ATF_LDFLAGS)
+ AC_SUBST(ATF_BIN)
+ fi
+fi
+
+AM_CONDITIONAL(HAVE_ATF, test "$atf_pcp" != "")
+AM_COND_IF([HAVE_ATF], [AC_DEFINE([HAVE_ATF], [1], [ATF framework specified?])])
+AC_SUBST(DISTCHECK_ATF_CONFIGURE_FLAG)
+
+###
+### Path fun. Older versions of DHCP were installed in /usr/sbin, so we
+### need to look there and potentially overwrite by default (but not if
+### the user configures an alternate value). LOCALSTATEDIR is totally
+### braindead. No one uses /usr/local/var/db/ nor /usr/local/var/run, and
+### they would be insane for suggesting it. We need to look in /var/for
+### 'db' and 'state/dhcp' for db files, and /var/run for pid files by
+### default.
+###
+AC_PREFIX_PROGRAM(dhcpd)
+
+# XXX - isn't there SOME WAY to default autoconf to /var instead of
+# /usr/local/var/no/one/has/this/please/stop/trying?
+case "$localstatedir" in
+ '${prefix}/var')
+ localstatedir=/var
+ ;;
+esac
+
+# Allow specification of alternate state files
+AC_ARG_WITH(srv-lease-file,
+ AS_HELP_STRING([--with-srv-lease-file=PATH],[File for dhcpd leases
+ (default is LOCALSTATEDIR/db/dhcpd.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD_DB], ["$withval"],
+ [File for dhcpd leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_srv_lease_file="${localstatedir}/state/dhcp/dhcpd.leases"
+ else
+ with_srv_lease_file="${localstatedir}/state/dhcpd.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_srv_lease_file="${localstatedir}/lib/dhcp/dhcpd.leases"
+ else
+ with_srv_lease_file="${localstatedir}/lib/dhcpd.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_srv_lease_file="${localstatedir}/etc/dhcpd.leases"
+ else
+ with_srv_lease_file="/etc/dhcpd.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/db/dhcpd6.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD6_DB], ["$withval"],
+ [File for dhcpd6 leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_srv6_lease_file="${localstatedir}/state/dhcp/dhcpd6.leases"
+ else
+ with_srv6_lease_file="${localstatedir}/state/dhcpd6.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_srv6_lease_file="${localstatedir}/lib/dhcp/dhcpd6.leases"
+ else
+ with_srv6_lease_file="${localstatedir}/lib/dhcpd6.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_srv6_lease_file="${localstatedir}/etc/dhcpd6.leases"
+ else
+ with_srv6_lease_file="/etc/dhcpd6.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/db/dhclient.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_DB], ["$withval"],
+ [File for dhclient leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_cli_lease_file="${localstatedir}/state/dhcp/dhclient.leases"
+ else
+ with_cli_lease_file="${localstatedir}/state/dhclient.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_cli_lease_file="${localstatedir}/lib/dhcp/dhclient.leases"
+ else
+ with_cli_lease_file="${localstatedir}/lib/dhclient.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_cli_lease_file="${localstatedir}/etc/dhclient.leases"
+ else
+ with_cli_lease_file="/etc/dhclient.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/db/dhclient6.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_DB], ["$withval"],
+ [File for dhclient6 leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_cli6_lease_file="${localstatedir}/state/dhcp/dhclient6.leases"
+ else
+ with_cli6_lease_file="${localstatedir}/state/dhclient6.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_cli6_lease_file="${localstatedir}/lib/dhcp/dhclient6.leases"
+ else
+ with_cli6_lease_file="${localstatedir}/lib/dhclient6.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_cli6_lease_file="${localstatedir}/etc/dhclient6.leases"
+ else
+ with_cli6_lease_file="/etc/dhclient6.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/run/dhcpd.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD_PID], ["$withval"],
+ [File for dhcpd process information.]))
+AC_ARG_WITH(srv6-pid-file,
+ AS_HELP_STRING([--with-srv6-pid-file=PATH],[File for dhcpd6 process information
+ (default is LOCALSTATEDIR/run/dhcpd6.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD6_PID], ["$withval"],
+ [File for dhcpd6 process information.]))
+AC_ARG_WITH(cli-pid-file,
+ AS_HELP_STRING([--with-cli-pid-file=PATH],[File for dhclient process information
+ (default is LOCALSTATEDIR/run/dhclient.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_PID], ["$withval"],
+ [File for dhclient process information.]))
+AC_ARG_WITH(cli6-pid-file,
+ AS_HELP_STRING([--with-cli6-pid-file=PATH],[File for dhclient6 process information
+ (default is LOCALSTATEDIR/run/dhclient6.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_PID], ["$withval"],
+ [File for dhclient6 process information.]))
+AC_ARG_WITH(relay-pid-file,
+ AS_HELP_STRING([--with-relay-pid-file=PATH],[File for dhcrelay process information
+ (default is LOCALSTATEDIR/run/dhcrelay.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCRELAY_PID], ["$withval"],
+ [File for dhcrelay process information.]))
+AC_ARG_WITH(relay6-pid-file,
+ AS_HELP_STRING([--with-relay6-pid-file=PATH],[File for dhcrelay6 process information
+ (default is LOCALSTATEDIR/run/dhcrelay6.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCRELAY6_PID], ["$withval"],
+ [File for dhcrelay6 process information.]))
+
+# Check basic types.
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+
+# Some systems need the u_intX_t types defined across.
+AC_CHECK_TYPE([u_int8_t], [], [
+ AC_TYPE_UINT8_T
+ AC_DEFINE(u_int8_t, [uint8_t], [Define a type for 8-bit unsigned
+ integers.])
+])
+AC_CHECK_TYPE([u_int16_t], [], [
+ AC_TYPE_UINT16_T
+ AC_DEFINE(u_int16_t, [uint16_t], [Define a type for 16-bit unsigned
+ integers.])
+])
+AC_CHECK_TYPE([u_int32_t], [], [
+ AC_TYPE_UINT32_T
+ AC_DEFINE(u_int32_t, [uint32_t], [Define a type for 32-bit unsigned
+ integers.])
+])
+AC_CHECK_TYPE([u_int64_t], [], [
+ AC_TYPE_UINT64_T
+ AC_DEFINE(u_int64_t, [uint64_t], [Define a type for 64-bit unsigned
+ integers.])
+])
+
+# see if ifaddrs.h is available
+AC_CHECK_HEADERS(ifaddrs.h)
+
+# figure out what IPv4 interface code to use
+AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems
+
+AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, ,
+[
+#ifdef HAVE_LINUX_TYPES_H
+#include <linux/types.h>
+#endif
+])
+if test -n "$DO_LPF"
+then
+ AC_DEFINE([HAVE_LPF], [1],
+ [Define to 1 to use the Linux Packet Filter interface code.])
+else
+ AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1)
+ if test -n "$DO_DLPI"
+ then
+ AC_DEFINE([HAVE_DLPI], [1],
+ [Define to 1 to use DLPI interface code.])
+ else
+ AC_CHECK_HEADER(net/bpf.h, DO_BPF=1)
+ if test -n "$DO_BPF"
+ then
+ AC_DEFINE([HAVE_BPF], [1],
+ [Define to 1 to use the
+ Berkeley Packet Filter interface code.])
+ fi
+ fi
+fi
+
+# SIOCGLIFCONF uses some transport structures. Trick is not all platforms
+# use the same structures. We like to use 'struct lifconf' and 'struct
+# lifreq', but we'll use these other structures if they're present. HPUX
+# does not define 'struct lifnum', but does use SIOCGLIFNUM - they use an
+# int value.
+#
+AC_MSG_CHECKING([for struct lifnum])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <net/if.h>
+]], [[ struct lifnum a;
+]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_PLATFORM_HAVELIFNUM], [1],
+ [Define to 1 if the system has 'struct lifnum'.])],[AC_MSG_RESULT(no)])
+
+AC_MSG_CHECKING([for struct if_laddrconf])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h>
+ #include <net/if6.h>
+]], [[ struct if_laddrconf a;
+]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRCONF], [1],
+ [Define to 1 if the system has 'struct if_laddrconf'.])],[AC_MSG_RESULT(no)])
+
+AC_MSG_CHECKING([for struct if_laddrreq])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <net/if6.h>
+]], [[ struct if_laddrreq a;
+]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRREQ], [1],
+ [Define to 1 if the system has 'struct if_laddrreq'.])],[AC_MSG_RESULT(no)])
+
+#
+# check for GCC noreturn attribute
+#
+AC_MSG_CHECKING(for GCC noreturn attribute)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[void foo() __attribute__((noreturn));]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_DHCP_NORETURN], [__attribute__((noreturn))],
+ [Define to the string for a noreturn attribute.])],[AC_MSG_RESULT(no)
+ AC_DEFINE([ISC_DHCP_NORETURN], [],
+ [Define to the string for a noreturn attribute.])])
+
+# Look for optional headers.
+AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
+
+# Solaris needs some libraries for functions
+AC_SEARCH_LIBS(socket, [socket])
+AC_SEARCH_LIBS(inet_ntoa, [nsl])
+
+AC_SEARCH_LIBS(inet_aton, [socket nsl], ,
+ AC_DEFINE([NEED_INET_ATON], [1],
+ [Define to 1 if the inet_aton() function is missing.]))
+
+# Check for a standalone regex library.
+AC_SEARCH_LIBS(regcomp, [regex])
+
+AC_CHECK_FUNCS(strlcat)
+
+# For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
+AC_SEARCH_LIBS(if_nametoindex, [ipv6])
+
+# check for /dev/random (declares HAVE_DEV_RANDOM)
+AC_MSG_CHECKING(for random device)
+AC_ARG_WITH(randomdev,
+ AS_HELP_STRING([--with-randomdev=PATH],[Path for random device
+ (default is /dev/random)]),
+ use_randomdev="$withval", use_randomdev="unspec")
+if test "$use_randomdev" = "unspec"; then
+ if test "$cross_compiling" = "yes"; then
+ AC_MSG_RESULT(unspecified)
+ AC_MSG_ERROR([ need --with-randomdev=PATH or --with-randomdev=no])
+ fi
+ use_randomdev="/dev/random"
+elif test "$use_randomdev" = "yes"; then
+ use_randomdev="/dev/random"
+fi
+if test "$use_randomdev" = "no"; then
+ AC_MSG_RESULT(disabled)
+ BINDCONFIG="$BINDCONFIG --with-randomdev=no"
+else
+ if test "$cross_compiling" = "yes"; then
+ AC_MSG_RESULT($use_randomdev (unchecked))
+ else
+ AC_MSG_RESULT($use_randomdev)
+ AC_CHECK_FILE($use_randomdev,
+ AC_DEFINE([HAVE_DEV_RANDOM], [1],
+ [Define to 1 if you have the /dev/random or other configured file.]),
+ AC_MSG_ERROR(cannot find $use_randomdev))
+ fi
+ BINDCONFIG="$BINDCONFIG --with-randomdev=$use_randomdev"
+fi
+
+BINDIOMUX="--disable-kqueue --disable-epoll --disable-devpoll"
+# check kqueue/epoll/devpoll alternative to select
+AC_ARG_ENABLE(kqueue,
+ AS_HELP_STRING([--enable-kqueue],[use BSD kqueue (default is no)]),
+ want_kqueue="$enableval", want_kqueue="no")
+if test "$want_kqueue" = "yes"; then
+ BINDIOMUX="--enable-kqueue"
+ AC_MSG_WARN([--enable-kqueue is not supported: it may lead to issues such as server looping])
+fi
+AC_ARG_ENABLE(epoll,
+ AS_HELP_STRING([--enable-epoll],[use Linux epoll (default is no)]),
+ want_epoll="$enableval", want_epoll="no")
+if test "$want_epoll" = "yes"; then
+ BINDIOMUX="--enable-epoll"
+ AC_MSG_WARN([--enable-epoll is not supported: it may lead to issues such as server looping])
+fi
+AC_ARG_ENABLE(devpoll,
+ AS_HELP_STRING([--enable-devpoll],[use /dev/poll (default is no)]),
+ want_devpoll="$enableval", want_devpoll="no")
+if test "$want_devpoll" = "yes"; then
+ BINDIOMUX="--enable-devpoll"
+ AC_MSG_WARN([--enable-devpoll is not supported: it may lead to issues such as server looping])
+fi
+AC_SUBST(BINDIOMUX)
+
+# general extra bind configure arguments
+AC_ARG_WITH(bind-extra-config,
+ AS_HELP_STRING([--with-bind-extra-config],[configure bind librairies
+ with some extra options (default is none)]),
+ use_xbindconfig="$withval", use_xbindconfig="")
+case "$use_xbindconfig" in
+yes|no|'')
+ ;;
+*)
+ BINDCONFIG="$BINDCONFIG $use_xbindconfig"
+ AC_MSG_WARN([Most options to bind configure are not supported when used by ISC DHCP])
+ ;;
+esac
+
+# see if there is a "sa_len" field in our interface information structure
+AC_CHECK_MEMBER(struct sockaddr.sa_len,
+ AC_DEFINE([HAVE_SA_LEN], [],
+ [Define to 1 if the sockaddr structure has a length field.]),
+ ,
+ [#include <sys/socket.h>])
+
+# figure out pointer size
+SAVE_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -I$srcdir"
+AC_CHECK_SIZEOF(struct iaddr *, , [
+#include "includes/inet.h"
+#include <stdio.h>
+])
+CFLAGS="$SAVE_CFLAGS"
+
+# Solaris does not have the msg_control or msg_controlen members
+# in the msghdr structure unless you define:
+#
+# _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, and __EXTENSIONS__
+#
+# See the "standards" man page for details.
+#
+# We check for the msg_control member, and if it is not found, we check
+# again with the appropriate defines added to the CFLAGS. (In order to
+# do this we have to remove the check from the cache, which is what the
+# "unset" is for.)
+AC_CHECK_MEMBER(struct msghdr.msg_control,,
+ [CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
+ CFLAGS="$CFLAGS -D__EXTENSIONS__"
+ unset ac_cv_member_struct_msghdr_msg_control
+ AC_CHECK_MEMBER(struct msghdr.msg_control,,
+ [AC_MSG_ERROR([Missing msg_control member in
+ msg_control structure.])],
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+ ])
+ ],
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+ ])
+
+AC_CHECK_MEMBER(struct tpacket_auxdata.tp_vlan_tci,
+ [AC_DEFINE([VLAN_TCI_PRESENT], [1], [tpacket_auxdata.tp_vlan_tci present])]
+ ,, [#include <linux/if_packet.h>])
+
+# bind/Makefile.in is not from automake so we need 2 variables for bind dir
+BINDSUBDIR=
+BINDDIR=
+BINDSRCDIR=
+BINDLIBIRSDIR=
+BINDLIBDNSDIR=
+BINDLIBISCCFGDIR=
+BINDLIBISCDIR=
+DISTCHECK_LIBBIND_CONFIGURE_FLAG=
+AC_ARG_WITH(libbind,
+ AS_HELP_STRING([--with-libbind=PATH],[bind includes and libraries are in PATH]),
+ use_libbind="$withval", use_libbind="no")
+case "$use_libbind" in
+yes)
+ AC_MSG_ERROR([PATH is required in --with-libbind=PATH])
+ ;;
+no)
+ BINDSUBDIR="\${top_srcdir}/bind"
+ my_abs_srcdir=`cd $srcdir && pwd`
+ BINDDIR="${my_abs_srcdir}/bind"
+ if test ! -d "$srcdir/bind"; then
+ AC_MSG_ERROR([Where to find or build bind includes and libraries must be specified])
+ fi
+ if test -d "$srcdir/bind/bind9"; then
+ BINDSRCDIR="${my_abs_srcdir}/bind/bind9"
+ else
+ if test ! -f "$srcdir/bind/version.tmp"; then
+ AC_MSG_ERROR([Cannot find $srcdir/bind/version.tmp])
+ fi
+ . "$srcdir/bind/version.tmp"
+ bindversion=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
+ BINDSRCDIR="${my_abs_srcdir}/bind/bind-$bindversion"
+ fi
+ AC_CONFIG_FILES([$srcdir/bind/Makefile])
+
+ BINDLIBIRSDIR="$BINDSRCDIR/lib/irs"
+ BINDLIBDNSDIR="$BINDSRCDIR/lib/dns"
+ BINDLIBISCCFGDIR="$BINDSRCDIR/lib/isccfg"
+ BINDLIBISCDIR="$BINDSRCDIR/lib/isc"
+ ;;
+*)
+ if test ! -d "$use_libbind"; then
+ AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
+ fi
+ if test ! -d "$use_libbind/include" -o \
+ ! -f "$use_libbind/include/isc/buffer.h"
+ then
+ AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
+ fi
+ if test ! -d "$use_libbind/lib" -o \
+ \( ! -f "$use_libbind/lib/libisc.a" -a \
+ ! -f "$use_libbind/lib/libisc.la" \)
+ then
+ AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
+ fi
+ BINDDIR="$use_libbind"
+ BINDLIBIRSDIR="$BINDDIR/lib"
+ BINDLIBDNSDIR="$BINDDIR/lib"
+ BINDLIBISCCFGDIR="$BINDDIR/lib"
+ BINDLIBISCDIR="$BINDDIR/lib"
+ DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
+ ;;
+esac
+AC_SUBST(BINDSUBDIR)
+AC_SUBST(BINDDIR)
+AC_SUBST(BINDSRCDIR)
+AC_SUBST(BINDLIBIRSDIR)
+AC_SUBST(BINDLIBDNSDIR)
+AC_SUBST(BINDLIBISCCFGDIR)
+AC_SUBST(BINDLIBISCDIR)
+AC_SUBST(DISTCHECK_LIBBIND_CONFIGURE_FLAG)
+AM_CONDITIONAL(HAVE_BINDDIR, test "$use_libbind" = "no")
+
+#
+# GNU libtool support
+#
+case "$build_os" in
+ sunos*)
+ # Just set the maximum command line length for sunos
+ # as it otherwise takes a exceptionally long time to
+ # work it out. Required for libtool.
+
+ lt_cv_sys_max_cmd_len=4096
+ ;;
+esac
+
+want_libtool="no"
+@BEGIN WITH LIBTOOL
+LT_INIT
+want_libtool="yes"
+@END WITH LIBTOOL
+
+BINDLT=
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG=
+AC_ARG_ENABLE(libtool,
+ AS_HELP_STRING([--enable-libtool],
+@BEGIN WITH LIBTOOL
+[use GNU libtool for dynamic shared libraries (default is yes).]),
+@END WITH LIBTOOL
+@BEGIN WITHOUT LIBTOOL
+[use GNU libtool for dynamic shared libraries (default is no).]),
+@END WITHOUT LIBTOOL
+ want_libtool="$enableval")
+
+if test "$use_libbind" != "no"; then
+ if test "$want_libtool" = "yes" -a \
+ ! -f "$use_libbind/lib/libisc.la"
+ then
+ AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
+ fi
+ if test "$want_libtool" = "no" -a \
+ ! -f "$use_libbind/lib/libisc.a"
+ then
+ AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
+ fi
+fi
+
+@BEGIN WITH LIBTOOL
+if test "$want_libtool" = "no"; then
+ AC_MSG_ERROR([libtool configure is used but libtool is disabled?])
+fi
+
+DHLIBS=LTLIBRARIES
+A=la
+BINDLT="--with-libtool --disable-symtable"
+# BIND does not provide uninstall
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG="--enable-libtool --disable-bind-install"
+@END WITH LIBTOOL
+
+@BEGIN WITHOUT LIBTOOL
+if test "$want_libtool" = "yes"; then
+ AC_MSG_WARN([legacy configure is used but libtool is enabled. Trying to recover...])
+ # expand $ac_configure_args
+ eval "set my_configure_args $ac_configure_args"
+ shift
+ cd $srcdir; exec ./config+lt "$@"
+ AC_MSG_ERROR([Recovering failed])
+fi
+
+DHLIBS=LIBRARIES
+A=a
+@END WITHOUT LIBTOOL
+
+AC_SUBST(DHLIBS)
+AC_SUBST(A)
+AC_SUBST(BINDLT)
+AC_SUBST(DISTCHECK_LIBTOOL_CONFIGURE_FLAG)
+
+# quoting in Makefile.am.in
+Q=@
+AC_SUBST(Q)
+
+# install bind includes and libraries
+
+want_install_bind="no"
+@BEGIN WITH LIBTOOL
+want_install_bind="yes"
+@END WITH LIBTOOL
+if test "$want_libtool" = "yes"; then
+ want_install_bind="yes"
+fi
+if test "$use_libbind" != "no"; then
+ want_install_bind="no"
+fi
+AC_ARG_ENABLE(bind_install,
+ AS_HELP_STRING([--enable-bind-install],
+@BEGIN WITH LIBTOOL
+[install bind includes and libraries.]),
+@END WITH LIBTOOL
+@BEGIN WITHOUT LIBTOOL
+[install bind includes and libraries (default is no).]),
+@END WITHOUT LIBTOOL
+ want_install_bind="$enableval")
+if test "$want_install_bind" = "yes"; then
+ if test "$use_libbind" != "no"; then
+ AC_MSG_WARN([--enable-bind-install does nothing when --with-libbind is set])
+ fi
+elif test "$want_libtool" = "yes" -a "$use_libbind" = "no"; then
+ AC_MSG_WARN([embedded dynamic bind libraries must be installed])
+fi
+AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes")
+
+# OpenLDAP support.
+AC_ARG_WITH(ldap,
+ AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]),
+ [ldap=$withval],
+ [ldap=no])
+
+# OpenLDAP with SSL support.
+AC_ARG_WITH(ldapcrypto,
+ AS_HELP_STRING([--with-ldapcrypto],[enable OpenLDAP crypto support in dhcpd (default is no)]),
+ [ldapcrypto=$withval],
+ [ldapcrypto=no])
+
+# Gssapi to allow LDAP to authenticate with a keytab
+AC_ARG_WITH(ldap-gssapi,
+ AC_HELP_STRING([--with-ldap-gssapi],
+ [enable krb5/gssapi authentication for OpenLDAP in dhcpd (default is no)]),
+ [ldap_gssapi=$withval],
+ [ldap_gssapi=no])
+
+
+# LDAP CASA auth support.
+AC_ARG_WITH(ldapcasa,
+ AC_HELP_STRING([--with-ldapcasa],
+ [enable LDAP CASA auth support in dhcpd (default is no)]),
+ [ldapcasa=$withval],
+ [ldapcasa=no])
+
+# OpenLDAP support is disabled by default, if enabled then SSL support is an
+# extra optional that is also disabled by default. Enabling LDAP SSL support
+# implies enabling LDAP support. Similarly, KRB5 support implies LDAP support,
+# but doesn't include SSL. The two are not dependant.
+if test x$ldap = xyes || test x$ldapcrypto = xyes || test x$ldap_gssapi = xyes; then
+ saved_LIBS="$LIBS"
+ LIBS=""
+ AC_SEARCH_LIBS(ldap_initialize, [ldap], ,
+ AC_MSG_FAILURE([*** Cannot find ldap_initialize with -lldap - do you need to install an OpenLDAP2 Devel package?]))
+ AC_SEARCH_LIBS(ber_pvt_opt_on, [lber], ,
+ AC_MSG_FAILURE([*** Cannot find ber_pvt_opt_on with -llber - do you need to install an OpenLDAP2 Devel package?]))
+ if test x$ldap_gssapi = xyes ; then
+ AC_SEARCH_LIBS(krb5_init_context, [krb5], ,
+ AC_MSG_FAILURE([*** Cannot find krb5_init_context with -lkrb5 - do you need to install a Kerberos Devel package?]))
+ fi
+
+ # Create LDAP_LIBS which we specify them explicitly rather than lumping them in with LIBS
+ AC_SUBST(LDAP_LIBS, [$LIBS])
+ LIBS="$saved_LIBS"
+
+
+ AC_CHECK_HEADERS([ldap.h])
+ AC_CHECK_FUNCS([inet_pton inet_ntop])
+
+
+ LDAP_CFLAGS="-DLDAP_CONFIGURATION"
+
+ if test x$ldapcasa = xyes ; then
+ AC_CHECK_HEADERS([micasa_mgmd.h],[
+ LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_CASA_AUTH"
+ ], AC_MSG_FAILURE([*** Cannot find micasa_mgmd.h for ldap casa auth support]))
+ fi
+
+ if test x$ldapcrypto = xyes ; then
+ LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_USE_SSL"
+ fi
+
+ if test x$ldap_gssapi = xyes; then
+ LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_USE_GSSAPI"
+ fi
+
+ AC_SUBST(LDAP_CFLAGS, [$LDAP_CFLAGS])
+fi
+
+# Append selected warning levels to CFLAGS before substitution (but after
+# AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) & etc).
+CFLAGS="$CFLAGS $STD_CWARNINGS"
+
+# Try to add the bind and dhcp include directories
+CFLAGS="$CFLAGS -I\$(top_srcdir)/includes -I$BINDDIR/include"
+
+case "$host" in
+*-darwin*)
+ CFLAGS="$CFLAGS -D__APPLE_USE_RFC_3542";;
+*-solaris*)
+ # As of Solaris 11, ethernet dev files are in /dev/net
+ AC_CHECK_FILE(/dev/net,
+ [AC_DEFINE([USE_DEV_NET], [1],
+ [Define to 1 if ethernet devices are in /dev/net])])
+ ;;
+esac
+
+AC_C_FLEXIBLE_ARRAY_MEMBER
+
+AC_CONFIG_FILES([
+ Makefile
+ client/Makefile
+ client/tests/Makefile
+ common/Makefile.am
+ common/Makefile
+ common/tests/Makefile
+ dhcpctl/Makefile.am
+ dhcpctl/Makefile
+ includes/Makefile
+ omapip/Makefile.am
+ omapip/Makefile
+ relay/Makefile
+ server/Makefile
+ tests/Makefile.am
+ tests/Makefile
+ tests/unittest.sh
+ server/tests/Makefile
+ doc/devel/doxyfile
+])
+AC_OUTPUT
+
+@BEGIN WITH LIBTOOL
+AC_MSG_NOTICE([postconfig: run automake in $srcdir])
+(cd $srcdir; automake)
+AC_MSG_NOTICE([postconfig: rerun config.status])
+sh ./config.status
+@END WITH LIBTOOL
+
+if test "$enable_dhcpv4o6" = "yes"; then
+ DHCP_VERSIONS="DHCPv4, DHCPv6 and DHCPv4-over-DHCPv6"
+elif test "$enable_dhcpv6" != "no"; then
+ DHCP_VERSIONS="DHCPv4 and DHCPv6"
+else
+ DHCP_VERSIONS="DHCPv4"
+fi
+
+cat > config.report << END
+
+ ISC DHCP source configure results:
+ -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+Package:
+ Name: $PACKAGE_NAME
+ Version: $PACKAGE_VERSION
+
+C Compiler: $CC
+
+Flags:
+ DEFS: $DEFS
+ CFLAGS: $CFLAGS
+
+DHCP versions: $DHCP_VERSIONS
+
+Features:
+ debug: $enable_debug
+ failover: $enable_failover
+ execute: $enable_execute
+ binary-leases: $enable_binary_leases
+ dhcpv6: $enable_dhcpv6
+ delayed-ack: $enable_delayed_ack
+
+Developer:
+ ATF unittests : $atf_path
+
+END
+# TODO: Add Perl system tests
+
+if test "$atf_path" != "no"
+then
+echo "ATF_CFLAGS : $ATF_CFLAGS" >> config.report
+echo "ATF_LDFLAGS : $ATF_LDFLAGS" >> config.report
+echo "ATF_BIN : $ATF_BIN" >> config.report
+echo
+fi
+
+cat config.report
+
+echo
+echo Now you can type "make" to build ISC DHCP
+echo
diff --git a/configure.ac-lt b/configure.ac-lt
new file mode 100644
index 00000000..302271de
--- /dev/null
+++ b/configure.ac-lt
@@ -0,0 +1,1051 @@
+AC_INIT([DHCP],[4.4.0-dev],[dhcp-users@isc.org])
+
+
+# we specify "foreign" to avoid having to have the GNU mandated files,
+# like AUTHORS, COPYING, and such
+AM_INIT_AUTOMAKE([foreign])
+
+# we specify AM_MAINTAINER_MODE to avoid problems with rebuilding
+# the configure and makefiles. Without it users doing things that
+# change the timestamps on the code, like checking it into a cvs
+# tree, could trigger a rebuild of the infrastructure files which
+# might fail if they don't have the correct tools.
+AM_MAINTAINER_MODE
+
+AC_CANONICAL_HOST
+
+# We want to turn on warnings if we are using gcc and the user did
+# not specify CFLAGS. The autoconf check for the C compiler sets the
+# CFLAGS if gcc is used, so we will save it before we run that check.
+SAVE_CFLAGS="$CFLAGS"
+
+# Now find our C compiler.
+AC_PROG_CC
+
+# Suppress warnings about --datarootdir
+AC_DEFUN([AC_DATAROOTDIR_CHECKED])
+
+# If we have gcc, and AC_PROG_CC changed the flags, then we know the
+# user did not specify any flags. Add warnings in this case.
+if test "$GCC" = "yes"; then
+ if test "$CFLAGS" != "$SAVE_CFLAGS"; then
+ STD_CWARNINGS="$STD_CWARNINGS -Wall -Werror -fno-strict-aliasing"
+ fi
+fi
+
+# We can have some flags to pass to bind configure
+BINDCONFIG=
+if test "$cross_compiling" = "yes"; then
+ BINDCONFIG="--host=$host"
+fi
+# Pass CFLAGS and co. $ac_configure_args looks like "'arg1' 'arg2' ..."
+# and as there can be a space inside an argument some magic is required.
+# This sets $1 ... $N to my_configure_args, arg1 ... argN
+eval "set my_configure_args $ac_configure_args"
+# remove my_configure_args, i.e., the guard against empty $ac_configure_args
+shift
+# iterate on arguments and copying 'arg' when it begins by an upper case
+for a
+do
+ case $a in
+ [[A-Z]]*) BINDCONFIG="$BINDCONFIG '$a'" ;;
+ esac
+done
+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
+# Socket API were designed to be used but we have to live with it.
+# Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+AC_USE_SYSTEM_EXTENSIONS
+
+AC_PROG_RANLIB
+
+AC_PATH_PROG(AR, ar)
+AC_SUBST(AR)
+
+if test "X$AR" = "X"; then
+ AC_MSG_ERROR([
+ar program not found. Please fix your PATH to include the directory in
+which ar resides, or set AR in the environment with the full path to ar.])
+fi
+
+AC_CONFIG_HEADERS([includes/config.h])
+
+# we sometimes need to know byte order for building packets
+AC_C_BIGENDIAN(AC_SUBST(byte_order, BIG_ENDIAN),
+ AC_SUBST(byte_order, LITTLE_ENDIAN))
+AC_DEFINE_UNQUOTED([DHCP_BYTE_ORDER], [$byte_order],
+ [Define to BIG_ENDIAN for MSB (Motorola or SPARC CPUs)
+ or LITTLE_ENDIAN for LSB (Intel CPUs).])
+
+# Optional compile-time DEBUGging.
+AC_ARG_ENABLE(debug,
+ AS_HELP_STRING([--enable-debug],[create a debug-only version of the software (default is no).]),
+ [case "${enableval}" in
+ yes) enable_debug=yes
+ AC_DEFINE([DEBUG], [1],
+ [Define to compile debug-only DHCP software.])
+ # Just override CFLAGS totally to remove optimization.
+ CFLAGS="-g";;
+ no) enable_debug=no ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
+ esac],[enable_debug=no])
+
+# XXX: there are actually quite a lot more DEBUG_ features we could enable,
+# but I don't want to pollute the --help space.
+#
+#/* #define DEBUG_TOKENS */
+#/* #define DEBUG_PACKET */
+#/* #define DEBUG_EXPRESSIONS */
+#/* #define DEBUG_FIND_LEASE */
+#/* #define DEBUG_EXPRESSION_PARSE */
+#/* #define DEBUG_CLASS_MATCHING */
+#/* #define DEBUG_MEMORY_LEAKAGE */
+#/* #define DEBUG_MALLOC_POOL */
+#/* #define DEBUG_LEASE_STATE_TRANSITIONS */
+#/* #define DEBUG_RC_HISTORY */
+#/* #define DEBUG_RC_HISTORY_EXHAUSTIVELY */
+#/* #define RC_HISTORY_MAX 10240 */
+#/* #define POINTER_DEBUG */
+#/* #define DEBUG_FAILOVER_MESSAGES */
+#/* #define DEBUG_FAILOVER_TIMING */
+#/* #define DEBUG_DUMP_ALL_LEASES */
+
+# Failover optional compile-time feature.
+AC_ARG_ENABLE(failover,
+ AS_HELP_STRING([--enable-failover],[enable support for failover (default is yes)]))
+# Failover is on by default, so define if it is not explicitly disabled.
+if test "$enable_failover" != "no"; then
+ enable_failover="yes"
+ AC_DEFINE([FAILOVER_PROTOCOL], [1],
+ [Define to include Failover Protocol support.])
+fi
+
+# execute() support.
+AC_ARG_ENABLE(execute,
+ AS_HELP_STRING([--enable-execute],[enable support for execute() in config (default is yes)]))
+# execute() is on by default, so define if it is not explicitly disabled.
+if test "$enable_execute" != "no" ; then
+ enable_execute="yes"
+ AC_DEFINE([ENABLE_EXECUTE], [1],
+ [Define to include execute() config language support.])
+fi
+
+# Server tracing support.
+AC_ARG_ENABLE(tracing,
+ AS_HELP_STRING([--enable-tracing],[enable support for server activity tracing (default is yes)]))
+# tracing is on by default, so define if it is not explicitly disabled.
+if test "$enable_tracing" != "no" ; then
+ AC_DEFINE([TRACING], [1],
+ [Define to include server activity tracing support.])
+fi
+
+# Delayed-ack feature support (experimental).
+AC_ARG_ENABLE(delayed_ack,
+ AS_HELP_STRING([--enable-delayed-ack],[queues multiple DHCPACK replies (default is no)]))
+if test "$enable_delayed_ack" = "yes"; then
+ AC_DEFINE([DELAYED_ACK], [1],
+ [Define to queue multiple DHCPACK replies per fsync.])
+else
+ enable_delayed_ack="no"
+fi
+
+# DHCPv6 optional compile-time feature.
+AC_ARG_ENABLE(dhcpv6,
+ AS_HELP_STRING([--enable-dhcpv6],[enable support for DHCPv6 (default is yes)]))
+# DHCPv6 is on by default, so define if it is not explicitly disabled.
+if test "$enable_dhcpv6" != "no"; then
+ enable_dhcpv6="yes"
+ AC_DEFINE([DHCPv6], [1],
+ [Define to 1 to include DHCPv6 support.])
+fi
+
+# DHCPv4o6 optional compile-time feature.
+AC_ARG_ENABLE(dhcpv4o6,
+ AS_HELP_STRING([--enable-dhcpv4o6],[enable support for DHCPv4-over-DHCPv6 (default is no)]))
+# DHCPv4o6 is off by default, so define if it is explicitly enabled.
+if test "$enable_dhcpv4o6" = "yes"; then
+ # DHCPv4o6 requires DHCPv6
+ if test "$enable_dhcpv6" = "no"; then
+ AC_MSG_ERROR([dhcpv4o6 requires dhcpv6])
+ fi
+ # DHCPv4o6 is not yet compatible with delayed-ack
+ if test "$enable_delayed_ack" = "yes"; then
+ AC_MSG_ERROR([dhcpv4o6 is not compatible with delayed-ack])
+ fi
+ AC_DEFINE([DHCP4o6], [1],
+ [Define to 1 to include DHCPv4 over DHCPv6 support.])
+fi
+
+# PARANOIA is off by default (until we can test it with all features)
+AC_ARG_ENABLE(paranoia,
+ AS_HELP_STRING([--enable-paranoia],[enable support for chroot/setuid (default is no)]))
+AC_ARG_ENABLE(early_chroot,
+ AS_HELP_STRING([--enable-early-chroot],[enable chrooting prior to configuration (default is no)]))
+# If someone enables early chroot, but does not enable paranoia, do so for
+# them.
+if test "$enable_paranoia" != "yes" && \
+ test "$enable_early_chroot" = "yes" ; then
+ enable_paranoia="yes"
+fi
+
+if test "$enable_paranoia" = "yes" ; then
+ AC_DEFINE([PARANOIA], [1],
+ [Define to any value to include Ari's PARANOIA patch.])
+fi
+if test "$enable_early_chroot" = "yes" ; then
+ AC_DEFINE([EARLY_CHROOT], [1],
+ [Define to any value to chroot() prior to loading config.])
+fi
+
+AC_ARG_ENABLE(ipv4_pktinfo,
+ AS_HELP_STRING([--enable-ipv4-pktinfo],[enable use of pktinfo on IPv4 sockets (default is no)]))
+
+if test "$enable_ipv4_pktinfo" = "yes"; then
+ AC_DEFINE([USE_V4_PKTINFO], [1],
+ [Define to 1 to enable IPv4 packet info support.])
+fi
+
+AC_ARG_ENABLE(use_sockets,
+ AS_HELP_STRING([--enable-use-sockets],[use the standard BSD socket API (default is no)]))
+
+if test "$enable_use_sockets" = "yes"; then
+ AC_DEFINE([USE_SOCKETS], [1],
+ [Define to 1 to use the standard BSD socket API.])
+fi
+
+# Try to hnadle incorrect byte order for secs field
+# This is off by default
+AC_ARG_ENABLE(secs_byteorder,
+ AS_HELP_STRING([--enable-secs-byteorder],[Correct bad byteorders in the secs field (default is no).]))
+
+if test "$enable_secs_byteorder" = "yes" ; then
+ AC_DEFINE([SECS_BYTEORDER], [1],
+ [Define to correct bad byteorders in secs field.])
+fi
+
+# Include the PID in the log messages. This is useful when there may
+# be multiple instances of a program.
+# This is off by default
+AC_ARG_ENABLE(log_pid,
+ AS_HELP_STRING([--enable-log-pid],[Include PIDs in syslog messages (default is no).]))
+if test "$enable_log_pid" = "yes" ; then
+ AC_DEFINE([USE_LOG_PID], [1],
+ [Define to include PIDs in syslog messages.])
+fi
+
+# Allow for binary search when inserting v4 leases into queues
+AC_ARG_ENABLE(binary_leases,
+ AS_HELP_STRING([--enable-binary-leases],[enable support for binary insertion of leases (default is no)]))
+# binary_leases is off by default.
+if test "$enable_binary_leases" = "yes"; then
+ AC_DEFINE([BINARY_LEASES], [1],
+ [Define to support binary insertion of leases into queues.])
+else
+ enable_binary_leases="no"
+fi
+
+# Testing section
+
+DISTCHECK_ATF_CONFIGURE_FLAG=
+atf_path="no"
+AC_ARG_WITH([atf],
+ AS_HELP_STRING([--with-atf=PATH],[specify location where atf was installed (or "bind")]),
+ [atf_path="$withval"])
+AM_CONDITIONAL(BIND_ATF, test "$atf_path" = "bind")
+if test "$atf_path" = "bind" ; then
+ DISTCHECK_ATF_CONFIGURE_FLAG="--with-atf=bind"
+ 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=`cd $srcdir; 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
+ DISTCHECK_ATF_CONFIGURE_FLAG="--with-atf=$atf_path"
+ # Config path for pkg-config
+ atf_pcp=""
+ if test "$atf_path" != "yes" ; then
+ if test -f $atf_path/lib/pkgconfig/atf-c.pc ; then
+ atf_pcp=$atf_path/lib/pkgconfig
+ elif test -f $atf_path/lib64/pkgconfig/atf-c.pc ; then
+ atf_pcp=$atf_path/lib64/pkgconfig
+ fi
+ else
+ # Not specified, try some common paths
+ atf_dirs="/usr /usr/local /usr/pkg /opt /opt/local"
+ for d in $atf_dirs
+ do
+ if test -f $d/lib/pkgconfig/atf-c.pc ; then
+ atf_pcp=$d/lib/pkgconfig
+ atf_path=$d
+ elif test -f $d/lib64/pkgconfig/atf-c.pc ; then
+ atf_pcp=$d/lib64/pkgconfig
+ atf_path=$d
+ fi
+ done
+ fi
+
+ if test "$atf_pcp" = "" ; then
+ AC_MSG_ERROR([Unable to find atf files in location specified])
+ else
+ AC_CHECK_PROG([pkgcfg_found],[pkg-config],[pkg-config],[])
+ if test "$pkgcfg_found" = ""; then
+ AC_MSG_ERROR([Could not locate ATF, pkg-config not installed])
+ fi
+ ATF_CFLAGS="`PKG_CONFIG_PATH=$atf_pcp pkg-config --cflags atf-c` -DUNIT_TEST"
+ ATF_LDFLAGS="`PKG_CONFIG_PATH=$atf_pcp pkg-config --libs atf-c`"
+ if test -f $atf_pcp/atf-sh.pc ; then
+ ATF_BIN="`PKG_CONFIG_PATH=$atf_pcp pkg-config --variable=exec_prefix atf-sh`/bin"
+ else
+ # older versions don't have atf-sh, try usual place
+ ATF_BIN=$atf_path/bin
+ fi
+
+ if test ! -x $ATF_BIN/atf-run -o ! -x $ATF_BIN/atf-report ; then
+ AC_MSG_WARN([atf-run/atf-report not found, assuming they are in your path])
+ fi
+
+ AC_SUBST(ATF_CFLAGS)
+ AC_SUBST(ATF_LDFLAGS)
+ AC_SUBST(ATF_BIN)
+ fi
+fi
+
+AM_CONDITIONAL(HAVE_ATF, test "$atf_pcp" != "")
+AM_COND_IF([HAVE_ATF], [AC_DEFINE([HAVE_ATF], [1], [ATF framework specified?])])
+AC_SUBST(DISTCHECK_ATF_CONFIGURE_FLAG)
+
+###
+### Path fun. Older versions of DHCP were installed in /usr/sbin, so we
+### need to look there and potentially overwrite by default (but not if
+### the user configures an alternate value). LOCALSTATEDIR is totally
+### braindead. No one uses /usr/local/var/db/ nor /usr/local/var/run, and
+### they would be insane for suggesting it. We need to look in /var/for
+### 'db' and 'state/dhcp' for db files, and /var/run for pid files by
+### default.
+###
+AC_PREFIX_PROGRAM(dhcpd)
+
+# XXX - isn't there SOME WAY to default autoconf to /var instead of
+# /usr/local/var/no/one/has/this/please/stop/trying?
+case "$localstatedir" in
+ '${prefix}/var')
+ localstatedir=/var
+ ;;
+esac
+
+# Allow specification of alternate state files
+AC_ARG_WITH(srv-lease-file,
+ AS_HELP_STRING([--with-srv-lease-file=PATH],[File for dhcpd leases
+ (default is LOCALSTATEDIR/db/dhcpd.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD_DB], ["$withval"],
+ [File for dhcpd leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_srv_lease_file="${localstatedir}/state/dhcp/dhcpd.leases"
+ else
+ with_srv_lease_file="${localstatedir}/state/dhcpd.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_srv_lease_file="${localstatedir}/lib/dhcp/dhcpd.leases"
+ else
+ with_srv_lease_file="${localstatedir}/lib/dhcpd.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_srv_lease_file="${localstatedir}/etc/dhcpd.leases"
+ else
+ with_srv_lease_file="/etc/dhcpd.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/db/dhcpd6.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD6_DB], ["$withval"],
+ [File for dhcpd6 leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_srv6_lease_file="${localstatedir}/state/dhcp/dhcpd6.leases"
+ else
+ with_srv6_lease_file="${localstatedir}/state/dhcpd6.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_srv6_lease_file="${localstatedir}/lib/dhcp/dhcpd6.leases"
+ else
+ with_srv6_lease_file="${localstatedir}/lib/dhcpd6.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_srv6_lease_file="${localstatedir}/etc/dhcpd6.leases"
+ else
+ with_srv6_lease_file="/etc/dhcpd6.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/db/dhclient.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_DB], ["$withval"],
+ [File for dhclient leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_cli_lease_file="${localstatedir}/state/dhcp/dhclient.leases"
+ else
+ with_cli_lease_file="${localstatedir}/state/dhclient.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_cli_lease_file="${localstatedir}/lib/dhcp/dhclient.leases"
+ else
+ with_cli_lease_file="${localstatedir}/lib/dhclient.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_cli_lease_file="${localstatedir}/etc/dhclient.leases"
+ else
+ with_cli_lease_file="/etc/dhclient.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/db/dhclient6.leases)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_DB], ["$withval"],
+ [File for dhclient6 leases.]))
+
+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"
+ elif [[ -d "${localstatedir}/state" ]] ; then
+ if [[ -d "${localstatedir}/state/dhcp" ]] ; then
+ with_cli6_lease_file="${localstatedir}/state/dhcp/dhclient6.leases"
+ else
+ with_cli6_lease_file="${localstatedir}/state/dhclient6.leases"
+ fi
+ elif [[ -d "${localstatedir}/lib" ]] ; then
+ if [[ -d "${localstatedir}/lib/dhcp" ]] ; then
+ with_cli6_lease_file="${localstatedir}/lib/dhcp/dhclient6.leases"
+ else
+ with_cli6_lease_file="${localstatedir}/lib/dhclient6.leases"
+ fi
+ elif [[ -d "${localstatedir}/etc" ]] ; then
+ with_cli6_lease_file="${localstatedir}/etc/dhclient6.leases"
+ else
+ with_cli6_lease_file="/etc/dhclient6.leases"
+ fi
+fi
+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
+ (default is LOCALSTATEDIR/run/dhcpd.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD_PID], ["$withval"],
+ [File for dhcpd process information.]))
+AC_ARG_WITH(srv6-pid-file,
+ AS_HELP_STRING([--with-srv6-pid-file=PATH],[File for dhcpd6 process information
+ (default is LOCALSTATEDIR/run/dhcpd6.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCPD6_PID], ["$withval"],
+ [File for dhcpd6 process information.]))
+AC_ARG_WITH(cli-pid-file,
+ AS_HELP_STRING([--with-cli-pid-file=PATH],[File for dhclient process information
+ (default is LOCALSTATEDIR/run/dhclient.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT_PID], ["$withval"],
+ [File for dhclient process information.]))
+AC_ARG_WITH(cli6-pid-file,
+ AS_HELP_STRING([--with-cli6-pid-file=PATH],[File for dhclient6 process information
+ (default is LOCALSTATEDIR/run/dhclient6.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCLIENT6_PID], ["$withval"],
+ [File for dhclient6 process information.]))
+AC_ARG_WITH(relay-pid-file,
+ AS_HELP_STRING([--with-relay-pid-file=PATH],[File for dhcrelay process information
+ (default is LOCALSTATEDIR/run/dhcrelay.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCRELAY_PID], ["$withval"],
+ [File for dhcrelay process information.]))
+AC_ARG_WITH(relay6-pid-file,
+ AS_HELP_STRING([--with-relay6-pid-file=PATH],[File for dhcrelay6 process information
+ (default is LOCALSTATEDIR/run/dhcrelay6.pid)]),
+ AC_DEFINE_UNQUOTED([_PATH_DHCRELAY6_PID], ["$withval"],
+ [File for dhcrelay6 process information.]))
+
+# Check basic types.
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+
+# Some systems need the u_intX_t types defined across.
+AC_CHECK_TYPE([u_int8_t], [], [
+ AC_TYPE_UINT8_T
+ AC_DEFINE(u_int8_t, [uint8_t], [Define a type for 8-bit unsigned
+ integers.])
+])
+AC_CHECK_TYPE([u_int16_t], [], [
+ AC_TYPE_UINT16_T
+ AC_DEFINE(u_int16_t, [uint16_t], [Define a type for 16-bit unsigned
+ integers.])
+])
+AC_CHECK_TYPE([u_int32_t], [], [
+ AC_TYPE_UINT32_T
+ AC_DEFINE(u_int32_t, [uint32_t], [Define a type for 32-bit unsigned
+ integers.])
+])
+AC_CHECK_TYPE([u_int64_t], [], [
+ AC_TYPE_UINT64_T
+ AC_DEFINE(u_int64_t, [uint64_t], [Define a type for 64-bit unsigned
+ integers.])
+])
+
+# see if ifaddrs.h is available
+AC_CHECK_HEADERS(ifaddrs.h)
+
+# figure out what IPv4 interface code to use
+AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems
+
+AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, ,
+[
+#ifdef HAVE_LINUX_TYPES_H
+#include <linux/types.h>
+#endif
+])
+if test -n "$DO_LPF"
+then
+ AC_DEFINE([HAVE_LPF], [1],
+ [Define to 1 to use the Linux Packet Filter interface code.])
+else
+ AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1)
+ if test -n "$DO_DLPI"
+ then
+ AC_DEFINE([HAVE_DLPI], [1],
+ [Define to 1 to use DLPI interface code.])
+ else
+ AC_CHECK_HEADER(net/bpf.h, DO_BPF=1)
+ if test -n "$DO_BPF"
+ then
+ AC_DEFINE([HAVE_BPF], [1],
+ [Define to 1 to use the
+ Berkeley Packet Filter interface code.])
+ fi
+ fi
+fi
+
+# SIOCGLIFCONF uses some transport structures. Trick is not all platforms
+# use the same structures. We like to use 'struct lifconf' and 'struct
+# lifreq', but we'll use these other structures if they're present. HPUX
+# does not define 'struct lifnum', but does use SIOCGLIFNUM - they use an
+# int value.
+#
+AC_MSG_CHECKING([for struct lifnum])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <net/if.h>
+]], [[ struct lifnum a;
+]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_PLATFORM_HAVELIFNUM], [1],
+ [Define to 1 if the system has 'struct lifnum'.])],[AC_MSG_RESULT(no)])
+
+AC_MSG_CHECKING([for struct if_laddrconf])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h>
+ #include <net/if6.h>
+]], [[ struct if_laddrconf a;
+]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRCONF], [1],
+ [Define to 1 if the system has 'struct if_laddrconf'.])],[AC_MSG_RESULT(no)])
+
+AC_MSG_CHECKING([for struct if_laddrreq])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <net/if6.h>
+]], [[ struct if_laddrreq a;
+]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_PLATFORM_HAVEIF_LADDRREQ], [1],
+ [Define to 1 if the system has 'struct if_laddrreq'.])],[AC_MSG_RESULT(no)])
+
+#
+# check for GCC noreturn attribute
+#
+AC_MSG_CHECKING(for GCC noreturn attribute)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[void foo() __attribute__((noreturn));]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE([ISC_DHCP_NORETURN], [__attribute__((noreturn))],
+ [Define to the string for a noreturn attribute.])],[AC_MSG_RESULT(no)
+ AC_DEFINE([ISC_DHCP_NORETURN], [],
+ [Define to the string for a noreturn attribute.])])
+
+# Look for optional headers.
+AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
+
+# Solaris needs some libraries for functions
+AC_SEARCH_LIBS(socket, [socket])
+AC_SEARCH_LIBS(inet_ntoa, [nsl])
+
+AC_SEARCH_LIBS(inet_aton, [socket nsl], ,
+ AC_DEFINE([NEED_INET_ATON], [1],
+ [Define to 1 if the inet_aton() function is missing.]))
+
+# Check for a standalone regex library.
+AC_SEARCH_LIBS(regcomp, [regex])
+
+AC_CHECK_FUNCS(strlcat)
+
+# For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
+AC_SEARCH_LIBS(if_nametoindex, [ipv6])
+
+# check for /dev/random (declares HAVE_DEV_RANDOM)
+AC_MSG_CHECKING(for random device)
+AC_ARG_WITH(randomdev,
+ AS_HELP_STRING([--with-randomdev=PATH],[Path for random device
+ (default is /dev/random)]),
+ use_randomdev="$withval", use_randomdev="unspec")
+if test "$use_randomdev" = "unspec"; then
+ if test "$cross_compiling" = "yes"; then
+ AC_MSG_RESULT(unspecified)
+ AC_MSG_ERROR([ need --with-randomdev=PATH or --with-randomdev=no])
+ fi
+ use_randomdev="/dev/random"
+elif test "$use_randomdev" = "yes"; then
+ use_randomdev="/dev/random"
+fi
+if test "$use_randomdev" = "no"; then
+ AC_MSG_RESULT(disabled)
+ BINDCONFIG="$BINDCONFIG --with-randomdev=no"
+else
+ if test "$cross_compiling" = "yes"; then
+ AC_MSG_RESULT($use_randomdev (unchecked))
+ else
+ AC_MSG_RESULT($use_randomdev)
+ AC_CHECK_FILE($use_randomdev,
+ AC_DEFINE([HAVE_DEV_RANDOM], [1],
+ [Define to 1 if you have the /dev/random or other configured file.]),
+ AC_MSG_ERROR(cannot find $use_randomdev))
+ fi
+ BINDCONFIG="$BINDCONFIG --with-randomdev=$use_randomdev"
+fi
+
+BINDIOMUX="--disable-kqueue --disable-epoll --disable-devpoll"
+# check kqueue/epoll/devpoll alternative to select
+AC_ARG_ENABLE(kqueue,
+ AS_HELP_STRING([--enable-kqueue],[use BSD kqueue (default is no)]),
+ want_kqueue="$enableval", want_kqueue="no")
+if test "$want_kqueue" = "yes"; then
+ BINDIOMUX="--enable-kqueue"
+ AC_MSG_WARN([--enable-kqueue is not supported: it may lead to issues such as server looping])
+fi
+AC_ARG_ENABLE(epoll,
+ AS_HELP_STRING([--enable-epoll],[use Linux epoll (default is no)]),
+ want_epoll="$enableval", want_epoll="no")
+if test "$want_epoll" = "yes"; then
+ BINDIOMUX="--enable-epoll"
+ AC_MSG_WARN([--enable-epoll is not supported: it may lead to issues such as server looping])
+fi
+AC_ARG_ENABLE(devpoll,
+ AS_HELP_STRING([--enable-devpoll],[use /dev/poll (default is no)]),
+ want_devpoll="$enableval", want_devpoll="no")
+if test "$want_devpoll" = "yes"; then
+ BINDIOMUX="--enable-devpoll"
+ AC_MSG_WARN([--enable-devpoll is not supported: it may lead to issues such as server looping])
+fi
+AC_SUBST(BINDIOMUX)
+
+# general extra bind configure arguments
+AC_ARG_WITH(bind-extra-config,
+ AS_HELP_STRING([--with-bind-extra-config],[configure bind librairies
+ with some extra options (default is none)]),
+ use_xbindconfig="$withval", use_xbindconfig="")
+case "$use_xbindconfig" in
+yes|no|'')
+ ;;
+*)
+ BINDCONFIG="$BINDCONFIG $use_xbindconfig"
+ AC_MSG_WARN([Most options to bind configure are not supported when used by ISC DHCP])
+ ;;
+esac
+
+# see if there is a "sa_len" field in our interface information structure
+AC_CHECK_MEMBER(struct sockaddr.sa_len,
+ AC_DEFINE([HAVE_SA_LEN], [],
+ [Define to 1 if the sockaddr structure has a length field.]),
+ ,
+ [#include <sys/socket.h>])
+
+# figure out pointer size
+SAVE_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -I$srcdir"
+AC_CHECK_SIZEOF(struct iaddr *, , [
+#include "includes/inet.h"
+#include <stdio.h>
+])
+CFLAGS="$SAVE_CFLAGS"
+
+# Solaris does not have the msg_control or msg_controlen members
+# in the msghdr structure unless you define:
+#
+# _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED, and __EXTENSIONS__
+#
+# See the "standards" man page for details.
+#
+# We check for the msg_control member, and if it is not found, we check
+# again with the appropriate defines added to the CFLAGS. (In order to
+# do this we have to remove the check from the cache, which is what the
+# "unset" is for.)
+AC_CHECK_MEMBER(struct msghdr.msg_control,,
+ [CFLAGS="$CFLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
+ CFLAGS="$CFLAGS -D__EXTENSIONS__"
+ unset ac_cv_member_struct_msghdr_msg_control
+ AC_CHECK_MEMBER(struct msghdr.msg_control,,
+ [AC_MSG_ERROR([Missing msg_control member in
+ msg_control structure.])],
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+ ])
+ ],
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+ ])
+
+AC_CHECK_MEMBER(struct tpacket_auxdata.tp_vlan_tci,
+ [AC_DEFINE([VLAN_TCI_PRESENT], [1], [tpacket_auxdata.tp_vlan_tci present])]
+ ,, [#include <linux/if_packet.h>])
+
+# bind/Makefile.in is not from automake so we need 2 variables for bind dir
+BINDSUBDIR=
+BINDDIR=
+BINDSRCDIR=
+BINDLIBIRSDIR=
+BINDLIBDNSDIR=
+BINDLIBISCCFGDIR=
+BINDLIBISCDIR=
+DISTCHECK_LIBBIND_CONFIGURE_FLAG=
+AC_ARG_WITH(libbind,
+ AS_HELP_STRING([--with-libbind=PATH],[bind includes and libraries are in PATH]),
+ use_libbind="$withval", use_libbind="no")
+case "$use_libbind" in
+yes)
+ AC_MSG_ERROR([PATH is required in --with-libbind=PATH])
+ ;;
+no)
+ BINDSUBDIR="\${top_srcdir}/bind"
+ my_abs_srcdir=`cd $srcdir && pwd`
+ BINDDIR="${my_abs_srcdir}/bind"
+ if test ! -d "$srcdir/bind"; then
+ AC_MSG_ERROR([Where to find or build bind includes and libraries must be specified])
+ fi
+ if test -d "$srcdir/bind/bind9"; then
+ BINDSRCDIR="${my_abs_srcdir}/bind/bind9"
+ else
+ if test ! -f "$srcdir/bind/version.tmp"; then
+ AC_MSG_ERROR([Cannot find $srcdir/bind/version.tmp])
+ fi
+ . "$srcdir/bind/version.tmp"
+ bindversion=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
+ BINDSRCDIR="${my_abs_srcdir}/bind/bind-$bindversion"
+ fi
+ AC_CONFIG_FILES([$srcdir/bind/Makefile])
+
+ BINDLIBIRSDIR="$BINDSRCDIR/lib/irs"
+ BINDLIBDNSDIR="$BINDSRCDIR/lib/dns"
+ BINDLIBISCCFGDIR="$BINDSRCDIR/lib/isccfg"
+ BINDLIBISCDIR="$BINDSRCDIR/lib/isc"
+ ;;
+*)
+ if test ! -d "$use_libbind"; then
+ AC_MSG_ERROR([Cannot find bind directory at $use_libbind])
+ fi
+ if test ! -d "$use_libbind/include" -o \
+ ! -f "$use_libbind/include/isc/buffer.h"
+ then
+ AC_MSG_ERROR([Cannot find bind includes at $use_libbind/include])
+ fi
+ if test ! -d "$use_libbind/lib" -o \
+ \( ! -f "$use_libbind/lib/libisc.a" -a \
+ ! -f "$use_libbind/lib/libisc.la" \)
+ then
+ AC_MSG_ERROR([Cannot find bind libraries at $use_libbind/lib])
+ fi
+ BINDDIR="$use_libbind"
+ BINDLIBIRSDIR="$BINDDIR/lib"
+ BINDLIBDNSDIR="$BINDDIR/lib"
+ BINDLIBISCCFGDIR="$BINDDIR/lib"
+ BINDLIBISCDIR="$BINDDIR/lib"
+ DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind"
+ ;;
+esac
+AC_SUBST(BINDSUBDIR)
+AC_SUBST(BINDDIR)
+AC_SUBST(BINDSRCDIR)
+AC_SUBST(BINDLIBIRSDIR)
+AC_SUBST(BINDLIBDNSDIR)
+AC_SUBST(BINDLIBISCCFGDIR)
+AC_SUBST(BINDLIBISCDIR)
+AC_SUBST(DISTCHECK_LIBBIND_CONFIGURE_FLAG)
+AM_CONDITIONAL(HAVE_BINDDIR, test "$use_libbind" = "no")
+
+#
+# GNU libtool support
+#
+case "$build_os" in
+ sunos*)
+ # Just set the maximum command line length for sunos
+ # as it otherwise takes a exceptionally long time to
+ # work it out. Required for libtool.
+
+ lt_cv_sys_max_cmd_len=4096
+ ;;
+esac
+
+want_libtool="no"
+
+BINDLT=
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG=
+AC_ARG_ENABLE(libtool,
+ AS_HELP_STRING([--enable-libtool],
+[use GNU libtool for dynamic shared libraries (default is no).]),
+ want_libtool="$enableval")
+
+if test "$use_libbind" != "no"; then
+ if test "$want_libtool" = "yes" -a \
+ ! -f "$use_libbind/lib/libisc.la"
+ then
+ AC_MSG_ERROR([Cannot find dynamic libraries at $use_libbind/lib])
+ fi
+ if test "$want_libtool" = "no" -a \
+ ! -f "$use_libbind/lib/libisc.a"
+ then
+ AC_MSG_ERROR([Cannot find static libraries at $use_libbind/lib])
+ fi
+fi
+
+
+if test "$want_libtool" = "yes"; then
+ AC_MSG_WARN([legacy configure is used but libtool is enabled. Trying to recover...])
+ # expand $ac_configure_args
+ eval "set my_configure_args $ac_configure_args"
+ shift
+ cd $srcdir; exec ./config+lt "$@"
+ AC_MSG_ERROR([Recovering failed])
+fi
+
+DHLIBS=LIBRARIES
+A=a
+
+AC_SUBST(DHLIBS)
+AC_SUBST(A)
+AC_SUBST(BINDLT)
+AC_SUBST(DISTCHECK_LIBTOOL_CONFIGURE_FLAG)
+
+# quoting in Makefile.am.in
+Q=@
+AC_SUBST(Q)
+
+# install bind includes and libraries
+
+want_install_bind="no"
+if test "$want_libtool" = "yes"; then
+ want_install_bind="yes"
+fi
+if test "$use_libbind" != "no"; then
+ want_install_bind="no"
+fi
+AC_ARG_ENABLE(bind_install,
+ AS_HELP_STRING([--enable-bind-install],
+[install bind includes and libraries (default is no).]),
+ want_install_bind="$enableval")
+if test "$want_install_bind" = "yes"; then
+ if test "$use_libbind" != "no"; then
+ AC_MSG_WARN([--enable-bind-install does nothing when --with-libbind is set])
+ fi
+elif test "$want_libtool" = "yes" -a "$use_libbind" = "no"; then
+ AC_MSG_WARN([embedded dynamic bind libraries must be installed])
+fi
+AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes")
+
+# OpenLDAP support.
+AC_ARG_WITH(ldap,
+ AS_HELP_STRING([--with-ldap],[enable OpenLDAP support in dhcpd (default is no)]),
+ [ldap=$withval],
+ [ldap=no])
+
+# OpenLDAP with SSL support.
+AC_ARG_WITH(ldapcrypto,
+ AS_HELP_STRING([--with-ldapcrypto],[enable OpenLDAP crypto support in dhcpd (default is no)]),
+ [ldapcrypto=$withval],
+ [ldapcrypto=no])
+
+# Gssapi to allow LDAP to authenticate with a keytab
+AC_ARG_WITH(ldap-gssapi,
+ AC_HELP_STRING([--with-ldap-gssapi],
+ [enable krb5/gssapi authentication for OpenLDAP in dhcpd (default is no)]),
+ [ldap_gssapi=$withval],
+ [ldap_gssapi=no])
+
+
+# LDAP CASA auth support.
+AC_ARG_WITH(ldapcasa,
+ AC_HELP_STRING([--with-ldapcasa],
+ [enable LDAP CASA auth support in dhcpd (default is no)]),
+ [ldapcasa=$withval],
+ [ldapcasa=no])
+
+# OpenLDAP support is disabled by default, if enabled then SSL support is an
+# extra optional that is also disabled by default. Enabling LDAP SSL support
+# implies enabling LDAP support. Similarly, KRB5 support implies LDAP support,
+# but doesn't include SSL. The two are not dependant.
+if test x$ldap = xyes || test x$ldapcrypto = xyes || test x$ldap_gssapi = xyes; then
+ saved_LIBS="$LIBS"
+ LIBS=""
+ AC_SEARCH_LIBS(ldap_initialize, [ldap], ,
+ AC_MSG_FAILURE([*** Cannot find ldap_initialize with -lldap - do you need to install an OpenLDAP2 Devel package?]))
+ AC_SEARCH_LIBS(ber_pvt_opt_on, [lber], ,
+ AC_MSG_FAILURE([*** Cannot find ber_pvt_opt_on with -llber - do you need to install an OpenLDAP2 Devel package?]))
+ if test x$ldap_gssapi = xyes ; then
+ AC_SEARCH_LIBS(krb5_init_context, [krb5], ,
+ AC_MSG_FAILURE([*** Cannot find krb5_init_context with -lkrb5 - do you need to install a Kerberos Devel package?]))
+ fi
+
+ # Create LDAP_LIBS which we specify them explicitly rather than lumping them in with LIBS
+ AC_SUBST(LDAP_LIBS, [$LIBS])
+ LIBS="$saved_LIBS"
+
+
+ AC_CHECK_HEADERS([ldap.h])
+ AC_CHECK_FUNCS([inet_pton inet_ntop])
+
+
+ LDAP_CFLAGS="-DLDAP_CONFIGURATION"
+
+ if test x$ldapcasa = xyes ; then
+ AC_CHECK_HEADERS([micasa_mgmd.h],[
+ LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_CASA_AUTH"
+ ], AC_MSG_FAILURE([*** Cannot find micasa_mgmd.h for ldap casa auth support]))
+ fi
+
+ if test x$ldapcrypto = xyes ; then
+ LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_USE_SSL"
+ fi
+
+ if test x$ldap_gssapi = xyes; then
+ LDAP_CFLAGS="$LDAP_CFLAGS -DLDAP_USE_GSSAPI"
+ fi
+
+ AC_SUBST(LDAP_CFLAGS, [$LDAP_CFLAGS])
+fi
+
+# Append selected warning levels to CFLAGS before substitution (but after
+# AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) & etc).
+CFLAGS="$CFLAGS $STD_CWARNINGS"
+
+# Try to add the bind and dhcp include directories
+CFLAGS="$CFLAGS -I\$(top_srcdir)/includes -I$BINDDIR/include"
+
+case "$host" in
+*-darwin*)
+ CFLAGS="$CFLAGS -D__APPLE_USE_RFC_3542";;
+*-solaris*)
+ # As of Solaris 11, ethernet dev files are in /dev/net
+ AC_CHECK_FILE(/dev/net,
+ [AC_DEFINE([USE_DEV_NET], [1],
+ [Define to 1 if ethernet devices are in /dev/net])])
+ ;;
+esac
+
+AC_C_FLEXIBLE_ARRAY_MEMBER
+
+AC_CONFIG_FILES([
+ Makefile
+ client/Makefile
+ client/tests/Makefile
+ common/Makefile.am
+ common/Makefile
+ common/tests/Makefile
+ dhcpctl/Makefile.am
+ dhcpctl/Makefile
+ includes/Makefile
+ omapip/Makefile.am
+ omapip/Makefile
+ relay/Makefile
+ server/Makefile
+ tests/Makefile.am
+ tests/Makefile
+ tests/unittest.sh
+ server/tests/Makefile
+ doc/devel/doxyfile
+])
+AC_OUTPUT
+
+
+if test "$enable_dhcpv4o6" = "yes"; then
+ DHCP_VERSIONS="DHCPv4, DHCPv6 and DHCPv4-over-DHCPv6"
+elif test "$enable_dhcpv6" != "no"; then
+ DHCP_VERSIONS="DHCPv4 and DHCPv6"
+else
+ DHCP_VERSIONS="DHCPv4"
+fi
+
+cat > config.report << END
+
+ ISC DHCP source configure results:
+ -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+Package:
+ Name: $PACKAGE_NAME
+ Version: $PACKAGE_VERSION
+
+C Compiler: $CC
+
+Flags:
+ DEFS: $DEFS
+ CFLAGS: $CFLAGS
+
+DHCP versions: $DHCP_VERSIONS
+
+Features:
+ debug: $enable_debug
+ failover: $enable_failover
+ execute: $enable_execute
+ binary-leases: $enable_binary_leases
+ dhcpv6: $enable_dhcpv6
+ delayed-ack: $enable_delayed_ack
+
+Developer:
+ ATF unittests : $atf_path
+
+END
+# TODO: Add Perl system tests
+
+if test "$atf_path" != "no"
+then
+echo "ATF_CFLAGS : $ATF_CFLAGS" >> config.report
+echo "ATF_LDFLAGS : $ATF_LDFLAGS" >> config.report
+echo "ATF_BIN : $ATF_BIN" >> config.report
+echo
+fi
+
+cat config.report
+
+echo
+echo Now you can type "make" to build ISC DHCP
+echo
diff --git a/dhcpctl/.gitignore b/dhcpctl/.gitignore
index 29683461..a8d68013 100644
--- a/dhcpctl/.gitignore
+++ b/dhcpctl/.gitignore
@@ -1 +1,2 @@
libdhcpctl.a
+libdhcpctl.la
diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
index 398f1e9d..0d669715 100644
--- a/dhcpctl/Makefile.am
+++ b/dhcpctl/Makefile.am
@@ -1,3 +1,8 @@
+BINDLIBIRSDIR=@BINDLIBIRSDIR@
+BINDLIBDNSDIR=@BINDLIBDNSDIR@
+BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@
+BINDLIBISCDIR=@BINDLIBISCDIR@
+
bin_PROGRAMS = omshell
lib_LIBRARIES = libdhcpctl.a
noinst_PROGRAMS = cltest
@@ -6,16 +11,16 @@ EXTRA_DIST = $(man_MANS)
omshell_SOURCES = omshell.c
omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+ $(BINDLIBIRSDIR)/libirs.a \
+ $(BINDLIBDNSDIR)/libdns.a \
+ $(BINDLIBISCCFGDIR)/libisccfg.a \
+ $(BINDLIBISCDIR)/libisc.a
libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
cltest_SOURCES = cltest.c
cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+ $(BINDLIBIRSDIR)/libirs.a \
+ $(BINDLIBDNSDIR)/libdns.a \
+ $(BINDLIBISCCFGDIR)/libisccfg.a \
+ $(BINDLIBISCDIR)/libisc.a
diff --git a/dhcpctl/Makefile.am.in b/dhcpctl/Makefile.am.in
new file mode 100644
index 00000000..0d77ffc6
--- /dev/null
+++ b/dhcpctl/Makefile.am.in
@@ -0,0 +1,26 @@
+BINDLIBIRSDIR=@Q@BINDLIBIRSDIR@Q@
+BINDLIBDNSDIR=@Q@BINDLIBDNSDIR@Q@
+BINDLIBISCCFGDIR=@Q@BINDLIBISCCFGDIR@Q@
+BINDLIBISCDIR=@Q@BINDLIBISCDIR@Q@
+
+bin_PROGRAMS = omshell
+lib_@DHLIBS@ = libdhcpctl.@A@
+noinst_PROGRAMS = cltest
+man_MANS = omshell.1 dhcpctl.3
+EXTRA_DIST = $(man_MANS)
+
+omshell_SOURCES = omshell.c
+omshell_LDADD = libdhcpctl.@A@ ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
+ $(BINDLIBIRSDIR)/libirs.@A@ \
+ $(BINDLIBDNSDIR)/libdns.@A@ \
+ $(BINDLIBISCCFGDIR)/libisccfg.@A@ \
+ $(BINDLIBISCDIR)/libisc.@A@
+
+libdhcpctl_@A@_SOURCES = dhcpctl.c callback.c remote.c
+
+cltest_SOURCES = cltest.c
+cltest_LDADD = libdhcpctl.@A@ ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
+ $(BINDLIBIRSDIR)/libirs.@A@ \
+ $(BINDLIBDNSDIR)/libdns.@A@ \
+ $(BINDLIBISCCFGDIR)/libisccfg.@A@ \
+ $(BINDLIBISCDIR)/libisc.@A@
diff --git a/dhcpctl/Makefile.in b/dhcpctl/Makefile.in
index 8f86da9f..a4781a10 100644
--- a/dhcpctl/Makefile.in
+++ b/dhcpctl/Makefile.in
@@ -99,7 +99,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/includes/config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = Makefile.am
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@@ -145,15 +145,15 @@ PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am_cltest_OBJECTS = cltest.$(OBJEXT)
cltest_OBJECTS = $(am_cltest_OBJECTS)
cltest_DEPENDENCIES = libdhcpctl.a ../common/libdhcp.a \
- ../omapip/libomapi.a @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+ ../omapip/libomapi.a $(BINDLIBIRSDIR)/libirs.a \
+ $(BINDLIBDNSDIR)/libdns.a $(BINDLIBISCCFGDIR)/libisccfg.a \
+ $(BINDLIBISCDIR)/libisc.a
am_omshell_OBJECTS = omshell.$(OBJEXT)
omshell_OBJECTS = $(am_omshell_OBJECTS)
omshell_DEPENDENCIES = libdhcpctl.a ../common/libdhcp.a \
- ../omapip/libomapi.a @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+ ../omapip/libomapi.a $(BINDLIBIRSDIR)/libirs.a \
+ $(BINDLIBDNSDIR)/libdns.a $(BINDLIBISCCFGDIR)/libisccfg.a \
+ $(BINDLIBISCDIR)/libisc.a
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -213,8 +213,10 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+am__DIST_COMMON = $(srcdir)/Makefile.am.in $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -233,6 +235,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -243,8 +246,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -274,6 +279,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -337,18 +343,18 @@ man_MANS = omshell.1 dhcpctl.3
EXTRA_DIST = $(man_MANS)
omshell_SOURCES = omshell.c
omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+ $(BINDLIBIRSDIR)/libirs.a \
+ $(BINDLIBDNSDIR)/libdns.a \
+ $(BINDLIBISCCFGDIR)/libisccfg.a \
+ $(BINDLIBISCDIR)/libisc.a
libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
cltest_SOURCES = cltest.c
cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+ $(BINDLIBIRSDIR)/libirs.a \
+ $(BINDLIBDNSDIR)/libdns.a \
+ $(BINDLIBISCCFGDIR)/libisccfg.a \
+ $(BINDLIBISCDIR)/libisc.a
all: all-am
@@ -383,6 +389,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+Makefile.am: $(top_builddir)/config.status $(srcdir)/Makefile.am.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
diff --git a/dhcpctl/cltest.c b/dhcpctl/cltest.c
index ffd4152d..8a671dc9 100644
--- a/dhcpctl/cltest.c
+++ b/dhcpctl/cltest.c
@@ -38,6 +38,36 @@
#include <stdarg.h>
#include "omapip/result.h"
#include "dhcpctl.h"
+#include "dhcpd.h"
+
+/* Fixups */
+isc_result_t find_class (struct class **c, const char *n, const char *f, int l)
+{
+ return 0;
+}
+int parse_allow_deny (struct option_cache **oc, struct parse *cfile, int flag)
+{
+ return 0;
+}
+void dhcp (struct packet *packet) { }
+void bootp (struct packet *packet) { }
+
+#ifdef DHCPv6
+/* XXX: should we warn or something here? */
+void dhcpv6(struct packet *packet) { }
+#endif /* DHCPv6 */
+
+int check_collection (struct packet *p, struct lease *l, struct collection *c)
+{
+ return 0;
+}
+void classify (struct packet *packet, struct class *class) { }
+
+isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
+ control_object_state_t newstate)
+{
+ return ISC_R_SUCCESS;
+}
int main (int, char **);
diff --git a/includes/.gitignore b/includes/.gitignore
index 0e56cf2f..35a92e08 100644
--- a/includes/.gitignore
+++ b/includes/.gitignore
@@ -1 +1,2 @@
+*~
config.h
diff --git a/includes/Makefile.in b/includes/Makefile.in
index ab2bf68b..d28906a1 100644
--- a/includes/Makefile.in
+++ b/includes/Makefile.in
@@ -169,6 +169,7 @@ ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -187,6 +188,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -197,8 +199,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -228,6 +232,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
index a16b80db..ef42f21d 100644
--- a/includes/dhcpd.h
+++ b/includes/dhcpd.h
@@ -3169,10 +3169,10 @@ int inet_aton (const char *, struct in_addr *);
/* class.c */
extern int have_billing_classes;
-struct class unknown_class;
-struct class known_class;
-struct collection default_collection;
-struct collection *collections;
+extern struct class unknown_class;
+extern struct class known_class;
+extern struct collection default_collection;
+extern struct collection *collections;
extern struct executable_statement *default_classification_rules;
void classification_setup (void);
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644
index 00000000..0f4126cd
--- /dev/null
+++ b/m4/.gitignore
@@ -0,0 +1 @@
+*.m4
diff --git a/minires/OBSOLETE b/minires/OBSOLETE
new file mode 100644
index 00000000..3846c6d3
--- /dev/null
+++ b/minires/OBSOLETE
@@ -0,0 +1 @@
+This library is obsolete
diff --git a/omapip/.gitignore b/omapip/.gitignore
index 280dddc3..15a3e761 100644
--- a/omapip/.gitignore
+++ b/omapip/.gitignore
@@ -1 +1,2 @@
libomapi.a
+libomapi.la
diff --git a/omapip/Makefile.am b/omapip/Makefile.am
index e5fd4479..5b615819 100644
--- a/omapip/Makefile.am
+++ b/omapip/Makefile.am
@@ -1,17 +1,22 @@
+BINDLIBIRSDIR=@BINDLIBIRSDIR@
+BINDLIBDNSDIR=@BINDLIBDNSDIR@
+BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@
+BINDLIBISCDIR=@BINDLIBISCDIR@
+
lib_LIBRARIES = libomapi.a
noinst_PROGRAMS = svtest
libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
- errwarn.c listener.c dispatch.c generic.c support.c \
- handle.c message.c convert.c hash.c auth.c inet_addr.c \
- array.c trace.c toisc.c iscprint.c isclib.c
+ errwarn.c listener.c dispatch.c generic.c support.c \
+ handle.c message.c convert.c hash.c auth.c inet_addr.c \
+ array.c trace.c toisc.c iscprint.c isclib.c
man_MANS = omapi.3
EXTRA_DIST = $(man_MANS)
svtest_SOURCES = test.c
svtest_LDADD = libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+ $(BINDLIBIRSDIR)/libirs.a \
+ $(BINDLIBDNSDIR)/libdns.a \
+ $(BINDLIBISCCFGDIR)/libisccfg.a \
+ $(BINDLIBISCDIR)/libisc.a
diff --git a/omapip/Makefile.am.in b/omapip/Makefile.am.in
new file mode 100644
index 00000000..067b6661
--- /dev/null
+++ b/omapip/Makefile.am.in
@@ -0,0 +1,22 @@
+BINDLIBIRSDIR=@Q@BINDLIBIRSDIR@Q@
+BINDLIBDNSDIR=@Q@BINDLIBDNSDIR@Q@
+BINDLIBISCCFGDIR=@Q@BINDLIBISCCFGDIR@Q@
+BINDLIBISCDIR=@Q@BINDLIBISCDIR@Q@
+
+lib_@DHLIBS@ = libomapi.@A@
+noinst_PROGRAMS = svtest
+
+libomapi_@A@_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
+ errwarn.c listener.c dispatch.c generic.c support.c \
+ handle.c message.c convert.c hash.c auth.c inet_addr.c \
+ array.c trace.c toisc.c iscprint.c isclib.c
+
+man_MANS = omapi.3
+EXTRA_DIST = $(man_MANS)
+
+svtest_SOURCES = test.c
+svtest_LDADD = libomapi.@A@ \
+ $(BINDLIBIRSDIR)/libirs.@A@ \
+ $(BINDLIBDNSDIR)/libdns.@A@ \
+ $(BINDLIBISCCFGDIR)/libisccfg.@A@ \
+ $(BINDLIBISCDIR)/libisc.@A@
diff --git a/omapip/Makefile.in b/omapip/Makefile.in
index e41c3fcb..3c80afe2 100644
--- a/omapip/Makefile.in
+++ b/omapip/Makefile.in
@@ -98,7 +98,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/includes/config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = Makefile.am
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@@ -148,9 +148,9 @@ libomapi_a_OBJECTS = $(am_libomapi_a_OBJECTS)
PROGRAMS = $(noinst_PROGRAMS)
am_svtest_OBJECTS = test.$(OBJEXT)
svtest_OBJECTS = $(am_svtest_OBJECTS)
-svtest_DEPENDENCIES = libomapi.a @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+svtest_DEPENDENCIES = libomapi.a $(BINDLIBIRSDIR)/libirs.a \
+ $(BINDLIBDNSDIR)/libdns.a $(BINDLIBISCCFGDIR)/libisccfg.a \
+ $(BINDLIBISCDIR)/libisc.a
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -208,8 +208,10 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+am__DIST_COMMON = $(srcdir)/Makefile.am.in $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -228,6 +230,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -238,8 +241,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -269,6 +274,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -329,18 +335,18 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
lib_LIBRARIES = libomapi.a
libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
- errwarn.c listener.c dispatch.c generic.c support.c \
- handle.c message.c convert.c hash.c auth.c inet_addr.c \
- array.c trace.c toisc.c iscprint.c isclib.c
+ errwarn.c listener.c dispatch.c generic.c support.c \
+ handle.c message.c convert.c hash.c auth.c inet_addr.c \
+ array.c trace.c toisc.c iscprint.c isclib.c
man_MANS = omapi.3
EXTRA_DIST = $(man_MANS)
svtest_SOURCES = test.c
svtest_LDADD = libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+ $(BINDLIBIRSDIR)/libirs.a \
+ $(BINDLIBDNSDIR)/libdns.a \
+ $(BINDLIBISCCFGDIR)/libisccfg.a \
+ $(BINDLIBISCDIR)/libisc.a
all: all-am
@@ -375,6 +381,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+Makefile.am: $(top_builddir)/config.status $(srcdir)/Makefile.am.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
diff --git a/relay/Makefile.am b/relay/Makefile.am
index 0403426e..2ba5979a 100644
--- a/relay/Makefile.am
+++ b/relay/Makefile.am
@@ -2,11 +2,11 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
sbin_PROGRAMS = dhcrelay
dhcrelay_SOURCES = dhcrelay.c
-dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+dhcrelay_LDADD = ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
+ @BINDLIBIRSDIR@/libirs.@A@ \
+ @BINDLIBDNSDIR@/libdns.@A@ \
+ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+ @BINDLIBISCDIR@/libisc.@A@
man_MANS = dhcrelay.8
EXTRA_DIST = $(man_MANS)
diff --git a/relay/Makefile.in b/relay/Makefile.in
index aa6cd577..09dbe85b 100644
--- a/relay/Makefile.in
+++ b/relay/Makefile.in
@@ -103,9 +103,7 @@ am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"
PROGRAMS = $(sbin_PROGRAMS)
am_dhcrelay_OBJECTS = dhcrelay.$(OBJEXT)
dhcrelay_OBJECTS = $(am_dhcrelay_OBJECTS)
-dhcrelay_DEPENDENCIES = ../common/libdhcp.a ../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a @BINDLIBISCDIR@/libisc.a
+dhcrelay_DEPENDENCIES = ../common/libdhcp.@A@ ../omapip/libomapi.@A@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -192,6 +190,7 @@ ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -210,6 +209,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -220,8 +220,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -251,6 +253,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -311,11 +314,11 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
dhcrelay_SOURCES = dhcrelay.c
-dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
- @BINDLIBIRSDIR@/libirs.a \
- @BINDLIBDNSDIR@/libdns.a \
- @BINDLIBISCCFGDIR@/libisccfg.a \
- @BINDLIBISCDIR@/libisc.a
+dhcrelay_LDADD = ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
+ @BINDLIBIRSDIR@/libirs.@A@ \
+ @BINDLIBDNSDIR@/libdns.@A@ \
+ @BINDLIBISCCFGDIR@/libisccfg.@A@ \
+ @BINDLIBISCDIR@/libisc.@A@
man_MANS = dhcrelay.8
EXTRA_DIST = $(man_MANS)
diff --git a/server/Makefile.am b/server/Makefile.am
index 54feedf7..787efcae 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -4,8 +4,6 @@
# production code. Sadly, we are not there yet.
SUBDIRS = . tests
-BINDLIBDIR = @BINDDIR@/lib
-
AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
dist_sysconf_DATA = dhcpd.conf.example
@@ -15,10 +13,12 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
dhcpv6.c mdb6.c ldap.c ldap_casa.c leasechain.c ldap_krb_helper.c
dhcpd_CFLAGS = $(LDAP_CFLAGS)
-dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
- ../dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \
- $(BINDLIBDIR)/libisc.a $(LDAP_LIBS)
+dhcpd_LDADD = ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
+ ../dhcpctl/libdhcpctl.@A@ \
+ $(BINDLIBIRSDIR)/libirs.@A@ \
+ $(BINDLIBDNSDIR)/libdns.@A@ \
+ $(BINDLIBISCCFGDIR)/libisccfg.@A@ \
+ $(BINDLIBISCDIR)/libisc.@A@ $(LDAP_LIBS)
man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
EXTRA_DIST = $(man_MANS)
diff --git a/server/Makefile.in b/server/Makefile.in
index feac191b..d585d08d 100644
--- a/server/Makefile.in
+++ b/server/Makefile.in
@@ -116,10 +116,10 @@ am_dhcpd_OBJECTS = dhcpd-dhcpd.$(OBJEXT) dhcpd-dhcp.$(OBJEXT) \
dhcpd-ldap_krb_helper.$(OBJEXT)
dhcpd_OBJECTS = $(am_dhcpd_OBJECTS)
am__DEPENDENCIES_1 =
-dhcpd_DEPENDENCIES = ../common/libdhcp.a ../omapip/libomapi.a \
- ../dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \
- $(BINDLIBDIR)/libisc.a $(am__DEPENDENCIES_1)
+dhcpd_DEPENDENCIES = ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
+ ../dhcpctl/libdhcpctl.@A@ $(BINDLIBIRSDIR)/libirs.@A@ \
+ $(BINDLIBDNSDIR)/libdns.@A@ $(BINDLIBISCCFGDIR)/libisccfg.@A@ \
+ $(BINDLIBISCDIR)/libisc.@A@ $(am__DEPENDENCIES_1)
dhcpd_LINK = $(CCLD) $(dhcpd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
@@ -256,6 +256,7 @@ am__relativize = \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -274,6 +275,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -284,8 +286,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -315,6 +319,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -379,7 +384,6 @@ top_srcdir = @top_srcdir@
# directory. That eliminates any discrepancies between tested code and
# production code. Sadly, we are not there yet.
SUBDIRS = . tests
-BINDLIBDIR = @BINDDIR@/lib
AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
dist_sysconf_DATA = dhcpd.conf.example
dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
@@ -387,10 +391,12 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
dhcpv6.c mdb6.c ldap.c ldap_casa.c leasechain.c ldap_krb_helper.c
dhcpd_CFLAGS = $(LDAP_CFLAGS)
-dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
- ../dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \
- $(BINDLIBDIR)/libisc.a $(LDAP_LIBS)
+dhcpd_LDADD = ../common/libdhcp.@A@ ../omapip/libomapi.@A@ \
+ ../dhcpctl/libdhcpctl.@A@ \
+ $(BINDLIBIRSDIR)/libirs.@A@ \
+ $(BINDLIBDNSDIR)/libdns.@A@ \
+ $(BINDLIBISCCFGDIR)/libisccfg.@A@ \
+ $(BINDLIBISCDIR)/libisc.@A@ $(LDAP_LIBS)
man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
EXTRA_DIST = $(man_MANS)
diff --git a/server/class.c b/server/class.c
index 5c1d8e73..628a818a 100644
--- a/server/class.c
+++ b/server/class.c
@@ -29,13 +29,6 @@
#include "dhcpd.h"
-struct collection default_collection = {
- (struct collection *)0,
- "default",
- (struct class *)0,
-};
-
-struct collection *collections = &default_collection;
struct executable_statement *default_classification_rules;
int have_billing_classes;
diff --git a/server/dhcpd.c b/server/dhcpd.c
index a7f0604a..910f374f 100644
--- a/server/dhcpd.c
+++ b/server/dhcpd.c
@@ -57,6 +57,9 @@ uid_t set_uid = 0;
gid_t set_gid = 0;
#endif /* PARANOIA */
+struct class unknown_class;
+struct class known_class;
+
struct iaddr server_identifier;
int server_identifier_matched;
diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
index a87c5e7b..4db492bf 100644
--- a/server/tests/Makefile.am
+++ b/server/tests/Makefile.am
@@ -1,7 +1,5 @@
SUBDIRS = .
-BINDLIBDIR = @BINDDIR@/lib
-
AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes
AM_CPPFLAGS += -I@BINDDIR@/include -I$(top_srcdir)
AM_CPPFLAGS += -DLOCALSTATEDIR='"."'
@@ -19,10 +17,13 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpars.c ../db.c ../class.c \
../ddns.c ../dhcpleasequery.c ../dhcpv6.c ../mdb6.c \
../ldap.c ../ldap_casa.c ../dhcpd.c ../leasechain.c
-DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \
- $(top_builddir)/dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \
- $(BINDLIBDIR)/libisc.a
+DHCPLIBS = $(top_builddir)/common/libdhcp.@A@ \
+ $(top_builddir)/omapip/libomapi.@A@ \
+ $(top_builddir)/dhcpctl/libdhcpctl.@A@ \
+ $(BINDLIBIRSDIR)/libirs.@A@ \
+ $(BINDLIBDNSDIR)/libdns.@A@ \
+ $(BINDLIBISCCFGDIR)/libisccfg.@A@ \
+ $(BINDLIBISCDIR)/libisc.@A@
ATF_TESTS =
if HAVE_ATF
diff --git a/server/tests/Makefile.in b/server/tests/Makefile.in
index b9183899..4fdfed14 100644
--- a/server/tests/Makefile.in
+++ b/server/tests/Makefile.in
@@ -272,6 +272,7 @@ am__relativize = \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -290,6 +291,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -300,8 +302,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -331,6 +335,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -390,7 +395,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = .
-BINDLIBDIR = @BINDDIR@/lib
AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes \
-I@BINDDIR@/include -I$(top_srcdir) -DLOCALSTATEDIR='"."'
EXTRA_DIST = Atffile
@@ -399,10 +403,13 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpars.c ../db.c ../class.c \
../ddns.c ../dhcpleasequery.c ../dhcpv6.c ../mdb6.c \
../ldap.c ../ldap_casa.c ../dhcpd.c ../leasechain.c
-DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \
- $(top_builddir)/dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \
- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \
- $(BINDLIBDIR)/libisc.a
+DHCPLIBS = $(top_builddir)/common/libdhcp.@A@ \
+ $(top_builddir)/omapip/libomapi.@A@ \
+ $(top_builddir)/dhcpctl/libdhcpctl.@A@ \
+ $(BINDLIBIRSDIR)/libirs.@A@ \
+ $(BINDLIBDNSDIR)/libdns.@A@ \
+ $(BINDLIBISCCFGDIR)/libisccfg.@A@ \
+ $(BINDLIBISCDIR)/libisc.@A@
ATF_TESTS = $(am__append_1)
@HAVE_ATF_TRUE@dhcpd_unittests_SOURCES = $(DHCPSRC) simple_unittest.c
diff --git a/tests/Makefile.am.in b/tests/Makefile.am.in
new file mode 100644
index 00000000..1ef67097
--- /dev/null
+++ b/tests/Makefile.am.in
@@ -0,0 +1,33 @@
+EXTRA_DIST = failover/dhcp-1.cf failover/dhcp-2.cf failover/new-failover \
+ DHCPv6/000-badmsgtype.pl \
+ DHCPv6/010-solicit-noclientid.pl \
+ DHCPv6/011-solicit-serverid.pl \
+ DHCPv6/020-advertise-mcast.pl \
+ DHCPv6/030-request-noclientid.pl \
+ DHCPv6/031-request-noserverid.pl \
+ DHCPv6/032-request-badduid.pl \
+ DHCPv6/110-information-request-ia_na.pl \
+ DHCPv6/111-information-request-ia_ta.pl \
+ DHCPv6/112-badduid.pl \
+ DHCPv6/210-solicit-nohost.pl \
+ DHCPv6/211-solicit-opt-in-na.pl \
+ DHCPv6/212-solicit-opt-in-na-norapidcommit.pl \
+ DHCPv6/280-release-nohost.pl \
+ DHCPv6/281-release-bad-address.pl \
+ DHCPv6/282-release-no-address.pl \
+ DHCPv6/283-release.pl \
+ DHCPv6/290-decline-nohost.pl \
+ DHCPv6/291-decline-bad-address.pl \
+ DHCPv6/292-decline-no-address.pl \
+ DHCPv6/293-decline.pl \
+ DHCPv6/README DHCPv6/dhcp_client.pm \
+ DHCPv6/stubcli-opt-in-na.pl DHCPv6/stubcli.pl \
+ DHCPv6/test-a.conf DHCPv6/test-b.conf \
+ HOWTO-unit-test \
+ unit_test_sample.c
+
+AM_CPPFLAGS = -I..
+
+check_@DHLIBS@ = libt_api.@A@
+libt_api_@A@_SOURCES = t_api.c t_api_dhcp.c
+
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 60cd1946..bd505391 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -95,7 +95,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/includes/config.h
-CONFIG_CLEAN_FILES = unittest.sh
+CONFIG_CLEAN_FILES = Makefile.am unittest.sh
CONFIG_CLEAN_VPATH_FILES =
ARFLAGS = cru
AM_V_AR = $(am__v_AR_@AM_V@)
@@ -160,9 +160,10 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
-am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/unittest.sh.in \
- $(top_srcdir)/depcomp
+am__DIST_COMMON = $(srcdir)/Makefile.am.in $(srcdir)/Makefile.in \
+ $(srcdir)/unittest.sh.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+A = @A@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -181,6 +182,7 @@ BINDLIBDNSDIR = @BINDLIBDNSDIR@
BINDLIBIRSDIR = @BINDLIBIRSDIR@
BINDLIBISCCFGDIR = @BINDLIBISCCFGDIR@
BINDLIBISCDIR = @BINDLIBISCDIR@
+BINDLT = @BINDLT@
BINDSRCDIR = @BINDSRCDIR@
BINDSUBDIR = @BINDSUBDIR@
CC = @CC@
@@ -191,8 +193,10 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DHLIBS = @DHLIBS@
DISTCHECK_ATF_CONFIGURE_FLAG = @DISTCHECK_ATF_CONFIGURE_FLAG@
DISTCHECK_LIBBIND_CONFIGURE_FLAG = @DISTCHECK_LIBBIND_CONFIGURE_FLAG@
+DISTCHECK_LIBTOOL_CONFIGURE_FLAG = @DISTCHECK_LIBTOOL_CONFIGURE_FLAG@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -222,6 +226,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+Q = @Q@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -344,6 +349,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+Makefile.am: $(top_builddir)/config.status $(srcdir)/Makefile.am.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
unittest.sh: $(top_builddir)/config.status $(srcdir)/unittest.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
diff --git a/util/Makefile.bind.in b/util/Makefile.bind.in
index e33bae6c..7c7a4a33 100644
--- a/util/Makefile.bind.in
+++ b/util/Makefile.bind.in
@@ -24,13 +24,14 @@ exec_prefix = @exec_prefix@
bindconfig = --without-openssl --without-libxml2 --without-libjson \
--without-gssapi --disable-threads \
--includedir=@includedir@ --libdir=@libdir@ \
- @BINDIOMUX@ @BINDCONFIG@ --enable-full-report
+ @BINDLT@ @BINDIOMUX@ @BINDCONFIG@ --enable-full-report
@BIND_ATF_FALSE@cleandirs = ./lib ./include
@BIND_ATF_TRUE@cleandirs = ./lib ./include ./atf
cleanfiles = ./configure.log ./build.log ./install.log
-bindlibs = isc dns isccfg irs
+# isccfg depends on isccc?!
+bindlibs = isc dns isccc isccfg irs
installdirs = includedir=${binddir}/include libdir=${binddir}/lib
@BIND_ATF_FALSE@all: bind1 bind2
@@ -98,8 +99,6 @@ clean:
@INSTALL_BIND_FALSE@install:
@INSTALL_BIND_TRUE@install: install-bind
-@INSTALL_BIND_FALSE@uninstall:
-@INSTALL_BIND_TRUE@uninstall: uninstall-bind
install-bind: all
@for libdir in ${bindlibs} ; do \
@@ -107,13 +106,7 @@ install-bind: all
$(MAKE) install) ; \
done
-uninstall-bind: all
- @for libdir in ${bindlibs} ; do \
- (cd ${bindsrcdir}/lib/$$libdir ; \
- $(MAKE) uninstall) ; \
- done
-
# Include the following so that this Makefile is happy when the parent
# tries to use them.
-check distdir distclean dvi installcheck:
+check distdir distclean dvi installcheck uninstall:
diff --git a/util/lt.pl b/util/lt.pl
new file mode 100644
index 00000000..eed17fe3
--- /dev/null
+++ b/util/lt.pl
@@ -0,0 +1,133 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2016 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.
+
+# build configure.am with or without libtool stuff
+
+require 5.000;
+use strict;
+
+# general arguments
+
+my @optionlist = ("with", "without", "verbose");
+
+# usage
+
+my $usage = ("Usage: perl lt.pl [with|without] [verbose]\n");
+
+# Parse arguments
+
+my $with = 0;
+my $verbose = 0;
+
+foreach (@ARGV) {
+ if (/^with$/i) {
+ $with = 1;
+ } elsif (/^without$/i) {
+ $with = 0;
+ } elsif (/^verbose$/i) {
+ $verbose = 1;
+ } else {
+ die $usage;
+ }
+}
+
+if ($verbose) {
+ if ($with) {
+ print STDERR "building the with libtool version\n";
+ } else {
+ print STDERR "building the without libtool version\n";
+ }
+}
+
+# Perform
+
+my $line;
+my $state = "top";
+my $directives = 0;
+my $included = 0;
+my $escaped = 0;
+
+foreach $line (<STDIN>) {
+ chomp $line;
+ if ($line =~ /^\@BEGIN WITH LIBTOOL$/) {
+ if ($state eq "top") {
+ $state = "with";
+ } elsif ($state eq "with") {
+ die "got WITH begin in WITH context\n";
+ } elsif ($state eq "without") {
+ die "got WITH begin in WITHOUT context\n";
+ }
+ $directives += 1;
+ next;
+ } elsif ($line =~ /^\@BEGIN WITHOUT LIBTOOL$/) {
+ if ($state eq "top") {
+ $state = "without";
+ } elsif ($state eq "with") {
+ die "got WITHOUT begin in WITH context\n";
+ } elsif ($state eq "without") {
+ die "got WITHOUT begin in WITHOUT context\n";
+ }
+ $directives += 1;
+ next;
+ } elsif ($line =~ /^\@END WITH LIBTOOL$/) {
+ if ($state eq "with") {
+ $state = "top";
+ } elsif ($state eq "top") {
+ die "got WITH end outside context\n";
+ } elsif ($state eq "without") {
+ die "got WITH end in WITHOUT context\n";
+ }
+ $directives += 1;
+ next;
+ } elsif ($line =~ /^\@END WITHOUT LIBTOOL$/) {
+ if ($state eq "without") {
+ $state = "top";
+ } elsif ($state eq "top") {
+ die "got WITHOUT end outside context\n";
+ } elsif ($state eq "with") {
+ die "got WITHOUT end in WITH context\n";
+ }
+ $directives += 1;
+ next;
+ } elsif ($line =~ /^@/) {
+ die "git unknown directive '$line'\n";
+ }
+
+ if ($state eq "with") {
+ if ($with) {
+ $included += 1;
+ } else {
+ $escaped += 1;
+ next;
+ }
+ } elsif ($state eq "without") {
+ if ($with) {
+ $escaped += 1;
+ next;
+ } else {
+ $included += 1;
+ }
+ }
+ print $line. "\n";
+}
+
+if ($verbose) {
+ print STDERR "directives: $directives\n";
+ print STDERR "included: $included\n";
+ print STDERR "escaped: $escaped\n";
+}
+
+exit 0;
diff --git a/util/regen-conf.sh b/util/regen-conf.sh
new file mode 100644
index 00000000..5b0c934d
--- /dev/null
+++ b/util/regen-conf.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Copyright (C) 2016 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.
+
+perl util/lt.pl with < configure.ac-base > configure.ac+lt
+perl util/lt.pl without < configure.ac-base > configure.ac-lt
+cp -p configure.ac-lt configure.ac
+autoconf