History

[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.

Robb, Sam committed 20 years ago

Commit 5e375bc1 parent 4be68a71 file · +11 −1Browse files

Unified · Split

scripts/kconfig/Makefile+11−1
@@ -123,7 +123,17 @@ KBUILD_HAVE_NLS := $(shell \ · 122 unmodified lines
123123 then echo yes ; \
124124 else echo no ; fi)
125125 ifeq ($(KBUILD_HAVE_NLS),no)
126−HOSTCFLAGS += -DKBUILD_NO_NLS
126+ HOSTCFLAGS += -DKBUILD_NO_NLS
127+else
128+ KBUILD_NEED_LINTL := $(shell \
129+ if echo -e "\#include <libintl.h>\nint main(int a, char** b) { gettext(\"\"); return 0; }\n" | \
130+ $(HOSTCC) $(HOSTCFLAGS) -x c - -o /dev/null> /dev/null 2>&1 ; \
131+ then echo no ; \
132+ else echo yes ; fi)
133+ ifeq ($(KBUILD_NEED_LINTL),yes)
134+ HOSTLOADLIBES_conf += -lintl
135+ HOSTLOADLIBES_mconf += -lintl
136+ endif
127137 endif
128138
129139 # generated files seem to need this to find local include files