.libs/
+/frontends/kconfig
/frontends/conf/kconfig-conf
/frontends/gconf/kconfig-gconf
/frontends/mconf/kconfig-mconf
#----------------------------------------
# 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(
#----------------------------------------
# Setup automake conditional build
+AM_CONDITIONAL(
+ [COND_kconfig],
+ [test "$enable_kconfig" = "yes"])
AM_CONDITIONAL(
[COND_conf],
[test "$enable_conf" = "yes"])
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"],
+if COND_kconfig
+ MAYBE_kconfig = kconfig
+endif
if COND_conf
MAYBE_conf = conf
endif
MAYBE_qconf = qconf
endif
SUBDIRS = $(MAYBE_conf) $(MAYBE_mconf) $(MAYBE_nconf) $(MAYBE_gconf) $(MAYBE_qconf)
+
+EXTRA_DIST = kconfig.in
+
+bin_SCRIPTS = $(MAYBE_kconfig)
+
+kconfig: kconfig.in
+ $(AM_V_GEN)$(SED) -e 's/@KCFG_LIST@/$(kcfg_list)/g' \
+ $< >$@
+ @chmod +x $@
--- /dev/null
+#!/usr/bin/env bash
+
+LIST="@KCFG_LIST@"
+
+main() {
+ local kcfg="${1}"; shift
+ local k
+
+ case "${kcfg}" in
+ "") error "what should I do (see -h)?\n";;
+ -h|--help) help; exit 0;;
+ -*) error "no such option '%s'\n" "${kcfg}";;
+ esac
+
+ for k in ${LIST}; do
+ if [ "${kcfg}" = "${k}" ]; then
+ exec kconfig-${kcfg} "${@}"
+ error "cannot execute tool '%s'\n" "${kcfg}"
+ fi
+ done
+ error "no such tool '%s'\n" "${kcfg}"
+}
+
+help() {
+ cat <<-_EOF_
+NAME
+ kconfig - meta-frontend to kconfig tools
+
+SYNOPSIS
+ kconfig -h|--help
+ kconfig <kconfig-tool> [option ...]
+
+DESCRIPTION
+ kconfig is the meta-frontend to all other kconfig tools:
+ ${LIST}
+
+ The acceptable options depend on what tool is being called.
+_EOF_
+}
+
+error() {
+ local fmt="${1}"; shift
+
+ printf "kconfig: ${fmt}" "${@}" >&2
+ exit 1
+}
+
+main "${@}"