[PATCH] kconfig: detect if -lintl is needed when linking conf,mconf

From: Robb, Sam
Date: Mon Jan 30 2006 - 13:28:52 EST


Hello,

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 <sam.robb@xxxxxxxxxxx>

---

--- linux-2.6.15.1/scripts/kconfig/Makefile.orig 2006-01-25 14:55:22.926372900 -0500
+++ linux-2.6.15.1/scripts/kconfig/Makefile 2006-01-30 12:51:04.551596200 -0500
@@ -122,7 +122,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 <libintl.h>\nint main(int a, char** b) { gettext(\"\"); return 0; }\n" | \
+ $(HOSTCC) $(HOSTCFLAGS) -x c - > /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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/