[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] Makefile.flags: fix the OS detection for libresolv
From:       Martin Kaiser <lists () kaiser ! cx>
Date:       2021-01-08 11:00:56
Message-ID: 20210108110056.32297-1-lists () kaiser ! cx
[Download RAW message or body]

From: Martin Kaiser <martin@kaiser.cx>

054493350 ("Do not add -lresolv on non-Linux systems") adds a condition
to link with libresolv only on linux systems.

The check requires that CONFIG_UNAME_OSNAME equals Linux. This is too
strict. By default, CONFIG_UNAME_OSNAME is the output of uname -o. For most
linux systems, uname -o returns "GNU/Linux".

Modify the check to succeed if CONFIG_UNAME_OSNAME contains the word Linux.

Use findstring to search for the substring (this might be a GNU Make
extension, but it's used by busybox in other places as well).

Fixes: 054493350 ("Do not add -lresolv on non-Linux systems")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 Makefile.flags | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.flags b/Makefile.flags
index 5673bc48a..3a7c0c77d 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -181,7 +181,7 @@ LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%
 endif
 
 ifeq ($(CONFIG_FEATURE_NSLOOKUP_BIG),y)
-ifeq ($(CONFIG_UNAME_OSNAME),Linux)
+ifneq (,findstring($(CONFIG_UNAME_OSNAME),Linux))
 LDLIBS += resolv
 endif
 endif
-- 
2.20.1

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic