From 6e80346b723cc701f96bd57bfe84f05261df607e Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Tue, 14 Feb 2012 20:56:17 +0100 Subject: [PATCH] configure: properly separate the ncurses libs into its own list Currently, everything is linked against the ncurses libraries, but only two frontends use them: - mconf : libncurses - nconf : libncurses, libpanel et libmenu Fixup configure.ac to set the ncurses libs into their own lists, so that only dependent frontends use them. Signed-off-by: "Yann E. MORIN" --- configure.ac | 14 +++++++++++--- frontends/mconf/Makefile.am | 3 ++- frontends/nconf/Makefile.am | 3 ++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index e565d11..2396271 100644 --- a/configure.ac +++ b/configure.ac @@ -117,6 +117,8 @@ AS_CASE( AS_IF( [test "$need_curses" = "yes" -o "$need_curses" = "auto"], [AC_SUBST([CURSES_LOC]) + AC_SUBST([ncurses_LIBS]) + LIBS_old="$LIBS" AC_CHECK_HEADERS( [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h], [CURSES_LOC=$ac_header; break]) @@ -135,7 +137,9 @@ AS_IF( [AS_IF( [test "$need_curses" = "yes"], [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])], - [has_curses=no])])]) + [has_curses=no])]) + ncurses_LIBS="$LIBS" + LIBS=$LIBS_old]) AS_IF( [test "$has_curses" = "no" ], @@ -147,7 +151,9 @@ AS_IF( AS_IF( [test "$need_panel_menu" = "yes" -o "$need_panel_menu" = "auto"], - [AC_SEARCH_LIBS( + [AC_SUBST([ncurses_extra_LIBS]) + LIBS_old="$LIBS" + AC_SEARCH_LIBS( [new_panel], [panel], [ac_ct_panel_lib_found=yes; break]) @@ -166,7 +172,9 @@ AS_IF( [AS_IF( [test "$need_panel_menu" = "yes"], [AC_MSG_ERROR([could not find libmenu library (frontend: nconf)])], - [has_panel_menu=no])])]) + [has_panel_menu=no])]) + ncurses_extra_LIBS="$LIBS" + LIBS=$LIBS_old]) AS_IF( [test "$has_panel_menu" = "no" ], diff --git a/frontends/mconf/Makefile.am b/frontends/mconf/Makefile.am index 0440c2d..abf99ad 100644 --- a/frontends/mconf/Makefile.am +++ b/frontends/mconf/Makefile.am @@ -6,5 +6,6 @@ mconf_CPPFLAGS = $(AM_CPPFLAGS) \ $(GETTEXT) \ -I../../libs \ -I../../libs/parser -mconf_LDADD = ../../libs/parser/libkconfigparser.la \ +mconf_LDADD = ${ncurses_LIBS} \ + ../../libs/parser/libkconfigparser.la \ ../../libs/lxdialog/liblxdialog.a diff --git a/frontends/nconf/Makefile.am b/frontends/nconf/Makefile.am index 532c8f9..6391b9e 100644 --- a/frontends/nconf/Makefile.am +++ b/frontends/nconf/Makefile.am @@ -4,4 +4,5 @@ nconf_SOURCES = nconf.c nconf.gui.c nconf.h nconf_CPPFLAGS = $(AM_CPPFLAGS) \ $(GETTEXT) \ -I../../libs/parser -nconf_LDADD = ../../libs/parser/libkconfigparser.la +nconf_LDADD = ${ncurses_LIBS} ${ncurses_extra_LIBS} \ + ../../libs/parser/libkconfigparser.la -- 2.39.2