Skip to contentSkip to conversation

package/dhcp

PATCH Superseded Doug Kehn 2 participants 9 messages Jan 18, 2016 – Jan 19, 2016

v3 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

Doug Kehn

author
#0 lore raw

v3 cover package/dhcp

This patch series bumps dhcp package version to 4.3.3-P1. This series needed additional consideration due to the embedded bind tar-ball that now exists within the dhcp package.

This series has been tested with an arm-buildroot-linus-gnueabihf toolchain and with an external toolchain (by Ricardo Martincoski).

Patches
0002-dhcp-bind-host-gen.patch
0003-toolchain-ar.patch
have been submitted upstream.

Buildroot thread
http://lists.busybox.net/pipermail/buildroot/2016-January/149079.html
has related information.

Regards,
...doug

---
Changes v2 -> v3
- removed RFC tag
- updated version from 4.3.3 to 4.3.3-P1 (suggested by Richardo)
- external toolchain support (suggested by Richardo)
Changes v1 -> v2
- removed DHCP_PRE_BUILD_HOOKS in favor of patch (suggested by Arnout)
---
Doug Kehn (4):
package/dhcp: bump version to 4.3.3-P1
package/dhcp: add bind configure options for cross compiling package/dhcp: ensure host cc is used for compiling gen package/dhcp: remove hard coded ar referece

 package/dhcp/0001-bind-configure.patch     | 19 ++++++++++
 package/dhcp/0002-dhcp-bind-host-gen.patch | 22 ++++++++++++
 package/dhcp/0003-toolchain-ar.patch       | 58 ++++++++++++++++++++++++++++++
 package/dhcp/dhcp.hash                     |  4 +--
 package/dhcp/dhcp.mk                       | 17 ++++++++-
 5 files changed, 117 insertions(+), 3 deletions(-)
 create mode 100644 package/dhcp/0001-bind-configure.patch
 create mode 100644 package/dhcp/0002-dhcp-bind-host-gen.patch
 create mode 100644 package/dhcp/0003-toolchain-ar.patch
Signature · 1 line
2.7.0
author
#1 lore raw

PATCH v3 1/4 package/dhcp: bump version to 4.3.3-P1

Parallel builds are not supported because the bind libraries must be built first.

The embedded bind configure is called as part of dhcp make instead of dhcp configure. dhcp make environment is expanded to ensure bind configure has the proper information.

The embedded bind tar-ball is extracted after the source so patches can be applied to dhcp and bind before the package is built.

Cc Arnout Vandecappelle <[email protected]>
Cc Ricardo Martincoski <[email protected]>

---
Changes v2 -> v3
- removed RFC tag
- updated version from 4.3.3 to 4.3.3-P1 (suggested by Richardo)
- external toolchain support (suggested by Richardo)
Changes v1 -> v2
- removed DHCP_PRE_BUILD_HOOKS in favor of patch (suggested by Arnout)

---
 package/dhcp/dhcp.hash |  4 ++--
 package/dhcp/dhcp.mk   | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)
package/dhcp/dhcp.hash +2 -2
index 84e3c63..e2bb6d9 100644
@@ -1,2 +1,2 @@
-# 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 ftp://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
package/dhcp/dhcp.mk +16 -1
index c05e694..1bc088e 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-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
@@ -25,6 +25,21 @@ DHCP_CONF_OPTS = \
 	--with-relay-pid-file=/var/run/dhcrelay.pid \
 	--with-relay6-pid-file=/var/run/dhcrelay6.pid
 
+DHCP_MAKE=$(MAKE1)
+
+# Embedded bind configure is called as part of dhcp make instead of dhcp
+# configure. Pass configure env to make so bind configure has what it needs.
+DHCP_MAKE_ENV = \
+	$(TARGET_CONFIGURE_OPTS) \
+	GNU_TARGET_NAME=$(GNU_TARGET_NAME) \
+	GNU_HOST_NAME=$(GNU_HOST_NAME) \
+	BUILD_CC="$(HOSTCC)"
+
+define DHCP_EXTRACT_BIND
+	cd $(@D)/bind; tar -xvf bind.tar.gz
+endef
+DHCP_POST_EXTRACT_HOOKS += DHCP_EXTRACT_BIND
+
 ifeq ($(BR2_PACKAGE_DHCP_SERVER_DELAYED_ACK),y)
 DHCP_CONF_OPTS += --enable-delayed-ack
 endif
Signature · 1 line
2.7.0
#2 lore raw

PATCH v3 1/4 package/dhcp: bump version to 4.3.3-P1

Hi Doug,

Generic feedback on this series: it should be a single patch. The package will not build for some configurations that currently work if you apply just patch 1, so we would end up with a non-bisectable situation. We want patches to be split up into single-function pieces, but at the same time we want to maintain "correctness" after each individual patch.

Quoted 2 lines · Doug Kehn

Parallel builds are not supported because the bind libraries must be built first.

That could maybe be worked around by building the bind libraries explicitly in
a PRE_BUILD_HOOK. But that's something that can be done in a follow-up patch.

Quoted 4 lines

The embedded bind configure is called as part of dhcp make instead of dhcp configure. dhcp make environment is expanded to ensure bind configure has the proper information.

You wrote earlier that it also worked if we explicitly configure in a
POST_CONFIGURE_HOOK, didn't you? That would be better because then we can control the bind configure as well, see my comments in 0001-bind-configure.patch

Quoted 42 lines

The embedded bind tar-ball is extracted after the source so patches can be applied to dhcp and bind before the package is built.

Cc Arnout Vandecappelle <[email protected]>
Cc Ricardo Martincoski <[email protected]>

---
Changes v2 -> v3
- removed RFC tag
- updated version from 4.3.3 to 4.3.3-P1 (suggested by Richardo)
- external toolchain support (suggested by Richardo)
Changes v1 -> v2
- removed DHCP_PRE_BUILD_HOOKS in favor of patch (suggested by Arnout)

---
 package/dhcp/dhcp.hash |  4 ++--
 package/dhcp/dhcp.mk   | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)
package/dhcp/dhcp.hash +2 -2
index 84e3c63..e2bb6d9 100644
@@ -1,2 +1,2 @@
-# 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 ftp://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
package/dhcp/dhcp.mk +1 -1
index c05e694..1bc088e 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-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

package/dhcp/dhcp.mk DHCP_CONF_OPTS = \ · line 31

Quoted 7 lines
package/dhcp/dhcp.mk +4 -0
@@ -25,6 +25,21 @@ DHCP_CONF_OPTS = \
 	--with-relay-pid-file=/var/run/dhcrelay.pid \
 	--with-relay6-pid-file=/var/run/dhcrelay6.pid
 
+DHCP_MAKE=$(MAKE1)
+
+# Embedded bind configure is called as part of dhcp make instead of dhcp
+# configure. Pass configure env to make so bind configure has what it needs.

So this wouldn't be needed with a POST_CONFIGURE_HOOK, right?

Regards,
Arnout

Quoted 15 lines
package/dhcp/dhcp.mk +11 -0
+DHCP_MAKE_ENV = \
+	$(TARGET_CONFIGURE_OPTS) \
+	GNU_TARGET_NAME=$(GNU_TARGET_NAME) \
+	GNU_HOST_NAME=$(GNU_HOST_NAME) \
+	BUILD_CC="$(HOSTCC)"
+
+define DHCP_EXTRACT_BIND
+	cd $(@D)/bind; tar -xvf bind.tar.gz
+endef
+DHCP_POST_EXTRACT_HOOKS += DHCP_EXTRACT_BIND
+
 ifeq ($(BR2_PACKAGE_DHCP_SERVER_DELAYED_ACK),y)
 DHCP_CONF_OPTS += --enable-delayed-ack
 endif
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH v3 1/4 package/dhcp: bump version to 4.3.3-P1

Hi Arnout,

Quoted 7 lines · Arnout Vandecappelle

Hi Doug,

Generic feedback on this series: it should be a single patch. The package will not build for some configurations that currently work if you apply just patch 1, so we would end up with a non-bisectable situation. We want patches to be split up into single-function pieces, but at the same time we want to maintain "correctness" after each individual patch.

Okay, I wasn't sure which would be better. I will resubmit as single patch.

Quoted 9 lines · Doug Kehn
Quoted 2 lines

Parallel builds are not supported because the bind libraries must be built first.

That could maybe be worked around by building the bind libraries explicitly in
a PRE_BUILD_HOOK. But that's something that can be done in a follow-up patch.

Digging further, it's bind that needs -j1. A PRE_BUILD_HOOK can be added for bind that uses $(MAKE1). If a PRE_BUILD_HOOK is added, then bind potentially ends up with a POST_CONFIGURE_HOOK (see below) and a PRE_BUILD_HOOK.

Since I'm resubmitting the patch, it's not that big of a deal to add a PRE_BUILD_HOOK to prevent all of dhcp being built with -j1. Which do you prefer?

Quoted 8 lines
Quoted 4 lines

The embedded bind configure is called as part of dhcp make instead of dhcp configure. dhcp make environment is expanded to ensure bind configure has the proper information.

You wrote earlier that it also worked if we explicitly configure in a
POST_CONFIGURE_HOOK, didn't you? That would be better because then we can control the bind configure as well, see my comments in 0001-bind-configure.patch

It's not an explicit call to bind's configure. dhcp configure creates a bind Makefile. This Makefile is called from dhcp make to un-tar, configure, and make the embedded bind source. The bind Makefile created by dhcp configure contains configure options for bind's configure. For a POST_CONFIGURE_HOOK, it would be better to call:
$(DHCP_BIND_CONF_ENV) $(DHCP_MAKE) -C $(@D)/bind bind1
as suggested by Ricardo. The bind1 target is responsible for configuring bind.

As mentioned in response to 0001-bind-configure.patch, bind configure options can be controlled with dhcp configure BINDCONFIG variable.

I'll resubmit the patch with POST_CONFIGURE_HOOK.

Quoted 45 lines
Quoted 45 lines

The embedded bind tar-ball is extracted after the source so patches can be applied to dhcp and bind before the package is built.

Cc Arnout Vandecappelle <[email protected]>
Cc Ricardo Martincoski <[email protected]>

---
Changes v2 -> v3
- removed RFC tag
- updated version from 4.3.3 to 4.3.3-P1 (suggested by Richardo)
- external toolchain support (suggested by Richardo)
Changes v1 -> v2
- removed DHCP_PRE_BUILD_HOOKS in favor of patch (suggested by Arnout)

---
 package/dhcp/dhcp.hash |  4 ++--
 package/dhcp/dhcp.mk   | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)
package/dhcp/dhcp.hash +2 -2
index 84e3c63..e2bb6d9 100644
@@ -1,2 +1,2 @@
-# 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 ftp://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
package/dhcp/dhcp.mk +1 -1
index c05e694..1bc088e 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-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
@@ -25,6 +25,21 @@ DHCP_CONF_OPTS = \
 	--with-relay-pid-file=/var/run/dhcrelay.pid \
 	--with-relay6-pid-file=/var/run/dhcrelay6.pid
 
Quoted 6 lines

package/dhcp/dhcp.mk DHCP_CONF_OPTS = \ · line 31

Quoted 4 lines
package/dhcp/dhcp.mk +4 -0
+DHCP_MAKE=$(MAKE1)
+
+# Embedded bind configure is called as part of dhcp make instead of dhcp
+# configure. Pass configure env to make so bind configure has what it needs.

So this wouldn't be needed with a POST_CONFIGURE_HOOK, right?

Yes, it is still needed. However, it would change from DHCP_MAKE_ENV to DHCP_BIND_CONF_ENV.

I've attached an example dhcp.mk based on the discussion here. Hopefully, it will help add clarity to the discussion.

Thanks,
...doug
-------------- next part --------------
################################################################################
#

# dhcp
#
################################################################################

DHCP_VERSION = 4.3.3-P1
DHCP_SITE = http://ftp.isc.org/isc/dhcp/$(DHCP_VERSION)
DHCP_INSTALL_STAGING = YES
DHCP_LICENSE = ISC
DHCP_LICENSE_FILES = LICENSE

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 \
	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-cli-lease-file=/var/lib/dhcp/dhclient.leases \
	--with-cli6-lease-file=/var/lib/dhcp/dhclient6.leases \
	--with-srv-pid-file=/var/run/dhcpd.pid \
	--with-srv6-pid-file=/var/run/dhcpd6.pid \
	--with-cli-pid-file=/var/run/dhclient.pid \
	--with-cli6-pid-file=/var/run/dhclient6.pid \
	--with-relay-pid-file=/var/run/dhcrelay.pid \
	--with-relay6-pid-file=/var/run/dhcrelay6.pid

define DHCP_EXTRACT_BIND

	cd $(@D)/bind; tar -xvf bind.tar.gz

endef
DHCP_POST_EXTRACT_HOOKS += DHCP_EXTRACT_BIND

DHCP_BIND_CONF_ENV = \
	$(TARGET_CONFIGURE_OPTS) \
	BUILD_CC="$(HOSTCC)"

define DHCP_BIND_CONFIGURE

	$(DHCP_BIND_CONF_ENV) $(MAKE1) -C $(@D)/bind bind1

endef
DHCP_POST_CONFIGURE_HOOKS += DHCP_BIND_CONFIGURE

define DHCP_BIND_MAKE

	$(DHCP_MAKE_ENV) $(MAKE1) -C $(@D)/bind

endef
DHCP_PRE_BUILD_HOOKS += DHCP_BIND_MAKE

ifeq ($(BR2_PACKAGE_DHCP_SERVER_DELAYED_ACK),y)
DHCP_CONF_OPTS += --enable-delayed-ack
endif

ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
define DHCP_INSTALL_SERVER

	mkdir -p $(TARGET_DIR)/var/lib
	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
	$(INSTALL) -m 0755 -D $(@D)/server/dhcpd $(TARGET_DIR)/usr/sbin/dhcpd
	$(INSTALL) -m 0644 -D package/dhcp/dhcpd.conf \
		$(TARGET_DIR)/etc/dhcp/dhcpd.conf

endef
endif

ifeq ($(BR2_PACKAGE_DHCP_RELAY),y)
define DHCP_INSTALL_RELAY

	mkdir -p $(TARGET_DIR)/var/lib
	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
	$(INSTALL) -m 0755 -D $(DHCP_DIR)/relay/dhcrelay \
		$(TARGET_DIR)/usr/sbin/dhcrelay

endef
endif

ifeq ($(BR2_PACKAGE_DHCP_CLIENT),y)
define DHCP_INSTALL_CLIENT

	mkdir -p $(TARGET_DIR)/var/lib
	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
	$(INSTALL) -m 0755 -D $(DHCP_DIR)/client/dhclient \
		$(TARGET_DIR)/sbin/dhclient
	$(INSTALL) -m 0644 -D package/dhcp/dhclient.conf \
		$(TARGET_DIR)/etc/dhcp/dhclient.conf
	$(INSTALL) -m 0755 -D package/dhcp/dhclient-script \
		$(TARGET_DIR)/sbin/dhclient-script

endef
endif

# Options don't matter, scripts won't start if binaries aren't there define DHCP_INSTALL_INIT_SYSV

	$(INSTALL) -m 0755 -D package/dhcp/S80dhcp-server \
		$(TARGET_DIR)/etc/init.d/S80dhcp-server
	$(INSTALL) -m 0755 -D package/dhcp/S80dhcp-relay \
		$(TARGET_DIR)/etc/init.d/S80dhcp-relay

endef

ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
define DHCP_INSTALL_INIT_SYSTEMD

	$(INSTALL) -D -m 644 package/dhcp/dhcpd.service \
		$(TARGET_DIR)/usr/lib/systemd/system/dhcpd.service

	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants

	ln -sf ../../../../usr/lib/systemd/system/dhcpd.service \
		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/dhcpd.service

	echo "d /var/lib/dhcp 0755 - - - -" > \
		$(TARGET_DIR)/usr/lib/tmpfiles.d/dhcpd.conf
	echo "f /var/lib/dhcp/dhcpd.leases - - - - -" >> \
		$(TARGET_DIR)/usr/lib/tmpfiles.d/dhcpd.conf

endef
endif

define DHCP_INSTALL_TARGET_CMDS

	$(DHCP_INSTALL_RELAY)
	$(DHCP_INSTALL_SERVER)
	$(DHCP_INSTALL_CLIENT)

endef

$(eval $(autotools-package))

author
#4 lore raw

PATCH v3 2/4 package/dhcp: add bind configure options for cross compiling

In reply to Doug Kehn

---
Changes v2 -> v3
- removed RFC tag
Changes v1 -> v2
- no changes

---
 package/dhcp/0001-bind-configure.patch | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 package/dhcp/0001-bind-configure.patch
package/dhcp/0001-bind-configure.patch new file +19 -0
new file mode 100644
index 0000000..9a38f45
@@ -0,0 +1,19 @@
+add bind configure options for cross compiling
+
+Signed-off-by: Doug Kehn <[email protected]>
+
+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=$(GNU_TARGET_NAME) --host=$(GNU_TARGET_NAME) \
++	--build=$(GNU_HOST_NAME) --with-randomdev=/dev/urandom
+ 
+ @BIND_ATF_FALSE at cleandirs = ./lib ./include
+ @BIND_ATF_TRUE at cleandirs = ./lib ./include ./atf
Signature · 1 line
2.7.0
#5 lore raw

PATCH v3 2/4 package/dhcp: add bind configure options for cross compiling

Quoted 23 lines · Doug Kehn

---
Changes v2 -> v3
- removed RFC tag
Changes v1 -> v2
- no changes

---
 package/dhcp/0001-bind-configure.patch | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 package/dhcp/0001-bind-configure.patch
package/dhcp/0001-bind-configure.patch new file +6 -0
new file mode 100644
index 0000000..9a38f45
@@ -0,0 +1,19 @@
+add bind configure options for cross compiling
+
+Signed-off-by: Doug Kehn <[email protected]>
+
+Index: dhcp-4.3.3-P1/bind/Makefile.in
+===================================================================

package/dhcp/0001-bind-configure.patch line 16

Quoted 10 lines
package/dhcp/0001-bind-configure.patch new file +10 -0
+--- 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=$(GNU_TARGET_NAME) --host=$(GNU_TARGET_NAME) \
++	--build=$(GNU_HOST_NAME) --with-randomdev=/dev/urandom

I think the --target, --host and --build parts are upstreamable.

However, the --with-randomdev certainly is not upstreamable in its current
form. It should probably use ac_cv_file__dev_random to decide.

BTW we have a bit of an inconsistency here: in dhcp, we choose /dev/random but
in bind we choose /dev/urandom.

Note that if we call configure explicitly in a POST_CONFIGURE_HOOK, then this
patch is not needed (although the --target, --host, --build stuff is of course still interesting to improve its cross-compilation support).

Regards,
Arnout

Quoted 4 lines
package/dhcp/0001-bind-configure.patch new file +3 -0
+ 
+ @BIND_ATF_FALSE at cleandirs = ./lib ./include
+ @BIND_ATF_TRUE at cleandirs = ./lib ./include ./atf
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#6 lore raw

PATCH v3 2/4 package/dhcp: add bind configure options for cross compiling

Hi Arnout,

Quoted 28 lines · Arnout Vandecappelle
Quoted 27 lines · Doug Kehn

---
Changes v2 -> v3
- removed RFC tag
Changes v1 -> v2
- no changes

---
 package/dhcp/0001-bind-configure.patch | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 package/dhcp/0001-bind-configure.patch
package/dhcp/0001-bind-configure.patch new file +10 -0
new file mode 100644
index 0000000..9a38f45
@@ -0,0 +1,19 @@
+add bind configure options for cross compiling
+
+Signed-off-by: Doug Kehn <[email protected]>
+
+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 \
Quoted 8 lines

package/dhcp/0001-bind-configure.patch line 16

Quoted 6 lines
package/dhcp/0001-bind-configure.patch new file +6 -0
+ 	--with-gssapi=no --enable-threads=no @BINDCONFIG@ \
+ 	--with-export-includedir=${binddir}/include \
+-	--with-export-libdir=${binddir}/lib
++	--with-export-libdir=${binddir}/lib \
++	--target=$(GNU_TARGET_NAME) --host=$(GNU_TARGET_NAME) \
++	--build=$(GNU_HOST_NAME) --with-randomdev=/dev/urandom

I think the --target, --host and --build parts are upstreamable.

Agree. I figured out that changing this to '--target=@target_alias@ --host=@host_alias@ --build=@build_alias@' is much cleaner. I will clean this patch up.

Quoted 3 lines

However, the --with-randomdev certainly is not upstreamable in its current
form. It should probably use ac_cv_file__dev_random to decide.

Agree. dhcp configure has a BINDCONFIG environment variable that can be used to set this (e.g. BINDCONFIG='--with-randomdev=/dev/random). However, dhcp configure has BINDCONFIG hardcoded. An upstreamable patch to dhcp configure resolves this.

Quoted 3 lines

BTW we have a bit of an inconsistency here: in dhcp, we choose /dev/random but
in bind we choose /dev/urandom.

Thanks.

Quoted 4 lines

Note that if we call configure explicitly in a POST_CONFIGURE_HOOK, then this
patch is not needed (although the --target, --host, --build stuff is of course still interesting to improve its cross-compilation support).

I don't think it is a good idea to call bind configure directly since bind Makefile, which calls bind configure, has bind specific configure parameters. Do you agree?

Regards,
...doug

author
#7 lore raw

PATCH v3 3/4 package/dhcp: ensure host cc is used for compiling gen

In reply to Doug Kehn

This patch has been submitted upstream.

---
Changes v2 -> v3
- removed RFC tag
Changes v1 -> v2
- no changes

---
 package/dhcp/0002-dhcp-bind-host-gen.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 package/dhcp/0002-dhcp-bind-host-gen.patch
package/dhcp/0002-dhcp-bind-host-gen.patch new file +22 -0
new file mode 100644
index 0000000..9db8a06
@@ -0,0 +1,22 @@
+ensure host cc is used for compiling gen
+
+This patch is derived from:
+http://wiki.beyondlogic.org/patches/dhcp-4.3.0b1.bind_arm-linux-gnueabi.patch
+
+Signed-off-by: Doug Kehn <[email protected]>
+
+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. at O@: rbtdb.c
Signature · 1 line
2.7.0
author
#8 lore raw

PATCH v3 4/4 package/dhcp: remove hard coded ar referece

In reply to Doug Kehn

Allow AR to be substituted so toolchain ar will be referenced when cross compiling.

This patch has been submitted upstream.

Cc Arnout Vandecappelle <[email protected]>

---
Changes v2 -> v3:
- removed RFC tag
Changes v1 -> v2:
- new for v2 (suggested by Arnout)

---
 package/dhcp/0003-toolchain-ar.patch | 58 ++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 package/dhcp/0003-toolchain-ar.patch
package/dhcp/0003-toolchain-ar.patch new file +58 -0
new file mode 100644
index 0000000..17ad9c3
@@ -0,0 +1,58 @@
+remove hard coded ar reference
+
+Allow AR to be substituted so toolchain ar can be referenced when cross
+compiling.
+
+Signed-off-by: Doug Kehn <[email protected]>
+
+Index: dhcp-4.3.3-P1/common/Makefile.in
+===================================================================
+--- dhcp-4.3.3-P1.orig/common/Makefile.in
++++ dhcp-4.3.3-P1/common/Makefile.in
+@@ -99,7 +99,7 @@ CONFIG_HEADER = $(top_builddir)/includes
+ CONFIG_CLEAN_FILES =
+ CONFIG_CLEAN_VPATH_FILES =
+ LIBRARIES = $(noinst_LIBRARIES)
+-AR = ar
++AR = @AR@
+ ARFLAGS = cru
+ AM_V_AR = $(am__v_AR_ at AM_V@)
+ am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
+Index: dhcp-4.3.3-P1/configure
+===================================================================
+--- dhcp-4.3.3-P1.orig/configure
++++ dhcp-4.3.3-P1/configure
+@@ -658,6 +658,7 @@ CPPFLAGS
+ LDFLAGS
+ CFLAGS
+ CC
++AR
+ host_os
+ host_vendor
+ host_cpu
+Index: dhcp-4.3.3-P1/dhcpctl/Makefile.in
+===================================================================
+--- dhcp-4.3.3-P1.orig/dhcpctl/Makefile.in
++++ dhcp-4.3.3-P1/dhcpctl/Makefile.in
+@@ -131,7 +131,7 @@ am__uninstall_files_from_dir = { \
+ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
+ 	"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)"
+ LIBRARIES = $(lib_LIBRARIES)
+-AR = ar
++AR = @AR@
+ ARFLAGS = cru
+ AM_V_AR = $(am__v_AR_ at AM_V@)
+ am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
+Index: dhcp-4.3.3-P1/omapip/Makefile.in
+===================================================================
+--- dhcp-4.3.3-P1.orig/omapip/Makefile.in
++++ dhcp-4.3.3-P1/omapip/Makefile.in
+@@ -129,7 +129,7 @@ am__uninstall_files_from_dir = { \
+   }
+ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)"
+ LIBRARIES = $(lib_LIBRARIES)
+-AR = ar
++AR = @AR@
+ ARFLAGS = cru
+ AM_V_AR = $(am__v_AR_ at AM_V@)
+ am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
Signature · 1 line
2.7.0