kumquat-buildroot/package/dnsmasq/dnsmasq.mk
Fabrice Fontaine b6a4453bd7 package/dnsmasq: fix dnssec static build
Drop -DHAVE_DNSSEC_STATIC which has been added by commit
e913527b94 but is not needed and raises
the following static build failure because dnsmasq will wrongly append
"-Wl,-Bstatic -lgmp -Wl,-Bdynamic":

/home/buildroot/autobuild/instance-2/output-1/host/bin/x86_64-linux-gcc -static -o dnsmasq cache.o rfc1035.o util.o option.o forward.o network.o dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o pattern.o domain.o dnssec.o blockdata.o tables.o loop.o inotify.o poll.o rrfilter.o edns0.o arp.o crypto.o dump.o ubus.o metrics.o hash-questions.o domain-match.o -Wl,-Bstatic -L/home/buildroot/autobuild/instance-2/output-1/host/bin/../x86_64-buildroot-linux-musl/sysroot/usr/lib -lhogweed -lgmp -lnettle  -Wl,-Bdynamic -Wl,-Bstatic -lgmp -Wl,-Bdynamic
/home/buildroot/autobuild/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/10.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: attempted static link of dynamic object `/home/buildroot/autobuild/instance-2/output-1/host/x86_64-buildroot-linux-musl/sysroot/lib/../lib64/libc.so'

Strangely enough, this is the first time this build failure is raised by
the autobuilders whereas "-Wl,-Bdynamic" is set since a very long time:
https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=c979fa04a40ff12370c8d3a82ad27d9d3b5907e3

Fixes:
 - http://autobuild.buildroot.org/results/99b419ddb5a3be561d39e715833510a59519213e

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-03-15 22:27:48 +01:00

96 lines
2.4 KiB
Makefile

################################################################################
#
# dnsmasq
#
################################################################################
DNSMASQ_VERSION = 2.86
DNSMASQ_SOURCE = dnsmasq-$(DNSMASQ_VERSION).tar.xz
DNSMASQ_SITE = http://thekelleys.org.uk/dnsmasq
DNSMASQ_MAKE_ENV = $(TARGET_MAKE_ENV) CC="$(TARGET_CC)"
DNSMASQ_MAKE_OPTS = COPTS="$(DNSMASQ_COPTS)" PREFIX=/usr CFLAGS="$(TARGET_CFLAGS)"
DNSMASQ_MAKE_OPTS += DESTDIR=$(TARGET_DIR) LDFLAGS="$(TARGET_LDFLAGS)" \
LIBS+=$(TARGET_NLS_LIBS)
DNSMASQ_DEPENDENCIES = host-pkgconf $(TARGET_NLS_DEPENDENCIES)
DNSMASQ_LICENSE = GPL-2.0 or GPL-3.0
DNSMASQ_LICENSE_FILES = COPYING COPYING-v3
DNSMASQ_CPE_ID_VENDOR = thekelleys
DNSMASQ_SELINUX_MODULES = dnsmasq
DNSMASQ_I18N = $(if $(BR2_SYSTEM_ENABLE_NLS),-i18n)
ifneq ($(BR2_PACKAGE_DNSMASQ_DHCP),y)
DNSMASQ_COPTS += -DNO_DHCP
endif
ifeq ($(BR2_PACKAGE_DNSMASQ_DNSSEC),y)
DNSMASQ_DEPENDENCIES += gmp nettle
DNSMASQ_COPTS += -DHAVE_DNSSEC
endif
ifneq ($(BR2_PACKAGE_DNSMASQ_TFTP),y)
DNSMASQ_COPTS += -DNO_TFTP
endif
ifeq ($(BR2_PACKAGE_DNSMASQ_IDN),y)
ifeq ($(BR2_PACKAGE_LIBIDN2),y)
DNSMASQ_DEPENDENCIES += libidn2
DNSMASQ_COPTS += -DHAVE_LIBIDN2
else
DNSMASQ_DEPENDENCIES += libidn
DNSMASQ_COPTS += -DHAVE_IDN
endif
endif
ifeq ($(BR2_PACKAGE_DNSMASQ_CONNTRACK),y)
DNSMASQ_DEPENDENCIES += libnetfilter_conntrack
DNSMASQ_COPTS += -DHAVE_CONNTRACK
endif
ifeq ($(BR2_PACKAGE_DNSMASQ_LUA),y)
DNSMASQ_DEPENDENCIES += lua
DNSMASQ_COPTS += -DHAVE_LUASCRIPT
# liblua uses dlopen when dynamically linked
ifneq ($(BR2_STATIC_LIBS),y)
DNSMASQ_MAKE_OPTS += LIBS+="-ldl"
endif
define DNSMASQ_TWEAK_LIBLUA
$(SED) 's/lua5.2/lua/g' $(DNSMASQ_DIR)/Makefile
endef
endif
ifeq ($(BR2_PACKAGE_DBUS),y)
DNSMASQ_DEPENDENCIES += dbus
DNSMASQ_COPTS += -DHAVE_DBUS
define DNSMASQ_INSTALL_DBUS
$(INSTALL) -m 0644 -D $(@D)/dbus/dnsmasq.conf \
$(TARGET_DIR)/etc/dbus-1/system.d/dnsmasq.conf
endef
endif
ifeq ($(BR2_PACKAGE_UBUS),y)
DNSMASQ_DEPENDENCIES += ubus
DNSMASQ_COPTS += -DHAVE_UBUS
endif
define DNSMASQ_BUILD_CMDS
$(DNSMASQ_TWEAK_LIBLUA)
$(DNSMASQ_MAKE_ENV) $(MAKE) -C $(@D) $(DNSMASQ_MAKE_OPTS) all$(DNSMASQ_I18N)
endef
define DNSMASQ_INSTALL_TARGET_CMDS
$(DNSMASQ_MAKE_ENV) $(MAKE) -C $(@D) $(DNSMASQ_MAKE_OPTS) install$(DNSMASQ_I18N)
mkdir -p $(TARGET_DIR)/var/lib/misc/
$(DNSMASQ_INSTALL_DBUS)
endef
define DNSMASQ_INSTALL_INIT_SYSV
$(INSTALL) -m 755 -D package/dnsmasq/S80dnsmasq \
$(TARGET_DIR)/etc/init.d/S80dnsmasq
endef
$(eval $(generic-package))