1 ################################################################################
5 ################################################################################
8 DNSMASQ_SOURCE
= dnsmasq-
$(DNSMASQ_VERSION
).
tar.xz
9 DNSMASQ_SITE
= http
://thekelleys.org.uk
/dnsmasq
10 DNSMASQ_MAKE_ENV
= $(TARGET_MAKE_ENV
) CC
="$(TARGET_CC)"
11 DNSMASQ_MAKE_OPTS
= COPTS
="$(DNSMASQ_COPTS)" PREFIX
=/usr CFLAGS
="$(TARGET_CFLAGS)"
12 DNSMASQ_MAKE_OPTS
+= DESTDIR
=$(TARGET_DIR
) LDFLAGS
="$(TARGET_LDFLAGS)"
13 DNSMASQ_DEPENDENCIES
= host-pkgconf
14 DNSMASQ_LICENSE
= GPLv2 or GPLv3
15 DNSMASQ_LICENSE_FILES
= COPYING COPYING-v3
17 ifneq ($(BR2_PACKAGE_DNSMASQ_DHCP
),y
)
18 DNSMASQ_COPTS
+= -DNO_DHCP
21 ifeq ($(BR2_PACKAGE_DNSMASQ_DNSSEC
),y
)
22 DNSMASQ_DEPENDENCIES
+= gmp nettle
23 DNSMASQ_COPTS
+= -DHAVE_DNSSEC
24 ifeq ($(BR2_STATIC_LIBS
),y
)
25 DNSMASQ_COPTS
+= -DHAVE_DNSSEC_STATIC
29 ifneq ($(BR2_PACKAGE_DNSMASQ_TFTP
),y
)
30 DNSMASQ_COPTS
+= -DNO_TFTP
33 # NLS requires IDN so only enable it (i18n) when IDN is true
34 ifeq ($(BR2_PACKAGE_DNSMASQ_IDN
),y
)
35 DNSMASQ_DEPENDENCIES
+= libidn
$(if
$(BR2_NEEDS_GETTEXT_IF_LOCALE
),gettext
) host-gettext
36 DNSMASQ_MAKE_OPTS
+= LIBS
+="$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),-lintl)"
37 DNSMASQ_COPTS
+= -DHAVE_IDN
38 DNSMASQ_I18N
= $(if
$(BR2_ENABLE_LOCALE
),-i18n
)
41 ifeq ($(BR2_PACKAGE_DNSMASQ_CONNTRACK
),y
)
42 DNSMASQ_DEPENDENCIES
+= libnetfilter_conntrack
45 ifeq ($(BR2_PACKAGE_DNSMASQ_CONNTRACK
),y
)
46 define DNSMASQ_ENABLE_CONNTRACK
47 $(SED
) 's^.*#define HAVE_CONNTRACK.*^#define HAVE_CONNTRACK^' \
48 $(DNSMASQ_DIR
)/src
/config.h
52 ifeq ($(BR2_PACKAGE_DNSMASQ_LUA
),y
)
53 DNSMASQ_DEPENDENCIES
+= lua
55 # liblua uses dlopen when dynamically linked
56 ifneq ($(BR2_STATIC_LIBS
),y
)
57 DNSMASQ_MAKE_OPTS
+= LIBS
+="-ldl"
60 define DNSMASQ_ENABLE_LUA
61 $(SED
) 's/lua5.1/lua/g' $(DNSMASQ_DIR
)/Makefile
62 $(SED
) 's^.*#define HAVE_LUASCRIPT.*^#define HAVE_LUASCRIPT^' \
63 $(DNSMASQ_DIR
)/src
/config.h
67 ifeq ($(BR2_PACKAGE_DBUS
),y
)
68 DNSMASQ_DEPENDENCIES
+= dbus
71 define DNSMASQ_FIX_PKGCONFIG
72 $(SED
) 's^PKG_CONFIG = pkg-config^PKG_CONFIG = $(PKG_CONFIG_HOST_BINARY)^' \
73 $(DNSMASQ_DIR
)/Makefile
76 ifeq ($(BR2_PACKAGE_DBUS
),y
)
77 define DNSMASQ_ENABLE_DBUS
78 $(SED
) 's^.*#define HAVE_DBUS.*^#define HAVE_DBUS^' \
79 $(DNSMASQ_DIR
)/src
/config.h
82 define DNSMASQ_ENABLE_DBUS
83 $(SED
) 's^.*#define HAVE_DBUS.*^/* #define HAVE_DBUS */^' \
84 $(DNSMASQ_DIR
)/src
/config.h
88 define DNSMASQ_BUILD_CMDS
89 $(DNSMASQ_FIX_PKGCONFIG
)
90 $(DNSMASQ_ENABLE_DBUS
)
92 $(DNSMASQ_ENABLE_CONNTRACK
)
93 $(DNSMASQ_MAKE_ENV
) $(MAKE
) -C
$(@D
) $(DNSMASQ_MAKE_OPTS
) all$(DNSMASQ_I18N
)
96 ifeq ($(BR2_PACKAGE_DBUS
),y
)
97 define DNSMASQ_INSTALL_DBUS
98 $(INSTALL
) -m
0644 -D
$(@D
)/dbus
/dnsmasq.conf \
99 $(TARGET_DIR
)/etc
/dbus-1
/system.d
/dnsmasq.conf
103 define DNSMASQ_INSTALL_TARGET_CMDS
104 $(DNSMASQ_MAKE_ENV
) $(MAKE
) -C
$(@D
) $(DNSMASQ_MAKE_OPTS
) install$(DNSMASQ_I18N
)
105 mkdir
-p
$(TARGET_DIR
)/var
/lib
/misc
/
106 $(DNSMASQ_INSTALL_DBUS
)
109 define DNSMASQ_INSTALL_INIT_SYSV
110 $(INSTALL
) -m
755 -D package
/dnsmasq
/S80dnsmasq \
111 $(TARGET_DIR
)/etc
/init.d
/S80dnsmasq
114 $(eval
$(generic-package
))