]> git.sur5r.net Git - kconfig-frontends/commitdiff
configure: properly separate the ncurses libs into its own list
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue, 14 Feb 2012 19:56:17 +0000 (20:56 +0100)
committerYann E. MORIN" <yann.morin.1998@free.fr>
Tue, 14 Feb 2012 19:56:17 +0000 (20:56 +0100)
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" <yann.morin.1998@anciens.enib.fr>
configure.ac
frontends/mconf/Makefile.am
frontends/nconf/Makefile.am

index e565d117cbcd3dfe1e2543df1366b47263c225c5..2396271d182ba25d2df0ba9377a4cd6d7692c6d7 100644 (file)
@@ -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" ],
index 0440c2d97f26f0e644155aec6e56088fa1ba19cc..abf99ad445720954b8586b2df9443574a3c00548 100644 (file)
@@ -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
index 532c8f92edd0968ca313ddc4226c08ef83c86490..6391b9eaa71d8158777734838a5e269ac12c619e 100644 (file)
@@ -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