aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Baruch Siach <baruch@tkos.co.il>2017-10-02 20:38:26 +0300
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-10-02 20:58:22 +0200
commit1042fea88aea4ebddcac5e215286394f1ad012b4 (patch)
treeffe66f27d7fcff44307f27a2f753a054b4c42ee9
parente77fdc90e320ff38d56d8e5c97fc783e8fbb76bb (diff)
downloadbuildroot-1042fea88aea4ebddcac5e215286394f1ad012b4.tar.gz
buildroot-1042fea88aea4ebddcac5e215286394f1ad012b4.tar.bz2
dnsmasq: simplify build configuration
Drop direct sed'ing of config.h for HAVE_CONNTRACK, HAVE_LUASCRIPT, and HAVE_DBUS. Use MAKE_OPTS COPTS parameters instead, like we do already for all other options. Rename DNSMASQ_ENABLE_LUA to DNSMASQ_TWEAK_LIBLUA since it now does only that. Merge two conntrack and three dbus conditional sections. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/dnsmasq/dnsmasq.mk42
1 files changed, 10 insertions, 32 deletions
diff --git a/package/dnsmasq/dnsmasq.mk b/package/dnsmasq/dnsmasq.mk
index 7322170432..9f96030eb6 100644
--- a/package/dnsmasq/dnsmasq.mk
+++ b/package/dnsmasq/dnsmasq.mk
@@ -40,32 +40,31 @@ endif
ifeq ($(BR2_PACKAGE_DNSMASQ_CONNTRACK),y)
DNSMASQ_DEPENDENCIES += libnetfilter_conntrack
-endif
-
-ifeq ($(BR2_PACKAGE_DNSMASQ_CONNTRACK),y)
-define DNSMASQ_ENABLE_CONNTRACK
- $(SED) 's^.*#define HAVE_CONNTRACK.*^#define HAVE_CONNTRACK^' \
- $(DNSMASQ_DIR)/src/config.h
-endef
+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_ENABLE_LUA
+define DNSMASQ_TWEAK_LIBLUA
$(SED) 's/lua5.2/lua/g' $(DNSMASQ_DIR)/Makefile
- $(SED) 's^.*#define HAVE_LUASCRIPT.*^#define HAVE_LUASCRIPT^' \
- $(DNSMASQ_DIR)/src/config.h
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
define DNSMASQ_FIX_PKGCONFIG
@@ -73,33 +72,12 @@ define DNSMASQ_FIX_PKGCONFIG
$(DNSMASQ_DIR)/Makefile
endef
-ifeq ($(BR2_PACKAGE_DBUS),y)
-define DNSMASQ_ENABLE_DBUS
- $(SED) 's^.*#define HAVE_DBUS.*^#define HAVE_DBUS^' \
- $(DNSMASQ_DIR)/src/config.h
-endef
-else
-define DNSMASQ_ENABLE_DBUS
- $(SED) 's^.*#define HAVE_DBUS.*^/* #define HAVE_DBUS */^' \
- $(DNSMASQ_DIR)/src/config.h
-endef
-endif
-
define DNSMASQ_BUILD_CMDS
$(DNSMASQ_FIX_PKGCONFIG)
- $(DNSMASQ_ENABLE_DBUS)
- $(DNSMASQ_ENABLE_LUA)
- $(DNSMASQ_ENABLE_CONNTRACK)
+ $(DNSMASQ_TWEAK_LIBLUA)
$(DNSMASQ_MAKE_ENV) $(MAKE) -C $(@D) $(DNSMASQ_MAKE_OPTS) all$(DNSMASQ_I18N)
endef
-ifeq ($(BR2_PACKAGE_DBUS),y)
-define DNSMASQ_INSTALL_DBUS
- $(INSTALL) -m 0644 -D $(@D)/dbus/dnsmasq.conf \
- $(TARGET_DIR)/etc/dbus-1/system.d/dnsmasq.conf
-endef
-endif
-
define DNSMASQ_INSTALL_TARGET_CMDS
$(DNSMASQ_MAKE_ENV) $(MAKE) -C $(@D) $(DNSMASQ_MAKE_OPTS) install$(DNSMASQ_I18N)
mkdir -p $(TARGET_DIR)/var/lib/misc/