]> git.sur5r.net Git - kconfig-frontends/blobdiff - configure.ac
Makefile: ensure image directory exists
[kconfig-frontends] / configure.ac
index 31eef710bbffadb1fdad36d39b7b34723e48c453..150bc500cdaff67032544bfcbcbe5b4bf2b7d9af 100644 (file)
@@ -20,7 +20,7 @@ AC_CONFIG_MACRO_DIR([scripts/.autostuff/m4])
 #----------------------------------------
 # Prepare automake
 
-AM_INIT_AUTOMAKE([foreign])
+AM_INIT_AUTOMAKE([foreign subdir-objects])
 
 # For releases, enable silent rules, unless the user explicitly
 # disables them.
@@ -31,12 +31,6 @@ AS_IF(
     [AM_SILENT_RULES],
     [AM_SILENT_RULES([yes])])
 
-AS_IF(
-    [test $AM_DEFAULT_VERBOSITY -eq 0],
-    [SILENT_MAKEFLAGS="--no-print-directory -s"],
-    [SILENT_MAKEFLAGS=""])
-AC_SUBST([SILENT_MAKEFLAGS])
-
 #----------------------------------------
 # Prepare libtool
 m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl Automake, we have a problem...
@@ -209,12 +203,6 @@ AM_PROG_CC_C_O
 AC_PROG_CXX
 AC_C_INLINE
 AC_PROG_MAKE_SET
-AC_CHECK_PROGS(
-    [GPERF],
-    [gperf])
-AS_IF(
-    [test -z "$GPERF"],
-    [AC_MSG_ERROR([can not find gperf])])
 AS_IF(
     [test "$need_pkgconfig" = "yes"],
     [PKG_PROG_PKG_CONFIG()])
@@ -236,6 +224,46 @@ AS_IF(
         [AC_MSG_ERROR([can not find a parser generator (such as yacc or bison)])]))
 AC_SUBST([AM_YFLAGS], ["-t -l -p zconf"])
 
+#----------------------------------------
+# Special section to check for gperf.
+AC_CHECK_PROGS(
+    [GPERF],
+    [gperf])
+AS_IF(
+    [test -z "$GPERF"],
+    [AC_MSG_ERROR([can not find gperf])])
+
+# gperf 3.1 generates functions with 'size_t' instead of 'unsigned int'
+AC_MSG_CHECKING([for the type used in gperf declarations])
+GPERF_LEN_TYPE=
+AS_VAR_SET(
+    [GPERF_PROLOG],
+    [`echo foo,bar | ${GPERF} -L ANSI-C`])
+AC_COMPILE_IFELSE(
+    [AC_LANG_PROGRAM(
+        [[
+        #include <string.h>
+        ${GPERF_PROLOG}
+        const char * in_word_set(const char *, size_t);
+        ]])
+    ],
+    [GPERF_LEN_TYPE='size_t'],
+    [
+    AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+            [[
+            #include <string.h>
+            ${GPERF_PROLOG}
+            const char * in_word_set(const char *, unsigned int);
+            ]])
+        ],
+        [GPERF_LEN_TYPE='unsigned int'],
+        [AC_MSG_RESULT([not size_t, not unsigned int. What else?])
+         AC_MSG_FAILURE([unable to detect the type used in gperf declarations])
+        ])])
+AC_MSG_RESULT([${GPERF_LEN_TYPE}])
+AC_SUBST([GPERF_LEN_TYPE])
+
 #----------------------------------------
 # Check for gettext, for the kconfig frontends
 [has_gettext="$enable_L10n"]
@@ -478,12 +506,16 @@ 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"])
+# The meta frontend is handled separatly, below, because we do not
+# want it in the list of tools, kcfg_list.
 
 [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}])
 
+AS_IF([test "$enable_kconfig" = "yes"], [fe_list=" kconfig$fe_list"])
+
 [lib_list=]
 AS_IF(
     [test "$enable_shared" = "yes"],
@@ -494,21 +526,14 @@ AS_IF(
 
 #----------------------------------------
 # Finalise
+# All generated files are generated by a Makefile rule, except Makefile
+# itself of course.
+# There is no generic solution in automake to generate a file from its
+# .in source, so we'd have to provide custom, hand-made rules, which is
+# not nice. So, we handle libs/parser/kconfig-parser.pc here.
 AC_CONFIG_FILES([
     Makefile
-    docs/Makefile
-    libs/Makefile
-    libs/images/Makefile
-    libs/lxdialog/Makefile
-    libs/parser/Makefile
-    frontends/Makefile
-    frontends/conf/Makefile
-    frontends/mconf/Makefile
-    frontends/nconf/Makefile
-    frontends/gconf/Makefile
-    frontends/qconf/Makefile
-    utils/Makefile
-    scripts/Makefile
+    libs/parser/kconfig-parser.pc
 ])
 AC_OUTPUT