]> git.sur5r.net Git - kconfig-frontends/commitdiff
buildsystem: do not use program-prefix to set the kconfig- prefix
authorYann E. MORIN <yann.morin.1998@free.fr>
Wed, 3 Aug 2016 19:15:53 +0000 (21:15 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Sun, 21 Aug 2016 19:31:21 +0000 (21:31 +0200)
Currently, we use automake's --program-prefix to set the prefix of the
kconfig executables to 'kconfig-'.

However, this is neither very nice nor very reliable. In some cases, the
standard practice distributions use is to force the prefix to be empty,
in which case this would create clashes with other tools (esp. diff and
merge).

Furthermore, we use a dirty trick to achieve this, by initialising
program-prefix before initialising automake. There is no guarantee this
will continue to work with future automake versions.

Stop using this trick, and directly include the 'kconfig-' prefix for
all programs (binaries and scripts alike) that we may generate and
install.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
17 files changed:
.gitignore
configure.ac
frontends/conf/Makefile.am
frontends/gconf/Makefile.am
frontends/mconf/Makefile.am
frontends/nconf/Makefile.am
frontends/qconf/Makefile.am
scripts/ksync.list
utils/Makefile.am
utils/diff [deleted file]
utils/kconfig-diff [new file with mode: 0755]
utils/kconfig-merge [new file with mode: 0755]
utils/kconfig-tweak.in [new file with mode: 0644]
utils/kconfig-tweak.in.patch [new file with mode: 0644]
utils/merge [deleted file]
utils/tweak.in [deleted file]
utils/tweak.in.patch [deleted file]

index 58139e63699fcaf5ab5ab748cece4686f3887c7f..da028f8b68bfc1e5053d47c9b0714e900ce7be6f 100644 (file)
@@ -8,16 +8,11 @@
 
 .libs/
 
-/frontends/conf/conf
-/frontends/conf/*-conf
-/frontends/gconf/gconf
-/frontends/gconf/*-gconf
-/frontends/mconf/mconf
-/frontends/mconf/*-mconf
-/frontends/nconf/nconf
-/frontends/nconf/*-nconf
-/frontends/qconf/qconf
-/frontends/qconf/*-qconf
+/frontends/conf/kconfig-conf
+/frontends/gconf/kconfig-gconf
+/frontends/mconf/kconfig-mconf
+/frontends/nconf/kconfig-nconf
+/frontends/qconf/kconfig-qconf
 /frontends/qconf/qconf.moc
 
 /libs/images/images.c
@@ -26,9 +21,8 @@
 /libs/parser/lconf.c
 /libs/parser/yconf.c
 
-/utils/tweak
-/utils/gettext
-/utils/*-gettext
+/utils/kconfig-tweak
+/utils/kconfig-gettext
 
 aclocal.m4
 configure
index c404185721a4ece992cd44e87fe90cbfaa6cf3e4..ad923e9532b8361c0b382894abc0285886ef8361 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
@@ -511,7 +503,6 @@ 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])
index 10566cc424b58791c7346c9fe315ef2b9b498945..38db98f0263bb4097b90377b18ab1be31f246bf4 100644 (file)
@@ -1,10 +1,10 @@
-bin_PROGRAMS = conf
+bin_PROGRAMS = kconfig-conf
 
-conf_SOURCES = conf.c
-conf_CPPFLAGS = $(AM_CPPFLAGS)      \
-                $(intl_CPPFLAGS)    \
-                -I$(top_srcdir)/libs/parser
-conf_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS)
-conf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la  \
-             $(intl_LIBS)                                      \
-             $(conf_EXTRA_LIBS)
+kconfig_conf_SOURCES = conf.c
+kconfig_conf_CPPFLAGS = $(AM_CPPFLAGS)      \
+                        $(intl_CPPFLAGS)    \
+                        -I$(top_srcdir)/libs/parser
+kconfig_conf_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS)
+kconfig_conf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la  \
+                     $(intl_LIBS)                                      \
+                     $(conf_EXTRA_LIBS)
index 93ad7d46d04b63d35d578cd0fa59282dcf88f898..abdb193ba1dcf0153da50b92f035d378e15f30aa 100644 (file)
@@ -1,17 +1,17 @@
-bin_PROGRAMS = gconf
+bin_PROGRAMS = kconfig-gconf
 
-gconf_SOURCES = gconf.c gconf.glade
-gconf_CPPFLAGS = $(AM_CPPFLAGS)                 \
-                 $(intl_CPPFLAGS)               \
-                 -I$(top_srcdir)/libs/parser    \
-                 -I$(top_builddir)/libs/images  \
-                 -DGUI_PATH='"$(pkgdatadir)/gconf.glade"'
-gconf_CFLAGS = $(AM_CFLAGS) \
-               $(kf_CFLAGS) \
-               $(gtk_CFLAGS)
-gconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la  \
-              $(top_builddir)/libs/images/libkconfig-images.a   \
-              $(intl_LIBS) $(gtk_LIBS) $(gconf_EXTRA_LIBS)
-gconfdir = $(pkgdatadir)
-gconf_DATA = gconf.glade
+kconfig_gconf_SOURCES = gconf.c gconf.glade
+kconfig_gconf_CPPFLAGS = $(AM_CPPFLAGS)                 \
+                         $(intl_CPPFLAGS)               \
+                         -I$(top_srcdir)/libs/parser    \
+                         -I$(top_builddir)/libs/images  \
+                         -DGUI_PATH='"$(pkgdatadir)/gconf.glade"'
+kconfig_gconf_CFLAGS = $(AM_CFLAGS) \
+                       $(kf_CFLAGS) \
+                       $(gtk_CFLAGS)
+kconfig_gconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la  \
+                      $(top_builddir)/libs/images/libkconfig-images.a   \
+                      $(intl_LIBS) $(gtk_LIBS) $(gconf_EXTRA_LIBS)
+kconfig_gconfdir = $(pkgdatadir)
+kconfig_gconf_DATA = gconf.glade
 EXTRA_DIST = gconf.c.patch
index 47240f23da5e676c0e23b699d441930f77ac36b6..175a712670363055861b0de5f25d54c0ea869b38 100644 (file)
@@ -1,13 +1,13 @@
-bin_PROGRAMS = mconf
+bin_PROGRAMS = kconfig-mconf
 
-mconf_SOURCES = mconf.c
-mconf_CPPFLAGS = $(AM_CPPFLAGS)                 \
-                 $(ncurses_mconf_CPPFLAGS)      \
-                 $(intl_CPPFLAGS)               \
-                 -I$(top_srcdir)/libs           \
-                 -I$(top_srcdir)/libs/parser
-mconf_CFLAGS = $(AM_CFLAGS) \
-               $(kf_CFLAGS)
-mconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la      \
-              $(top_builddir)/libs/lxdialog/libkconfig-lxdialog.a   \
-              $(intl_LIBS) $(ncurses_LIBS) $(mconf_EXTRA_LIBS)
+kconfig_mconf_SOURCES = mconf.c
+kconfig_mconf_CPPFLAGS = $(AM_CPPFLAGS)                 \
+                         $(ncurses_mconf_CPPFLAGS)      \
+                         $(intl_CPPFLAGS)               \
+                         -I$(top_srcdir)/libs           \
+                         -I$(top_srcdir)/libs/parser
+kconfig_mconf_CFLAGS = $(AM_CFLAGS) \
+                       $(kf_CFLAGS)
+kconfig_mconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la      \
+                      $(top_builddir)/libs/lxdialog/libkconfig-lxdialog.a   \
+                      $(intl_LIBS) $(ncurses_LIBS) $(mconf_EXTRA_LIBS)
index 90a61545f5dc317088b2d7e57dd6f2fa01bab9dd..de0664b69ae9ba1d5ca958842903c32efe34d474 100644 (file)
@@ -1,12 +1,12 @@
-bin_PROGRAMS = nconf
+bin_PROGRAMS = kconfig-nconf
 
-nconf_SOURCES = nconf.c nconf.gui.c nconf.h
-nconf_CPPFLAGS = $(AM_CPPFLAGS)             \
-                 $(intl_CPPFLAGS)           \
-                 $(ncurses_nconf_CPPFLAGS)  \
-                 -I$(top_srcdir)/libs/parser
-nconf_CFLAGS = $(AM_CFLAGS) \
-               $(kf_CFLAGS)
-nconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la          \
-              $(intl_LIBS) $(ncurses_panel_menu_LIBS) $(ncurses_LIBS)   \
-              $(nconf_EXTRA_LIBS)
+kconfig_nconf_SOURCES = nconf.c nconf.gui.c nconf.h
+kconfig_nconf_CPPFLAGS = $(AM_CPPFLAGS)             \
+                         $(intl_CPPFLAGS)           \
+                         $(ncurses_nconf_CPPFLAGS)  \
+                         -I$(top_srcdir)/libs/parser
+kconfig_nconf_CFLAGS = $(AM_CFLAGS) \
+                       $(kf_CFLAGS)
+kconfig_nconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la          \
+                      $(intl_LIBS) $(ncurses_panel_menu_LIBS) $(ncurses_LIBS)   \
+                      $(nconf_EXTRA_LIBS)
index 3feabd3bce0f41f842e0240151ba0414ba6f2f38..bc4949894383cde954c25cd3f7e26a2fe1658f34 100644 (file)
@@ -1,18 +1,18 @@
-bin_PROGRAMS = qconf
+bin_PROGRAMS = kconfig-qconf
 
-qconf_SOURCES = qconf.cc qconf.h
+kconfig_qconf_SOURCES = qconf.cc qconf.h
 BUILT_SOURCES = qconf.moc
-qconf_CPPFLAGS = $(AM_CPPFLAGS)                 \
-                 $(intl_CPPFLAGS)               \
-                 -I$(top_srcdir)/libs/parser    \
-                 -I$(top_builddir)/libs/images
-qconf_CXXFLAGS = $(AM_CXXFLAGS) \
-                 $(kf_CFLAGS)   \
-                 $(Qt5_CFLAGS) \
-                 -fPIC
-qconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la  \
-              $(top_builddir)/libs/images/libkconfig-images.a   \
-              $(intl_LIBS) $(Qt5_LIBS) $(qconf_EXTRA_LIBS)
+kconfig_qconf_CPPFLAGS = $(AM_CPPFLAGS)                 \
+                         $(intl_CPPFLAGS)               \
+                         -I$(top_srcdir)/libs/parser    \
+                         -I$(top_builddir)/libs/images
+kconfig_qconf_CXXFLAGS = $(AM_CXXFLAGS) \
+                         $(kf_CFLAGS)   \
+                         $(Qt5_CFLAGS)  \
+                         -fPIC
+kconfig_qconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la  \
+                      $(top_builddir)/libs/images/libkconfig-images.a   \
+                      $(intl_LIBS) $(Qt5_LIBS) $(qconf_EXTRA_LIBS)
 CLEANFILES = qconf.moc
 EXTRA_DIST = qconf.cc.patch
 
index aa8b9b6fa870aa7019d0a5697d5e7b2a01b57200..c2d66fabc1d01826feecee23e5afc9ef7f650091 100644 (file)
@@ -28,9 +28,9 @@ scripts/kconfig/menu.c                            -->  libs/parser/menu.c
 scripts/kconfig/symbol.c                          -->  libs/parser/symbol.c
 scripts/kconfig/util.c                            -->  libs/parser/util.c
 scripts/kconfig/zconf.y                           -->  libs/parser/yconf.y
-scripts/config                                    -->  utils/tweak.in
-scripts/diffconfig                                -->  utils/diff
-scripts/kconfig/merge_config.sh                   -->  utils/merge
+scripts/config                                    -->  utils/kconfig-tweak.in
+scripts/diffconfig                                -->  utils/kconfig-diff
+scripts/kconfig/merge_config.sh                   -->  utils/kconfig-merge
 scripts/kconfig/kxgettext.c                       -->  utils/gettext.c
 Documentation/kbuild/kconfig-language.txt         -->  docs/kconfig-language.txt
 Documentation/kbuild/kconfig.txt                  -->  docs/kconfig.txt
index b3f55df4bb8083f2f84c527c85ed80fad4b39b7b..64381100f230d5baabc13c10274bae81288e98a1 100644 (file)
@@ -1,21 +1,21 @@
-bin_SCRIPTS = tweak
-dist_bin_SCRIPTS = diff merge
+bin_SCRIPTS = kconfig-tweak
+dist_bin_SCRIPTS = kconfig-diff kconfig-merge
 
 if COND_utils_gettext
-    MAYBE_utils_gettext = gettext
+    MAYBE_utils_gettext = kconfig-gettext
 endif
 bin_PROGRAMS = $(MAYBE_utils_gettext)
 
-gettext_SOURCES = gettext.c
-gettext_CPPFLAGS = $(AM_CPPFLAGS)   \
-                   -I$(top_srcdir)/libs/parser
-gettext_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS)
-gettext_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la    \
-                $(intl_LIBS)
-CLEANFILES = tweak
-EXTRA_DIST = tweak.in tweak.in.patch
+kconfig_gettext_SOURCES = gettext.c
+kconfig_gettext_CPPFLAGS = $(AM_CPPFLAGS)   \
+                           -I$(top_srcdir)/libs/parser
+kconfig_gettext_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS)
+kconfig_gettext_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la    \
+                        $(intl_LIBS)
+CLEANFILES = kconfig-tweak
+EXTRA_DIST = kconfig-tweak.in kconfig-tweak.in.patch
 
-tweak: tweak.in
+kconfig-tweak: kconfig-tweak.in
        $(AM_V_GEN)$(SED) -e "s/@CONFIG_@/$(config_prefix)/g"    \
                          $< >$@
        @chmod +x $@
diff --git a/utils/diff b/utils/diff
deleted file mode 100755 (executable)
index 0db267d..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/python
-#
-# diffconfig - a tool to compare .config files.
-#
-# originally written in 2006 by Matt Mackall
-#  (at least, this was in his bloatwatch source code)
-# last worked on 2008 by Tim Bird
-#
-
-import sys, os
-
-def usage():
-    print("""Usage: diffconfig [-h] [-m] [<config1> <config2>]
-
-Diffconfig is a simple utility for comparing two .config files.
-Using standard diff to compare .config files often includes extraneous and
-distracting information.  This utility produces sorted output with only the
-changes in configuration values between the two files.
-
-Added and removed items are shown with a leading plus or minus, respectively.
-Changed items show the old and new values on a single line.
-
-If -m is specified, then output will be in "merge" style, which has the
-changed and new values in kernel config option format.
-
-If no config files are specified, .config and .config.old are used.
-
-Example usage:
- $ diffconfig .config config-with-some-changes
--EXT2_FS_XATTR  n
- CRAMFS  n -> y
- EXT2_FS  y -> n
- LOG_BUF_SHIFT  14 -> 16
- PRINTK_TIME  n -> y
-""")
-    sys.exit(0)
-
-# returns a dictionary of name/value pairs for config items in the file
-def readconfig(config_file):
-    d = {}
-    for line in config_file:
-        line = line[:-1]
-        if line[:7] == "CONFIG_":
-            name, val = line[7:].split("=", 1)
-            d[name] = val
-        if line[-11:] == " is not set":
-            d[line[9:-11]] = "n"
-    return d
-
-def print_config(op, config, value, new_value):
-    global merge_style
-
-    if merge_style:
-        if new_value:
-            if new_value=="n":
-                print("# CONFIG_%s is not set" % config)
-            else:
-                print("CONFIG_%s=%s" % (config, new_value))
-    else:
-        if op=="-":
-            print("-%s %s" % (config, value))
-        elif op=="+":
-            print("+%s %s" % (config, new_value))
-        else:
-            print(" %s %s -> %s" % (config, value, new_value))
-
-def main():
-    global merge_style
-
-    # parse command line args
-    if ("-h" in sys.argv or "--help" in sys.argv):
-        usage()
-
-    merge_style = 0
-    if "-m" in sys.argv:
-        merge_style = 1
-        sys.argv.remove("-m")
-
-    argc = len(sys.argv)
-    if not (argc==1 or argc == 3):
-        print("Error: incorrect number of arguments or unrecognized option")
-        usage()
-
-    if argc == 1:
-        # if no filenames given, assume .config and .config.old
-        build_dir=""
-        if "KBUILD_OUTPUT" in os.environ:
-            build_dir = os.environ["KBUILD_OUTPUT"]+"/"
-        configa_filename = build_dir + ".config.old"
-        configb_filename = build_dir + ".config"
-    else:
-        configa_filename = sys.argv[1]
-        configb_filename = sys.argv[2]
-
-    try:
-        a = readconfig(open(configa_filename))
-        b = readconfig(open(configb_filename))
-    except (IOError):
-        e = sys.exc_info()[1]
-        print("I/O error[%s]: %s\n" % (e.args[0],e.args[1]))
-        usage()
-
-    # print items in a but not b (accumulate, sort and print)
-    old = []
-    for config in a:
-        if config not in b:
-            old.append(config)
-    old.sort()
-    for config in old:
-        print_config("-", config, a[config], None)
-        del a[config]
-
-    # print items that changed (accumulate, sort, and print)
-    changed = []
-    for config in a:
-        if a[config] != b[config]:
-            changed.append(config)
-        else:
-            del b[config]
-    changed.sort()
-    for config in changed:
-        print_config("->", config, a[config], b[config])
-        del b[config]
-
-    # now print items in b but not in a
-    # (items from b that were in a were removed above)
-    new = sorted(b.keys())
-    for config in new:
-        print_config("+", config, None, b[config])
-
-main()
diff --git a/utils/kconfig-diff b/utils/kconfig-diff
new file mode 100755 (executable)
index 0000000..0db267d
--- /dev/null
@@ -0,0 +1,131 @@
+#!/usr/bin/python
+#
+# diffconfig - a tool to compare .config files.
+#
+# originally written in 2006 by Matt Mackall
+#  (at least, this was in his bloatwatch source code)
+# last worked on 2008 by Tim Bird
+#
+
+import sys, os
+
+def usage():
+    print("""Usage: diffconfig [-h] [-m] [<config1> <config2>]
+
+Diffconfig is a simple utility for comparing two .config files.
+Using standard diff to compare .config files often includes extraneous and
+distracting information.  This utility produces sorted output with only the
+changes in configuration values between the two files.
+
+Added and removed items are shown with a leading plus or minus, respectively.
+Changed items show the old and new values on a single line.
+
+If -m is specified, then output will be in "merge" style, which has the
+changed and new values in kernel config option format.
+
+If no config files are specified, .config and .config.old are used.
+
+Example usage:
+ $ diffconfig .config config-with-some-changes
+-EXT2_FS_XATTR  n
+ CRAMFS  n -> y
+ EXT2_FS  y -> n
+ LOG_BUF_SHIFT  14 -> 16
+ PRINTK_TIME  n -> y
+""")
+    sys.exit(0)
+
+# returns a dictionary of name/value pairs for config items in the file
+def readconfig(config_file):
+    d = {}
+    for line in config_file:
+        line = line[:-1]
+        if line[:7] == "CONFIG_":
+            name, val = line[7:].split("=", 1)
+            d[name] = val
+        if line[-11:] == " is not set":
+            d[line[9:-11]] = "n"
+    return d
+
+def print_config(op, config, value, new_value):
+    global merge_style
+
+    if merge_style:
+        if new_value:
+            if new_value=="n":
+                print("# CONFIG_%s is not set" % config)
+            else:
+                print("CONFIG_%s=%s" % (config, new_value))
+    else:
+        if op=="-":
+            print("-%s %s" % (config, value))
+        elif op=="+":
+            print("+%s %s" % (config, new_value))
+        else:
+            print(" %s %s -> %s" % (config, value, new_value))
+
+def main():
+    global merge_style
+
+    # parse command line args
+    if ("-h" in sys.argv or "--help" in sys.argv):
+        usage()
+
+    merge_style = 0
+    if "-m" in sys.argv:
+        merge_style = 1
+        sys.argv.remove("-m")
+
+    argc = len(sys.argv)
+    if not (argc==1 or argc == 3):
+        print("Error: incorrect number of arguments or unrecognized option")
+        usage()
+
+    if argc == 1:
+        # if no filenames given, assume .config and .config.old
+        build_dir=""
+        if "KBUILD_OUTPUT" in os.environ:
+            build_dir = os.environ["KBUILD_OUTPUT"]+"/"
+        configa_filename = build_dir + ".config.old"
+        configb_filename = build_dir + ".config"
+    else:
+        configa_filename = sys.argv[1]
+        configb_filename = sys.argv[2]
+
+    try:
+        a = readconfig(open(configa_filename))
+        b = readconfig(open(configb_filename))
+    except (IOError):
+        e = sys.exc_info()[1]
+        print("I/O error[%s]: %s\n" % (e.args[0],e.args[1]))
+        usage()
+
+    # print items in a but not b (accumulate, sort and print)
+    old = []
+    for config in a:
+        if config not in b:
+            old.append(config)
+    old.sort()
+    for config in old:
+        print_config("-", config, a[config], None)
+        del a[config]
+
+    # print items that changed (accumulate, sort, and print)
+    changed = []
+    for config in a:
+        if a[config] != b[config]:
+            changed.append(config)
+        else:
+            del b[config]
+    changed.sort()
+    for config in changed:
+        print_config("->", config, a[config], b[config])
+        del b[config]
+
+    # now print items in b but not in a
+    # (items from b that were in a were removed above)
+    new = sorted(b.keys())
+    for config in new:
+        print_config("+", config, None, b[config])
+
+main()
diff --git a/utils/kconfig-merge b/utils/kconfig-merge
new file mode 100755 (executable)
index 0000000..67d1314
--- /dev/null
@@ -0,0 +1,170 @@
+#!/bin/sh
+#  merge_config.sh - Takes a list of config fragment values, and merges
+#  them one by one. Provides warnings on overridden values, and specified
+#  values that did not make it to the resulting .config file (due to missed
+#  dependencies or config symbol removal).
+#
+#  Portions reused from kconf_check and generate_cfg:
+#  http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-tools/tree/tools/kconf_check
+#  http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-tools/tree/tools/generate_cfg
+#
+#  Copyright (c) 2009-2010 Wind River Systems, Inc.
+#  Copyright 2011 Linaro
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License version 2 as
+#  published by the Free Software Foundation.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#  See the GNU General Public License for more details.
+
+clean_up() {
+       rm -f $TMP_FILE
+       exit
+}
+trap clean_up HUP INT TERM
+
+usage() {
+       echo "Usage: $0 [OPTIONS] [CONFIG [...]]"
+       echo "  -h    display this help text"
+       echo "  -m    only merge the fragments, do not execute the make command"
+       echo "  -n    use allnoconfig instead of alldefconfig"
+       echo "  -r    list redundant entries when merging fragments"
+       echo "  -O    dir to put generated output files.  Consider setting \$KCONFIG_CONFIG instead."
+}
+
+RUNMAKE=true
+ALLTARGET=alldefconfig
+WARNREDUN=false
+OUTPUT=.
+
+while true; do
+       case $1 in
+       "-n")
+               ALLTARGET=allnoconfig
+               shift
+               continue
+               ;;
+       "-m")
+               RUNMAKE=false
+               shift
+               continue
+               ;;
+       "-h")
+               usage
+               exit
+               ;;
+       "-r")
+               WARNREDUN=true
+               shift
+               continue
+               ;;
+       "-O")
+               if [ -d $2 ];then
+                       OUTPUT=$(echo $2 | sed 's/\/*$//')
+               else
+                       echo "output directory $2 does not exist" 1>&2
+                       exit 1
+               fi
+               shift 2
+               continue
+               ;;
+       *)
+               break
+               ;;
+       esac
+done
+
+if [ "$#" -lt 1 ] ; then
+       usage
+       exit
+fi
+
+if [ -z "$KCONFIG_CONFIG" ]; then
+       if [ "$OUTPUT" != . ]; then
+               KCONFIG_CONFIG=$(readlink -m -- "$OUTPUT/.config")
+       else
+               KCONFIG_CONFIG=.config
+       fi
+fi
+
+INITFILE=$1
+shift;
+
+if [ ! -r "$INITFILE" ]; then
+       echo "The base file '$INITFILE' does not exist.  Exit." >&2
+       exit 1
+fi
+
+MERGE_LIST=$*
+SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
+TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
+
+echo "Using $INITFILE as base"
+cat $INITFILE > $TMP_FILE
+
+# Merge files, printing warnings on overridden values
+for MERGE_FILE in $MERGE_LIST ; do
+       echo "Merging $MERGE_FILE"
+       if [ ! -r "$MERGE_FILE" ]; then
+               echo "The merge file '$MERGE_FILE' does not exist.  Exit." >&2
+               exit 1
+       fi
+       CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE)
+
+       for CFG in $CFG_LIST ; do
+               grep -q -w $CFG $TMP_FILE || continue
+               PREV_VAL=$(grep -w $CFG $TMP_FILE)
+               NEW_VAL=$(grep -w $CFG $MERGE_FILE)
+               if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
+                       echo Value of $CFG is redefined by fragment $MERGE_FILE:
+                       echo Previous  value: $PREV_VAL
+                       echo New value:       $NEW_VAL
+                       echo
+               elif [ "$WARNREDUN" = "true" ]; then
+                       echo Value of $CFG is redundant by fragment $MERGE_FILE:
+               fi
+               sed -i "/$CFG[ =]/d" $TMP_FILE
+       done
+       cat $MERGE_FILE >> $TMP_FILE
+done
+
+if [ "$RUNMAKE" = "false" ]; then
+       cp -T -- "$TMP_FILE" "$KCONFIG_CONFIG"
+       echo "#"
+       echo "# merged configuration written to $KCONFIG_CONFIG (needs make)"
+       echo "#"
+       clean_up
+       exit
+fi
+
+# If we have an output dir, setup the O= argument, otherwise leave
+# it blank, since O=. will create an unnecessary ./source softlink
+OUTPUT_ARG=""
+if [ "$OUTPUT" != "." ] ; then
+       OUTPUT_ARG="O=$OUTPUT"
+fi
+
+
+# Use the merged file as the starting point for:
+# alldefconfig: Fills in any missing symbols with Kconfig default
+# allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
+make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
+
+
+# Check all specified config values took (might have missed-dependency issues)
+for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
+
+       REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
+       ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG")
+       if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
+               echo "Value requested for $CFG not in final .config"
+               echo "Requested value:  $REQUESTED_VAL"
+               echo "Actual value:     $ACTUAL_VAL"
+               echo ""
+       fi
+done
+
+clean_up
diff --git a/utils/kconfig-tweak.in b/utils/kconfig-tweak.in
new file mode 100644 (file)
index 0000000..9c2fdae
--- /dev/null
@@ -0,0 +1,225 @@
+#!/bin/bash
+# Manipulate options in a .config file from the command line
+
+myname=${0##*/}
+
+# If no prefix forced, use the default @CONFIG_@
+CONFIG_="${CONFIG_-@CONFIG_@}"
+
+usage() {
+       cat >&2 <<EOL
+Manipulate options in a .config file from the command line.
+Usage:
+$myname options command ...
+commands:
+       --enable|-e option   Enable option
+       --disable|-d option  Disable option
+       --module|-m option   Turn option into a module
+       --set-str option string
+                            Set option to "string"
+       --set-val option value
+                            Set option to value
+       --undefine|-u option Undefine option
+       --state|-s option    Print state of option (n,y,m,undef)
+
+       --enable-after|-E beforeopt option
+                             Enable option directly after other option
+       --disable-after|-D beforeopt option
+                             Disable option directly after other option
+       --module-after|-M beforeopt option
+                             Turn option into module directly after other option
+
+       commands can be repeated multiple times
+
+options:
+       --file config-file   .config file to change (default .config)
+       --keep-case|-k       Keep next symbols' case (dont' upper-case it)
+
+$myname doesn't check the validity of the .config file. This is done at next
+make time.
+
+By default, $myname will upper-case the given symbol. Use --keep-case to keep
+the case of all following symbols unchanged.
+
+$myname uses '@CONFIG_@' as the default symbol prefix. Set the environment
+variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ...
+EOL
+       exit 1
+}
+
+checkarg() {
+       ARG="$1"
+       if [ "$ARG" = "" ] ; then
+               usage
+       fi
+       case "$ARG" in
+       ${CONFIG_}*)
+               ARG="${ARG/${CONFIG_}/}"
+               ;;
+       esac
+       if [ "$MUNGE_CASE" = "yes" ] ; then
+               ARG="`echo $ARG | tr a-z A-Z`"
+       fi
+}
+
+txt_append() {
+       local anchor="$1"
+       local insert="$2"
+       local infile="$3"
+       local tmpfile="$infile.swp"
+
+       # sed append cmd: 'a\' + newline + text + newline
+       cmd="$(printf "a\\%b$insert" "\n")"
+
+       sed -e "/$anchor/$cmd" "$infile" >"$tmpfile"
+       # replace original file with the edited one
+       mv "$tmpfile" "$infile"
+}
+
+txt_subst() {
+       local before="$1"
+       local after="$2"
+       local infile="$3"
+       local tmpfile="$infile.swp"
+
+       sed -e "s:$before:$after:" "$infile" >"$tmpfile"
+       # replace original file with the edited one
+       mv "$tmpfile" "$infile"
+}
+
+txt_delete() {
+       local text="$1"
+       local infile="$2"
+       local tmpfile="$infile.swp"
+
+       sed -e "/$text/d" "$infile" >"$tmpfile"
+       # replace original file with the edited one
+       mv "$tmpfile" "$infile"
+}
+
+set_var() {
+       local name=$1 new=$2 before=$3
+
+       name_re="^($name=|# $name is not set)"
+       before_re="^($before=|# $before is not set)"
+       if test -n "$before" && grep -Eq "$before_re" "$FN"; then
+               txt_append "^$before=" "$new" "$FN"
+               txt_append "^# $before is not set" "$new" "$FN"
+       elif grep -Eq "$name_re" "$FN"; then
+               txt_subst "^$name=.*" "$new" "$FN"
+               txt_subst "^# $name is not set" "$new" "$FN"
+       else
+               echo "$new" >>"$FN"
+       fi
+}
+
+undef_var() {
+       local name=$1
+
+       txt_delete "^$name=" "$FN"
+       txt_delete "^# $name is not set" "$FN"
+}
+
+if [ "$1" = "--file" ]; then
+       FN="$2"
+       if [ "$FN" = "" ] ; then
+               usage
+       fi
+       shift 2
+else
+       FN=.config
+fi
+
+if [ "$1" = "" ] ; then
+       usage
+fi
+
+MUNGE_CASE=yes
+while [ "$1" != "" ] ; do
+       CMD="$1"
+       shift
+       case "$CMD" in
+       --keep-case|-k)
+               MUNGE_CASE=no
+               continue
+               ;;
+       --refresh)
+               ;;
+       --*-after|-E|-D|-M)
+               checkarg "$1"
+               A=$ARG
+               checkarg "$2"
+               B=$ARG
+               shift 2
+               ;;
+       -*)
+               checkarg "$1"
+               shift
+               ;;
+       esac
+       case "$CMD" in
+       --enable|-e)
+               set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=y"
+               ;;
+
+       --disable|-d)
+               set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set"
+               ;;
+
+       --module|-m)
+               set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=m"
+               ;;
+
+       --set-str)
+               # sed swallows one level of escaping, so we need double-escaping
+               set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=\"${1//\"/\\\\\"}\""
+               shift
+               ;;
+
+       --set-val)
+               set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1"
+               shift
+               ;;
+       --undefine|-u)
+               undef_var "${CONFIG_}$ARG"
+               ;;
+
+       --state|-s)
+               if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then
+                       echo n
+               else
+                       V="$(grep "^${CONFIG_}$ARG=" $FN)"
+                       if [ $? != 0 ] ; then
+                               echo undef
+                       else
+                               V="${V/#${CONFIG_}$ARG=/}"
+                               V="${V/#\"/}"
+                               V="${V/%\"/}"
+                               V="${V//\\\"/\"}"
+                               echo "${V}"
+                       fi
+               fi
+               ;;
+
+       --enable-after|-E)
+               set_var "${CONFIG_}$B" "${CONFIG_}$B=y" "${CONFIG_}$A"
+               ;;
+
+       --disable-after|-D)
+               set_var "${CONFIG_}$B" "# ${CONFIG_}$B is not set" "${CONFIG_}$A"
+               ;;
+
+       --module-after|-M)
+               set_var "${CONFIG_}$B" "${CONFIG_}$B=m" "${CONFIG_}$A"
+               ;;
+
+       # undocumented because it ignores --file (fixme)
+       --refresh)
+               yes "" | make oldconfig
+               ;;
+
+       *)
+               usage
+               ;;
+       esac
+done
diff --git a/utils/kconfig-tweak.in.patch b/utils/kconfig-tweak.in.patch
new file mode 100644 (file)
index 0000000..5a85fe7
--- /dev/null
@@ -0,0 +1,23 @@
+diff --git a/utils/kconfig-tweak.in b/utils/kconfig-tweak.in
+--- a/utils/kconfig-tweak.in
++++ b/utils/kconfig-tweak.in
+@@ -3,8 +3,8 @@
+ myname=${0##*/}
+-# If no prefix forced, use the default CONFIG_
+-CONFIG_="${CONFIG_-CONFIG_}"
++# If no prefix forced, use the default @CONFIG_@
++CONFIG_="${CONFIG_-@CONFIG_@}"
+ usage() {
+       cat >&2 <<EOL
+@@ -41,7 +41,7 @@
+ By default, $myname will upper-case the given symbol. Use --keep-case to keep
+ the case of all following symbols unchanged.
+-$myname uses 'CONFIG_' as the default symbol prefix. Set the environment
++$myname uses '@CONFIG_@' as the default symbol prefix. Set the environment
+ variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ...
+ EOL
+       exit 1
diff --git a/utils/merge b/utils/merge
deleted file mode 100755 (executable)
index 67d1314..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/bin/sh
-#  merge_config.sh - Takes a list of config fragment values, and merges
-#  them one by one. Provides warnings on overridden values, and specified
-#  values that did not make it to the resulting .config file (due to missed
-#  dependencies or config symbol removal).
-#
-#  Portions reused from kconf_check and generate_cfg:
-#  http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-tools/tree/tools/kconf_check
-#  http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-tools/tree/tools/generate_cfg
-#
-#  Copyright (c) 2009-2010 Wind River Systems, Inc.
-#  Copyright 2011 Linaro
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License version 2 as
-#  published by the Free Software Foundation.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#  See the GNU General Public License for more details.
-
-clean_up() {
-       rm -f $TMP_FILE
-       exit
-}
-trap clean_up HUP INT TERM
-
-usage() {
-       echo "Usage: $0 [OPTIONS] [CONFIG [...]]"
-       echo "  -h    display this help text"
-       echo "  -m    only merge the fragments, do not execute the make command"
-       echo "  -n    use allnoconfig instead of alldefconfig"
-       echo "  -r    list redundant entries when merging fragments"
-       echo "  -O    dir to put generated output files.  Consider setting \$KCONFIG_CONFIG instead."
-}
-
-RUNMAKE=true
-ALLTARGET=alldefconfig
-WARNREDUN=false
-OUTPUT=.
-
-while true; do
-       case $1 in
-       "-n")
-               ALLTARGET=allnoconfig
-               shift
-               continue
-               ;;
-       "-m")
-               RUNMAKE=false
-               shift
-               continue
-               ;;
-       "-h")
-               usage
-               exit
-               ;;
-       "-r")
-               WARNREDUN=true
-               shift
-               continue
-               ;;
-       "-O")
-               if [ -d $2 ];then
-                       OUTPUT=$(echo $2 | sed 's/\/*$//')
-               else
-                       echo "output directory $2 does not exist" 1>&2
-                       exit 1
-               fi
-               shift 2
-               continue
-               ;;
-       *)
-               break
-               ;;
-       esac
-done
-
-if [ "$#" -lt 1 ] ; then
-       usage
-       exit
-fi
-
-if [ -z "$KCONFIG_CONFIG" ]; then
-       if [ "$OUTPUT" != . ]; then
-               KCONFIG_CONFIG=$(readlink -m -- "$OUTPUT/.config")
-       else
-               KCONFIG_CONFIG=.config
-       fi
-fi
-
-INITFILE=$1
-shift;
-
-if [ ! -r "$INITFILE" ]; then
-       echo "The base file '$INITFILE' does not exist.  Exit." >&2
-       exit 1
-fi
-
-MERGE_LIST=$*
-SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
-TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
-
-echo "Using $INITFILE as base"
-cat $INITFILE > $TMP_FILE
-
-# Merge files, printing warnings on overridden values
-for MERGE_FILE in $MERGE_LIST ; do
-       echo "Merging $MERGE_FILE"
-       if [ ! -r "$MERGE_FILE" ]; then
-               echo "The merge file '$MERGE_FILE' does not exist.  Exit." >&2
-               exit 1
-       fi
-       CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE)
-
-       for CFG in $CFG_LIST ; do
-               grep -q -w $CFG $TMP_FILE || continue
-               PREV_VAL=$(grep -w $CFG $TMP_FILE)
-               NEW_VAL=$(grep -w $CFG $MERGE_FILE)
-               if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
-                       echo Value of $CFG is redefined by fragment $MERGE_FILE:
-                       echo Previous  value: $PREV_VAL
-                       echo New value:       $NEW_VAL
-                       echo
-               elif [ "$WARNREDUN" = "true" ]; then
-                       echo Value of $CFG is redundant by fragment $MERGE_FILE:
-               fi
-               sed -i "/$CFG[ =]/d" $TMP_FILE
-       done
-       cat $MERGE_FILE >> $TMP_FILE
-done
-
-if [ "$RUNMAKE" = "false" ]; then
-       cp -T -- "$TMP_FILE" "$KCONFIG_CONFIG"
-       echo "#"
-       echo "# merged configuration written to $KCONFIG_CONFIG (needs make)"
-       echo "#"
-       clean_up
-       exit
-fi
-
-# If we have an output dir, setup the O= argument, otherwise leave
-# it blank, since O=. will create an unnecessary ./source softlink
-OUTPUT_ARG=""
-if [ "$OUTPUT" != "." ] ; then
-       OUTPUT_ARG="O=$OUTPUT"
-fi
-
-
-# Use the merged file as the starting point for:
-# alldefconfig: Fills in any missing symbols with Kconfig default
-# allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
-make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
-
-
-# Check all specified config values took (might have missed-dependency issues)
-for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
-
-       REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
-       ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG")
-       if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
-               echo "Value requested for $CFG not in final .config"
-               echo "Requested value:  $REQUESTED_VAL"
-               echo "Actual value:     $ACTUAL_VAL"
-               echo ""
-       fi
-done
-
-clean_up
diff --git a/utils/tweak.in b/utils/tweak.in
deleted file mode 100644 (file)
index 9c2fdae..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/bash
-# Manipulate options in a .config file from the command line
-
-myname=${0##*/}
-
-# If no prefix forced, use the default @CONFIG_@
-CONFIG_="${CONFIG_-@CONFIG_@}"
-
-usage() {
-       cat >&2 <<EOL
-Manipulate options in a .config file from the command line.
-Usage:
-$myname options command ...
-commands:
-       --enable|-e option   Enable option
-       --disable|-d option  Disable option
-       --module|-m option   Turn option into a module
-       --set-str option string
-                            Set option to "string"
-       --set-val option value
-                            Set option to value
-       --undefine|-u option Undefine option
-       --state|-s option    Print state of option (n,y,m,undef)
-
-       --enable-after|-E beforeopt option
-                             Enable option directly after other option
-       --disable-after|-D beforeopt option
-                             Disable option directly after other option
-       --module-after|-M beforeopt option
-                             Turn option into module directly after other option
-
-       commands can be repeated multiple times
-
-options:
-       --file config-file   .config file to change (default .config)
-       --keep-case|-k       Keep next symbols' case (dont' upper-case it)
-
-$myname doesn't check the validity of the .config file. This is done at next
-make time.
-
-By default, $myname will upper-case the given symbol. Use --keep-case to keep
-the case of all following symbols unchanged.
-
-$myname uses '@CONFIG_@' as the default symbol prefix. Set the environment
-variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ...
-EOL
-       exit 1
-}
-
-checkarg() {
-       ARG="$1"
-       if [ "$ARG" = "" ] ; then
-               usage
-       fi
-       case "$ARG" in
-       ${CONFIG_}*)
-               ARG="${ARG/${CONFIG_}/}"
-               ;;
-       esac
-       if [ "$MUNGE_CASE" = "yes" ] ; then
-               ARG="`echo $ARG | tr a-z A-Z`"
-       fi
-}
-
-txt_append() {
-       local anchor="$1"
-       local insert="$2"
-       local infile="$3"
-       local tmpfile="$infile.swp"
-
-       # sed append cmd: 'a\' + newline + text + newline
-       cmd="$(printf "a\\%b$insert" "\n")"
-
-       sed -e "/$anchor/$cmd" "$infile" >"$tmpfile"
-       # replace original file with the edited one
-       mv "$tmpfile" "$infile"
-}
-
-txt_subst() {
-       local before="$1"
-       local after="$2"
-       local infile="$3"
-       local tmpfile="$infile.swp"
-
-       sed -e "s:$before:$after:" "$infile" >"$tmpfile"
-       # replace original file with the edited one
-       mv "$tmpfile" "$infile"
-}
-
-txt_delete() {
-       local text="$1"
-       local infile="$2"
-       local tmpfile="$infile.swp"
-
-       sed -e "/$text/d" "$infile" >"$tmpfile"
-       # replace original file with the edited one
-       mv "$tmpfile" "$infile"
-}
-
-set_var() {
-       local name=$1 new=$2 before=$3
-
-       name_re="^($name=|# $name is not set)"
-       before_re="^($before=|# $before is not set)"
-       if test -n "$before" && grep -Eq "$before_re" "$FN"; then
-               txt_append "^$before=" "$new" "$FN"
-               txt_append "^# $before is not set" "$new" "$FN"
-       elif grep -Eq "$name_re" "$FN"; then
-               txt_subst "^$name=.*" "$new" "$FN"
-               txt_subst "^# $name is not set" "$new" "$FN"
-       else
-               echo "$new" >>"$FN"
-       fi
-}
-
-undef_var() {
-       local name=$1
-
-       txt_delete "^$name=" "$FN"
-       txt_delete "^# $name is not set" "$FN"
-}
-
-if [ "$1" = "--file" ]; then
-       FN="$2"
-       if [ "$FN" = "" ] ; then
-               usage
-       fi
-       shift 2
-else
-       FN=.config
-fi
-
-if [ "$1" = "" ] ; then
-       usage
-fi
-
-MUNGE_CASE=yes
-while [ "$1" != "" ] ; do
-       CMD="$1"
-       shift
-       case "$CMD" in
-       --keep-case|-k)
-               MUNGE_CASE=no
-               continue
-               ;;
-       --refresh)
-               ;;
-       --*-after|-E|-D|-M)
-               checkarg "$1"
-               A=$ARG
-               checkarg "$2"
-               B=$ARG
-               shift 2
-               ;;
-       -*)
-               checkarg "$1"
-               shift
-               ;;
-       esac
-       case "$CMD" in
-       --enable|-e)
-               set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=y"
-               ;;
-
-       --disable|-d)
-               set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set"
-               ;;
-
-       --module|-m)
-               set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=m"
-               ;;
-
-       --set-str)
-               # sed swallows one level of escaping, so we need double-escaping
-               set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=\"${1//\"/\\\\\"}\""
-               shift
-               ;;
-
-       --set-val)
-               set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1"
-               shift
-               ;;
-       --undefine|-u)
-               undef_var "${CONFIG_}$ARG"
-               ;;
-
-       --state|-s)
-               if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then
-                       echo n
-               else
-                       V="$(grep "^${CONFIG_}$ARG=" $FN)"
-                       if [ $? != 0 ] ; then
-                               echo undef
-                       else
-                               V="${V/#${CONFIG_}$ARG=/}"
-                               V="${V/#\"/}"
-                               V="${V/%\"/}"
-                               V="${V//\\\"/\"}"
-                               echo "${V}"
-                       fi
-               fi
-               ;;
-
-       --enable-after|-E)
-               set_var "${CONFIG_}$B" "${CONFIG_}$B=y" "${CONFIG_}$A"
-               ;;
-
-       --disable-after|-D)
-               set_var "${CONFIG_}$B" "# ${CONFIG_}$B is not set" "${CONFIG_}$A"
-               ;;
-
-       --module-after|-M)
-               set_var "${CONFIG_}$B" "${CONFIG_}$B=m" "${CONFIG_}$A"
-               ;;
-
-       # undocumented because it ignores --file (fixme)
-       --refresh)
-               yes "" | make oldconfig
-               ;;
-
-       *)
-               usage
-               ;;
-       esac
-done
diff --git a/utils/tweak.in.patch b/utils/tweak.in.patch
deleted file mode 100644 (file)
index c4b8557..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-diff --git a/utils/tweak.in b/utils/tweak.in
---- a/utils/tweak.in
-+++ b/utils/tweak.in
-@@ -3,8 +3,8 @@
- myname=${0##*/}
--# If no prefix forced, use the default CONFIG_
--CONFIG_="${CONFIG_-CONFIG_}"
-+# If no prefix forced, use the default @CONFIG_@
-+CONFIG_="${CONFIG_-@CONFIG_@}"
- usage() {
-       cat >&2 <<EOL
-@@ -41,7 +41,7 @@
- By default, $myname will upper-case the given symbol. Use --keep-case to keep
- the case of all following symbols unchanged.
--$myname uses 'CONFIG_' as the default symbol prefix. Set the environment
-+$myname uses '@CONFIG_@' as the default symbol prefix. Set the environment
- variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ...
- EOL
-       exit 1