kconfig: convert to SPDX License Identifier
[carl9170fw.git] / config / conf.c
index 130335f371ec1c2ffc61404c8fd2d6812ae9a88b..89d87de2c93b8acb2d1c976d7f1c2edaa6ab77d5 100644 (file)
@@ -1,6 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
- * Released under the terms of the GNU GPL v2.0.
  */
 
 #include <ctype.h>
@@ -31,7 +31,6 @@ enum input_mode {
        defconfig,
        savedefconfig,
        listnewconfig,
-       oldnoconfig,
 };
 static enum input_mode input_mode = oldaskconfig;
 
@@ -454,7 +453,6 @@ static struct option long_opts[] = {
        {"alldefconfig",    no_argument,       NULL, alldefconfig},
        {"randconfig",      no_argument,       NULL, randconfig},
        {"listnewconfig",   no_argument,       NULL, listnewconfig},
-       {"noconfig",        no_argument,       NULL, oldnoconfig},
        {NULL, 0, NULL, 0}
 };
 
@@ -483,6 +481,7 @@ int main(int ac, char **av)
        int opt;
        const char *name, *defconfig_file = NULL /* gcc uninit */;
        struct stat tmpstat;
+       int no_conf_write = 0;
 
        tty_stdio = isatty(0) && isatty(1);
 
@@ -493,6 +492,14 @@ int main(int ac, char **av)
                }
                input_mode = (enum input_mode)opt;
                switch (opt) {
+               case syncconfig:
+                       /*
+                        * syncconfig is invoked during the build stage.
+                        * Suppress distracting "configuration written to ..."
+                        */
+                       conf_set_message_callback(NULL);
+                        sync_kconfig = 1;
+                       break
                case defconfig:
                case savedefconfig:
                        defconfig_file = optarg;
@@ -529,7 +536,6 @@ int main(int ac, char **av)
                case allmodconfig:
                case alldefconfig:
                case listnewconfig:
-               case oldnoconfig:
                        break;
                case '?':
                        conf_usage(progname);
@@ -563,7 +569,6 @@ int main(int ac, char **av)
        case oldaskconfig:
        case oldconfig:
        case listnewconfig:
-       case oldnoconfig:
                conf_read(NULL);
                break;
        case allnoconfig:
@@ -632,7 +637,6 @@ int main(int ac, char **av)
                /* fall through */
        case oldconfig:
        case listnewconfig:
-       case oldnoconfig:
                /* Update until a loop caused no more changes */
                do {
                        conf_cnt = 0;
@@ -651,7 +655,7 @@ int main(int ac, char **av)
                /*
                 * build so we shall update autoconf.
                 */
-               if (conf_write(NULL)) {
+               if (!no_conf_write && conf_write(NULL)) {
                        fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
                        exit(1);
                }