package/bind: enable static build
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Fri, 26 Apr 2019 16:56:10 +0000 (18:56 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 9 May 2019 19:23:57 +0000 (21:23 +0200)
Static build has been disabled in 2014 with commit
6045904752b06a8b8e52ba8fc2e49a8548964e8d however bind can be built
statically thanks to --without-dlopen so enable it back

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/bind/0002-dlz_open_driver.c-fix-build-without-dlfcn.h.patch [new file with mode: 0644]
package/bind/Config.in
package/bind/bind.mk

diff --git a/package/bind/0002-dlz_open_driver.c-fix-build-without-dlfcn.h.patch b/package/bind/0002-dlz_open_driver.c-fix-build-without-dlfcn.h.patch
new file mode 100644 (file)
index 0000000..8b73e74
--- /dev/null
@@ -0,0 +1,28 @@
+From 92b738a0fe8a7d65346de9e6dd7a8f135ee29765 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 23 Apr 2019 22:45:25 +0200
+Subject: [PATCH] dlz_open_driver.c: fix build without dlfcn.h
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://gitlab.isc.org/isc-projects/bind9/issues/995]
+---
+ bin/named/unix/dlz_dlopen_driver.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/bin/named/unix/dlz_dlopen_driver.c b/bin/named/unix/dlz_dlopen_driver.c
+index 74d29ffa09..ab8a5c9493 100644
+--- a/bin/named/unix/dlz_dlopen_driver.c
++++ b/bin/named/unix/dlz_dlopen_driver.c
+@@ -14,7 +14,9 @@
+ #include <inttypes.h>
+ #include <stdlib.h>
+ #include <string.h>
++#if HAVE_DLFCN_H
+ #include <dlfcn.h>
++#endif
+ #include <dns/log.h>
+ #include <dns/result.h>
+-- 
+2.20.1
+
index 049a90cbafda863c48d73d0e6df40cf480eb7fed..5b34b66f7abc299b9d4f7d3e9804bcabf6fa056c 100644 (file)
@@ -2,7 +2,6 @@ config BR2_PACKAGE_BIND
        bool "bind"
        depends on BR2_USE_MMU # fork()
        depends on BR2_TOOLCHAIN_HAS_THREADS
-       depends on !BR2_STATIC_LIBS
        help
          BIND (Berkeley Internet Name Domain) is an
          implementation of the Domain Name System (DNS) protocols
@@ -41,6 +40,6 @@ config BR2_PACKAGE_BIND_TOOLS
 
 endif
 
-comment "bind needs a toolchain w/ threads, dynamic library"
+comment "bind needs a toolchain w/ threads"
        depends on BR2_USE_MMU
-       depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
index 087ce941b02fd2aec7dbeb6faefc19d48448bf3f..9d1f5a1ecbb5ff4c1a4d0356b5bfbdb562cc3cc8 100644 (file)
@@ -28,7 +28,6 @@ BIND_CONF_OPTS = \
        --with-libjson=no \
        --with-randomdev=/dev/urandom \
        --enable-epoll \
-       --with-libtool \
        --with-gssapi=no \
        --enable-filter-aaaa
 
@@ -54,12 +53,13 @@ BIND_CONF_OPTS += --with-libxml2=no
 endif
 
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
-BIND_DEPENDENCIES += openssl
+BIND_DEPENDENCIES += host-pkgconf openssl
 BIND_CONF_OPTS += \
        --with-openssl=$(STAGING_DIR)/usr \
        --with-ecdsa=yes \
        --with-eddsa=no \
        --with-aes=yes
+BIND_CONF_ENV += LIBS=`$(PKG_CONFIG_HOST_BINARY) --libs openssl`
 # GOST cipher support requires openssl extra engines
 ifeq ($(BR2_PACKAGE_OPENSSL_ENGINES),y)
 BIND_CONF_OPTS += --with-gost=yes
@@ -84,6 +84,16 @@ else
 BIND_CONF_OPTS += --with-readline=no
 endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+BIND_CONF_OPTS += \
+       --without-dlopen \
+       --without-libtool
+else
+BIND_CONF_OPTS += \
+       --with-dlopen \
+       --with-libtool
+endif
+
 define BIND_TARGET_REMOVE_SERVER
        rm -rf $(addprefix $(TARGET_DIR)/usr/sbin/, $(BIND_TARGET_SERVER_SBIN))
 endef