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

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/Makefile+11−1
@@ -123,7 +123,17 @@ KBUILD_HAVE_NLS := $(shell \ · 122 unmodified lines
123 then echo yes ; \123 then echo yes ; \
124 else echo no ; fi)124 else echo no ; fi)
125ifeq ($(KBUILD_HAVE_NLS),no)125ifeq ($(KBUILD_HAVE_NLS),no)
126HOSTCFLAGS += -DKBUILD_NO_NLS126 HOSTCFLAGS += -DKBUILD_NO_NLS
127else
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
127endif137endif
128 138
129# generated files seem to need this to find local include files139# generated files seem to need this to find local include files