]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
kconfig: write Kconfig files to autoconf.cmd in order
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 2 Feb 2024 15:58:04 +0000 (00:58 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 19 Feb 2024 09:20:40 +0000 (18:20 +0900)
Currently, include/config/autoconf.cmd saves included Kconfig files in
reverse order. While this is not a big deal, it is inconsistent with
other *.cmd files generated by fixdep.

Output the included Kconfig files in the included order.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/confdata.c
scripts/kconfig/lkc.h
scripts/kconfig/parser.y
scripts/kconfig/util.c

index 7f0aa39b68c1e266113a6b1221ee9fde5cf2ab26..f6a96fdddb7edab00480e5b0d133f964bdceb4c6 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "lkc.h"
 
+struct gstr autoconf_cmd;
+
 /* return true if 'path' exists, false otherwise */
 static bool is_present(const char *path)
 {
@@ -972,7 +974,6 @@ end_check:
 static int conf_write_autoconf_cmd(const char *autoconf_name)
 {
        char name[PATH_MAX], tmp[PATH_MAX];
-       struct file *file;
        FILE *out;
        int ret;
 
@@ -993,9 +994,7 @@ static int conf_write_autoconf_cmd(const char *autoconf_name)
                return -1;
        }
 
-       fprintf(out, "deps_config := \\\n");
-       for (file = file_list; file; file = file->next)
-               fprintf(out, "\t%s \\\n", file->name);
+       fputs(str_get(&autoconf_cmd), out);
 
        fprintf(out, "\n%s: $(deps_config)\n\n", autoconf_name);
 
index 5cdc8f5e6446ab55e42ce21dfbe728b0ab22aee7..8616ad83be6da14f28d743b5218b377e00dd598b 100644 (file)
@@ -40,6 +40,7 @@ int zconf_lineno(void);
 const char *zconf_curname(void);
 
 /* confdata.c */
+extern struct gstr autoconf_cmd;
 const char *conf_get_configname(void);
 void set_all_choice_values(struct symbol *csym);
 
index 625224973c5118f13999a47e45295ef80b46b2e9..611038c502fc9bc3bd68e669b5d57c07b98e94b9 100644 (file)
@@ -480,6 +480,10 @@ void conf_parse(const char *name)
        struct symbol *sym;
        int i;
 
+       autoconf_cmd = str_new();
+
+       str_printf(&autoconf_cmd, "deps_config := \\\n");
+
        zconf_initscan(name);
 
        _menu_init();
index 92e5b2b9761d70966279ac0159769adf580110fa..958543bb0a37a936349be2e8c509d8fc3ab40557 100644 (file)
@@ -25,6 +25,9 @@ struct file *file_lookup(const char *name)
        file->name = xstrdup(name);
        file->next = file_list;
        file_list = file;
+
+       str_printf(&autoconf_cmd, "\t%s \\\n", name);
+
        return file;
 }