From 5e375bc7d586e0df971734a5a5f1f080ffd89b68 Mon Sep 17 00:00:00 2001 From: "Robb, Sam" Date: Sat, 4 Feb 2006 23:28:06 -0800 Subject: [PATCH] [PATCH] kconfig: detect if -lintl is needed when linking conf,mconf On a system where libintl.h is present, but the NLS functionality is supplied by a separate library instead of the system C library, an attempt to "make config" or "make menuconfig" will fail with link errors, ex: scripts/kconfig/mconf.o:mconf.c:(.text+0xf63): undefined reference to `_libintl_gettext' This patch attempts to correct the problem by detecting whether or not NLS support requires linking with libintl. Signed-off-by: Samuel J Robb Cc: Roman Zippel Cc: Sam Ravnborg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/kconfig/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 5760e057ecba..d64aae85c378 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -123,7 +123,17 @@ KBUILD_HAVE_NLS := $(shell \ then echo yes ; \ else echo no ; fi) ifeq ($(KBUILD_HAVE_NLS),no) -HOSTCFLAGS += -DKBUILD_NO_NLS + HOSTCFLAGS += -DKBUILD_NO_NLS +else + KBUILD_NEED_LINTL := $(shell \ + if echo -e "\#include \nint main(int a, char** b) { gettext(\"\"); return 0; }\n" | \ + $(HOSTCC) $(HOSTCFLAGS) -x c - -o /dev/null> /dev/null 2>&1 ; \ + then echo no ; \ + else echo yes ; fi) + ifeq ($(KBUILD_NEED_LINTL),yes) + HOSTLOADLIBES_conf += -lintl + HOSTLOADLIBES_mconf += -lintl + endif endif # generated files seem to need this to find local include files