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.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -123,7 +123,17 @@ KBUILD_HAVE_NLS := $(shell \ · 122 unmodified lines | ||
| 123 | 123 | then echo yes ; \ |
| 124 | 124 | else echo no ; fi) |
| 125 | 125 | 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 | |
| 127 | 137 | endif |
| 128 | 138 | |
| 129 | 139 | # generated files seem to need this to find local include files |