--- /dev/null
+dhcp cross compile support integration
+
+Allow BINDCONFIG to be initialized in environment passed to configure.
+
+Allow archiver to be determined during configure.
+
+This patch is submitted upstream as part of a cross compiling enhancement
+suggestion to dhcp-suggest@isc.org. Reference ISC-Bugs #41502.
+
+Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
+
+Index: dhcp-4.3.3-P1/configure.ac
+===================================================================
+--- dhcp-4.3.3-P1.orig/configure.ac
++++ dhcp-4.3.3-P1/configure.ac
+@@ -33,7 +33,7 @@ if test "$GCC" = "yes"; then
+ fi
+
+ # We can have some flags to pass to bind configure
+-BINDCONFIG=
++BINDCONFIG="$BINDCONFIG"
+ AC_SUBST(BINDCONFIG)
+
+ # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
+@@ -43,6 +43,9 @@ AC_SUBST(BINDCONFIG)
+ # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+ AC_USE_SYSTEM_EXTENSIONS
+
++AC_CHECK_TOOL(AR,ar)
++AC_SUBST(AR)
++
+ AC_PROG_RANLIB
+ AC_CONFIG_HEADERS([includes/config.h])
+
--- /dev/null
+bind cross compile support integration
+
+Pass system types from dhcp configure to bind configure.
+
+This patch is submitted upstream as part of a cross compiling enhancement
+suggestion to dhcp-suggest@isc.org. Reference ISC-Bugs #41502.
+
+Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
+
+Index: dhcp-4.3.3-P1/bind/Makefile.in
+===================================================================
+--- dhcp-4.3.3-P1.orig/bind/Makefile.in
++++ dhcp-4.3.3-P1/bind/Makefile.in
+@@ -30,7 +30,9 @@ bindconfig = --disable-kqueue --disable-
+ --without-openssl --without-libxml2 --enable-exportlib \
+ --with-gssapi=no --enable-threads=no @BINDCONFIG@ \
+ --with-export-includedir=${binddir}/include \
+- --with-export-libdir=${binddir}/lib
++ --with-export-libdir=${binddir}/lib \
++ --target=@target_alias@ --host=@host_alias@ \
++ --build=@build_alias@
+
+ @BIND_ATF_FALSE@cleandirs = ./lib ./include
+ @BIND_ATF_TRUE@cleandirs = ./lib ./include ./atf
--- /dev/null
+ensure host compiler is used
+
+dns/Makefile.in patch is derived from:
+http://wiki.beyondlogic.org/patches/dhcp-4.3.0b1.bind_arm-linux-gnueabi.patch
+
+This patch is already accepted upstream and will be included in the next
+release:
+--[snip]--
+From Francis Dupont via RT <dhcp-suggest@isc.org>
+To rdkehn@yahoo.com
+
+Message body
+It was fixed on the master branch sometimes ago.
+Quoting master RELNOTES:
+
+- Made the embedded bind libraries able to be cross compiled
+ (please refer to the bind9 documentation to learn how to cross
+ compile DHCP and its bind library dependency).
+ [ISC-Bugs #38836]
+
+This is in the Changes since 4.3.3 so for the next release.
+--[snip]--
+
+Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
+
+Index: dhcp-4.3.3-P1/bind/bind-9.9.7-P3/lib/export/dns/Makefile.in
+===================================================================
+--- dhcp-4.3.3-P1.orig/bind/bind-9.9.7-P3/lib/export/dns/Makefile.in
++++ dhcp-4.3.3-P1/bind/bind-9.9.7-P3/lib/export/dns/Makefile.in
+@@ -168,7 +168,9 @@ code.h: gen
+ ./gen -s ${srcdir} > code.h
+
+ gen: ${srcdir}/gen.c
+- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
++ ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \
++ ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c \
++ ${BUILD_LIBS}
+
+ #We don't need rbtdb64 for this library
+ #rbtdb64.@O@: rbtdb.c
-# Verified from ftp://ftp.isc.org/isc/dhcp/4.1-ESV-R12/dhcp-4.1-ESV-R12.tar.gz.sha256.asc
-sha256 53265d1bf5e2073379df03c73a1a34d38a904307609c0f9cb77223912e753e5f dhcp-4.1-ESV-R12.tar.gz
+# Verified from https://ftp.isc.org/isc/dhcp/4.3.3-P1/dhcp-4.3.3-P1.tar.gz.sha256.asc
+sha256 c11e896dffa1bfbc49462965d3f6dec45534e34068603546d9a236f2aa669921 dhcp-4.3.3-P1.tar.gz
#
################################################################################
-DHCP_VERSION = 4.1-ESV-R12
+DHCP_VERSION = 4.3.3-P1
DHCP_SITE = http://ftp.isc.org/isc/dhcp/$(DHCP_VERSION)
DHCP_INSTALL_STAGING = YES
DHCP_LICENSE = ISC
DHCP_CONF_ENV = \
CPPFLAGS='-D_PATH_DHCPD_CONF=\"/etc/dhcp/dhcpd.conf\" \
-D_PATH_DHCLIENT_CONF=\"/etc/dhcp/dhclient.conf\"' \
- ac_cv_file__dev_random=yes
+ ac_cv_file__dev_random=yes \
+ BINDCONFIG='--with-randomdev=/dev/random'
DHCP_CONF_OPTS = \
--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
--with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \
--with-relay-pid-file=/var/run/dhcrelay.pid \
--with-relay6-pid-file=/var/run/dhcrelay6.pid
+# The source for the bind libraries used by dhcp are embedded in the dhcp source
+# as a tar-ball. Extract the bind source to allow any patches to be applied
+# during the patch phase.
+define DHCP_EXTRACT_BIND
+ cd $(@D)/bind; tar -xvf bind.tar.gz
+endef
+DHCP_POST_EXTRACT_HOOKS += DHCP_EXTRACT_BIND
+
+# The patchset requires configure et.al. to be regenerated.
+DHCP_AUTORECONF = YES
+
+# bind does not support parallel builds.
+DHCP_MAKE = $(MAKE1)
+
+# bind configure is called via dhcp make instead of dhcp configure. The make env
+# needs extra values for bind configure.
+DHCP_MAKE_ENV = \
+ $(TARGET_CONFIGURE_OPTS) \
+ BUILD_CC="$(HOSTCC)" \
+ BUILD_CFLAGS="$(HOST_CFLAGS)" \
+ BUILD_CPPFLAGS="$(HOST_CPPFLAGS)" \
+ BUILD_LDFLAGS="$(HOST_LDFLAGS)"
+
ifeq ($(BR2_PACKAGE_DHCP_SERVER_DELAYED_ACK),y)
DHCP_CONF_OPTS += --enable-delayed-ack
endif