]> git.sur5r.net Git - kconfig-frontends/commitdiff
configure: only check for ncurses if either mconf or mconf is selected
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon, 23 Jan 2012 23:49:39 +0000 (00:49 +0100)
committerYann E. MORIN" <yann.morin.1998@free.fr>
Mon, 23 Jan 2012 23:49:39 +0000 (00:49 +0100)
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
configure.ac
frontends/nconf/Makefile.am
libs/Makefile.am

index 7a747b70d61e18e237f173c8533f4a00cf9dd140..837999d4a8d7adb860c86eee09b563d4df123e37 100644 (file)
@@ -104,20 +104,46 @@ AS_IF(
 
 #----------------------------------------
 # Check for ncurses, for the kconfig frontends
-AC_SUBST([CURSES_LOC])
-AC_CHECK_HEADERS(
-    [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
-    [CURSES_LOC=$ac_header; break])
 AS_IF(
-    [test -z "$CURSES_LOC"],
-    [AC_MSG_ERROR([could not find curses headers])])
-AC_SEARCH_LIBS(
-    [initscr],
-    [ncursesw ncurses curses],
-    [ac_ct_curses_lib_found=yes; break])
+    [test "$enable_mconf" = "yes" -o "$enable_nconf" = "yes"],
+    [AC_SUBST([CURSES_LOC])
+     AC_CHECK_HEADERS(
+        [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
+        [CURSES_LOC=$ac_header; break])
+     AS_IF(
+        [test -z "$CURSES_LOC"],
+        [AC_MSG_ERROR([could not find curses headers])])
+     AC_SEARCH_LIBS(
+        [initscr],
+        [ncursesw ncurses curses],
+        [ac_ct_curses_lib_found=yes; break])
+     AS_IF(
+        [test -z "$ac_ct_curses_lib_found"],
+        [AC_MSG_ERROR([could not find curses library])])])
+
+AS_IF(
+    [test "$enable_nconf" = "yes"],
+    [AC_SEARCH_LIBS(
+        [new_panel],
+        [panel],
+        [ac_ct_panel_lib_found=yes; break])
+     AS_IF(
+        [test -z "$ac_ct_panel_lib_found"],
+        [AC_MSG_ERROR([could not find libpanel library])])
+     AC_SEARCH_LIBS(
+        [menu_init],
+        [menu],
+        [ac_ct_menu_lib_found=yes; break])
+     AS_IF(
+        [test -z "$ac_ct_panel_lib_found"],
+        [AC_MSG_ERROR([could not find libmenu library])])])
+
+#----------------------------------------
+# Check if the lxdialog library should be built
 AS_IF(
-    [test -z "$ac_ct_curses_lib_found"],
-    [AC_MSG_ERROR([could not find curses library])])
+    [test "$enable_mconf" = "yes"],
+    [need_lxdialog=yes],
+    [need_lxdialog=no])
 
 #----------------------------------------
 # Check pkg-config if needed
@@ -161,6 +187,9 @@ AM_CONDITIONAL(
 AM_CONDITIONAL(
     [COND_qconf],
     [test "$enable_qconf" = "yes"])
+AM_CONDITIONAL(
+    [COND_lxdialog],
+    [test "$need_lxdialog" = "yes"])
 
 #----------------------------------------
 # Finalise
index b439c8356a0e27fb0411e6a6f71b08ad841cad1d..c68566cee9f7579857c6c4f5fcc0e87c4a14ac18 100644 (file)
@@ -4,5 +4,4 @@ nconf_SOURCES = nconf.c nconf.gui.c nconf.h
 nconf_CPPFLAGS = $(AM_CPPFLAGS)     \
                  $(GETTEXT)         \
                  -I../../libs/parser
-nconf_LDADD = -lmenu -lpanel        \
-              ../../libs/parser/libkconfigparser.a
+nconf_LDADD = ../../libs/parser/libkconfigparser.a
index 6e11169a029b8e0e2e0663f9bf87a2f932bf9afb..43dae8051dc901d229fa3d13e0cf983505fac616 100644 (file)
@@ -1 +1,4 @@
-SUBDIRS = parser lxdialog
+if COND_lxdialog
+    MAYBE_lxdialog = lxdialog
+endif
+SUBDIRS = parser $(MAYBE_lxdialog)