kconfig: optionally use pkg-config to detect ncurses libs
authorJustin Lecher <jlec@gentoo.org>
Wed, 6 Mar 2013 13:02:02 +0000 (14:02 +0100)
committerYann E. MORIN <yann.morin.1998@free.fr>
Wed, 6 Mar 2013 23:21:11 +0000 (00:21 +0100)
When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

The ncurses pkg-config module will be used to detect the necessary libs for
linking. If not available the old way of directly specifying libs will be
used.

Signed-off-by: Justin Lecher <jlec@gentoo.org>
[yann.morin.1998@free.fr: fix typo: '-ncurses' --> '-lncurses']
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
scripts/kconfig/Makefile

index 231b4759c714dae5aa9034ef1365e1338cc3bb72..844bc9da08dacf866e9f769318faa15f90e5c136 100644 (file)
@@ -219,7 +219,9 @@ HOSTCFLAGS_gconf.o  = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
 
 HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
 
-HOSTLOADLIBES_nconf    = -lmenu -lpanel -lncurses
+HOSTLOADLIBES_nconf    = $(shell \
+                               pkg-config --libs menu panel ncurses 2>/dev/null \
+                               || echo "-lmenu -lpanel -lncurses"  )
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)