]> git.sur5r.net Git - kconfig-frontends/blobdiff - configure.ac
frontends: add the meta-frontend kconfig
[kconfig-frontends] / configure.ac
index 648850e8044ace6bdc4d0a438f9bf2138d81bbeb..31eef710bbffadb1fdad36d39b7b34723e48c453 100644 (file)
@@ -20,14 +20,6 @@ AC_CONFIG_MACRO_DIR([scripts/.autostuff/m4])
 #----------------------------------------
 # Prepare automake
 
-# We want to allow the user to override our default program-prefix,
-# so we must set-it now, before automake has a chance to interpret
-# it, but after the options are parsed, so as not to overwrite the
-# value (if any) set by the user
-AS_IF(
-    [test "$program_prefix" = NONE],
-    [program_prefix=kconfig-])
-
 AM_INIT_AUTOMAKE([foreign])
 
 # For releases, enable silent rules, unless the user explicitly
@@ -130,6 +122,13 @@ AC_SUBST([enable_L10n], [${enable_L10n:-yes}])
 #----------------------------------------
 # Options to selectively enable/disable frontends
 # All are selected by default
+AC_ARG_ENABLE(
+    [kconfig],
+    [AS_HELP_STRING(
+        [--disable-kconfig],
+        [kconfig, the meta-frontend to all kconfig tools (default=yes)])])
+AC_SUBST([enable_kconfig], [${enable_kconfig:-yes}])
+
 AC_ARG_ENABLE(
     [conf],
     [AS_HELP_STRING(
@@ -219,9 +218,22 @@ AS_IF(
 AS_IF(
     [test "$need_pkgconfig" = "yes"],
     [PKG_PROG_PKG_CONFIG()])
+# Look for `lex'. If it cannot be found, autoconf sets $LEX to ':'.
 AC_PROG_LEX
+AS_IF(
+    [test "$LEX" = ":"],
+    [AC_MSG_ERROR([can not find a lexer generator (such as lex or flex)])])
 AC_SUBST([AM_LFLAGS], ["-L -P zconf"])
+# Look for `yacc'. If it cannot be found, autoconf sets $YACC to 'yacc'.
 AC_PROG_YACC
+AS_IF(
+    [test "$YACC" = "yacc"],
+    [AC_CHECK_PROGS(
+        [YACC_IN_PATH],
+        [yacc])]
+     AS_IF(
+        [test -z "$YACC_IN_PATH"],
+        [AC_MSG_ERROR([can not find a parser generator (such as yacc or bison)])]))
 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
 
 #----------------------------------------
@@ -265,7 +277,9 @@ AS_IF(
      LIBS=
      AC_CHECK_HEADERS(
         [ncursesw/curses.h ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h],
-        [CURSES_LOC=$ac_header; ncurses_mconf_CPPFLAGS=-DCURSES_LOC=\\\"$ac_header\\\"; break])
+        [CURSES_LOC=$ac_header
+         ncurses_mconf_CPPFLAGS=-DCURSES_LOC=\\\"$ac_header\\\"
+         break # Stupid syntax-coloring in vim: "])
      AS_IF(
         [test -z "$CURSES_LOC"],
         [AS_IF(
@@ -275,6 +289,10 @@ AS_IF(
      AS_CASE(
         [$CURSES_LOC],
         [ncursesw/*],[ncurses_mconf_CPPFLAGS="$ncurses_mconf_CPPFLAGS -DNCURSES_WIDECHAR=1"])
+     AC_SEARCH_LIBS(
+        [setupterm],
+        [tinfo],
+        [break])
      AC_SEARCH_LIBS(
         [initscr],
         [ncursesw ncurses curses],
@@ -285,10 +303,6 @@ AS_IF(
             [test "$need_curses" = "yes"],
             [AC_MSG_ERROR([could not find curses library (frontends: mconf/nconf)])],
             [has_curses=no])])
-     AC_SEARCH_LIBS(
-        [setupterm],
-        [tinfo],
-        [break])
      ncurses_LIBS="$LIBS"
      LIBS=$LIBS_old])
 
@@ -359,22 +373,22 @@ AS_IF(
 AS_IF(
     [test "$need_qt" = "yes" -o "$need_qt" = "auto"],
     [PKG_CHECK_MODULES(
-        [qt4],
-        [QtCore QtGui Qt3Support],
+        [Qt5],
+        [Qt5Core Qt5Gui Qt5Widgets],
         [has_qt=yes; need_moc="$need_qt"],
         [AS_IF(
             [test "$need_qt" = "yes"],
-            [AC_MSG_ERROR([could not find QT4 headers and/or libraries (frontend: qconf)])],
+            [AC_MSG_ERROR([could not find Qt5 headers and/or libraries (frontend: qconf)])],
             [has_qt=no; need_moc=no])])])
 
-AC_ARG_VAR([MOC], [Qt meta object compiler (moc) command])
+AC_ARG_VAR([MOC], [Qt5 meta object compiler (moc) command])
 AS_IF(
     [test "$need_moc" = "yes" -o "$need_moc" = "auto"],
-    [QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
+    [QT5_BINDIR=`$PKG_CONFIG Qt5Core --variable host_bins`
      AC_PATH_PROGS(
         [MOC],
-        [moc-qt4 moc],,
-        [$QT4_BINDIR:$PATH])
+        [moc-qt5 moc],,
+        [$QT5_BINDIR:$PATH])
      AS_IF(
         [test -n "$MOC"],
         [has_moc=yes],
@@ -419,6 +433,9 @@ AS_IF(
 
 #----------------------------------------
 # Setup automake conditional build
+AM_CONDITIONAL(
+    [COND_kconfig],
+    [test "$enable_kconfig" = "yes"])
 AM_CONDITIONAL(
     [COND_conf],
     [test "$enable_conf" = "yes"])
@@ -453,6 +470,28 @@ AC_SUBST(
     [KCONFIGPARSER_LIB_VERSION],
     [m4_esyscmd_s([./scripts/version.sh --plain])])
 
+#----------------------------------------
+# Pretty-print the configuration settings
+[fe_list=]
+AS_IF([test "$enable_conf"  = "yes"], [fe_list="$fe_list conf" ])
+AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
+AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
+AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
+AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
+
+[kcfg_list="$fe_list"]
+AS_IF([test "$enable_utils" = "yes"], [kcfg_list="$kcfg_list diff merge tweak"])
+AS_IF([test "$has_gettext" = "yes"],  [kcfg_list="$kcfg_list gettext"])
+AC_SUBST([kcfg_list], [${kcfg_list}])
+
+[lib_list=]
+AS_IF(
+    [test "$enable_shared" = "yes"],
+    [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
+AS_IF(
+    [test "$enable_static" = "yes"],
+    [lib_list="$lib_list${lib_list:+,} static"])
+
 #----------------------------------------
 # Finalise
 AC_CONFIG_FILES([
@@ -473,30 +512,12 @@ AC_CONFIG_FILES([
 ])
 AC_OUTPUT
 
-#----------------------------------------
-# Pretty-print the configuration settings
-[fe_list=]
-AS_IF([test "$enable_conf"  = "yes"], [fe_list="$fe_list conf" ])
-AS_IF([test "$enable_gconf" = "yes"], [fe_list="$fe_list gconf"])
-AS_IF([test "$enable_mconf" = "yes"], [fe_list="$fe_list mconf"])
-AS_IF([test "$enable_nconf" = "yes"], [fe_list="$fe_list nconf"])
-AS_IF([test "$enable_qconf" = "yes"], [fe_list="$fe_list qconf"])
-
-[lib_list=]
-AS_IF(
-    [test "$enable_shared" = "yes"],
-    [lib_list="$lib_list shared (version: $KCONFIGPARSER_LIB_VERSION)"])
-AS_IF(
-    [test "$enable_static" = "yes"],
-    [lib_list="$lib_list${lib_list:+,} static"])
-
 AC_MSG_NOTICE()
 AC_MSG_NOTICE([Configured with:])
 AC_MSG_NOTICE([- parser library     :$lib_list])
 AC_MSG_NOTICE([  - root-menu prompt : $root_menu])
 AC_MSG_NOTICE([  - config prefix    : $config_prefix])
 AC_MSG_NOTICE([- frontends          :$fe_list])
-AC_MSG_NOTICE([  - transform name   : $program_transform_name])
 AC_MSG_NOTICE([  - localised        : $has_gettext])
 AC_MSG_NOTICE([- install utilities  : $enable_utils])
 AC_MSG_NOTICE([- CFLAGS CXXFLAGS    : $wall_CFLAGS $werror_CFLAGS])