summaryrefslogtreecommitdiff
path: root/package/utils
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2017-04-12 09:02:30 -0700
committerJo-Philipp Wich <jo@mein.io>2017-04-21 12:24:17 +0200
commit449880e0ffe528999c17f6ad6e4f87f1f4c46cdd (patch)
treec1bff42d4784ef35fe10888216287d3113cf59c0 /package/utils
parent9437fbb7ab2c979b5b464c031d50a243706799ab (diff)
downloadmtk-20170518-449880e0ffe528999c17f6ad6e4f87f1f4c46cdd.zip
mtk-20170518-449880e0ffe528999c17f6ad6e4f87f1f4c46cdd.tar.gz
mtk-20170518-449880e0ffe528999c17f6ad6e4f87f1f4c46cdd.tar.bz2
busybox: Move libresolv detection to LEDE Makefile
Since the LEDE nslookup applet is already specific to LEDE, move the libresolv detection into the busybox Makefile that LEDE uses. This fixes builds with external toolchains that don't automatically search for headers and/or libraries without being told so. Fixes: de5b8e5d2fe1 ("busybox: add musl compatible nslookup replacement") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Diffstat (limited to 'package/utils')
-rw-r--r--package/utils/busybox/Makefile6
-rw-r--r--package/utils/busybox/patches/230-add_nslookup_lede.patch18
2 files changed, 6 insertions, 18 deletions
diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index c1e60ea..fdac78f 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -85,6 +85,12 @@ ifdef CONFIG_BUSYBOX_CONFIG_PAM
LDLIBS += pam pam_misc pthread
endif
+ifdef CONFIG_BUSYBOX_DEFAULT_NSLOOKUP_LEDE
+ ifeq ($(CONFIG_USE_GLIBC),y)
+ LDLIBS += resolv
+ endif
+endif
+
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
diff --git a/package/utils/busybox/patches/230-add_nslookup_lede.patch b/package/utils/busybox/patches/230-add_nslookup_lede.patch
index bff88a6..9e89837 100644
--- a/package/utils/busybox/patches/230-add_nslookup_lede.patch
+++ b/package/utils/busybox/patches/230-add_nslookup_lede.patch
@@ -12,28 +12,10 @@ and the libresolv primitives to parse received DNS responses.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
- Makefile.flags | 6 +
networking/nslookup_lede.c | 869 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 875 insertions(+)
create mode 100644 networking/nslookup_lede.c
-diff --git a/Makefile.flags b/Makefile.flags
-index 65021de..096ab77 100644
---- a/Makefile.flags
-+++ b/Makefile.flags
-@@ -134,6 +134,12 @@ else
- LDLIBS += m
- endif
-
-+# nslookup_lede might need the resolv library
-+RESOLV_AVAILABLE := $(shell echo 'int main(void){res_init();return 0;}' >resolvtest.c; $(CC) $(CFLAGS) -include resolv.h -lresolv -o /dev/null resolvtest.c >/dev/null 2>&1 && echo "y"; rm resolvtest.c)
-+ifeq ($(RESOLV_AVAILABLE),y)
-+LDLIBS += resolv
-+endif
-+
- # libpam may use libpthread, libdl and/or libaudit.
- # On some platforms that requires an explicit -lpthread, -ldl, -laudit.
- # However, on *other platforms* it fails when some of those flags
diff --git a/networking/nslookup_lede.c b/networking/nslookup_lede.c
new file mode 100644
index 0000000..fe927ad