summaryrefslogtreecommitdiff
path: root/kconfig/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'kconfig/conf.c')
-rw-r--r--kconfig/conf.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/kconfig/conf.c b/kconfig/conf.c
index abd5238..a0db354 100644
--- a/kconfig/conf.c
+++ b/kconfig/conf.c
@@ -475,6 +475,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);
@@ -486,6 +487,11 @@ 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:
@@ -612,13 +618,14 @@ int main(int ac, char **av)
}
if (sync_kconfig) {
- if (conf_get_changed()) {
- name = getenv("KCONFIG_NOSILENTUPDATE");
- if (name && *name) {
+ name = getenv("KCONFIG_NOSILENTUPDATE");
+ if (name && *name) {
+ if (conf_get_changed()) {
fprintf(stderr,
"\n*** The configuration requires explicit update.\n\n");
return 1;
}
+ no_conf_write = 1;
}
}
@@ -663,30 +670,33 @@ int main(int ac, char **av)
break;
}
- if (sync_kconfig) {
- /* syncconfig is used during the build so we shall update autoconf.
- * All other commands are only used to generate a config.
- */
- if (conf_get_changed() && conf_write(NULL)) {
- fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
- exit(1);
- }
- /* In crosstool-NG, we do not use the autoconf stuff
- if (conf_write_autoconf()) {
- fprintf(stderr, "\n*** Error during update of the configuration.\n\n");
- return 1;
- } */
- } else if (input_mode == savedefconfig) {
+ if (input_mode == savedefconfig) {
if (conf_write_defconfig(defconfig_file)) {
fprintf(stderr, "n*** Error while saving defconfig to: %s\n\n",
defconfig_file);
return 1;
}
} else if (input_mode != listnewconfig) {
- if (conf_write(NULL)) {
+ if (!no_conf_write && conf_write(NULL)) {
fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
exit(1);
}
+
+ /*
+ * Create auto.conf if it does not exist.
+ * This prevents GNU Make 4.1 or older from emitting
+ * "include/config/auto.conf: No such file or directory"
+ * in the top-level Makefile
+ *
+ * syncconfig always creates or updates auto.conf because it is
+ * used during the build.
+ */
+ /* In crosstool-NG, we do not use the autoconf stuff
+ if (conf_write_autoconf(sync_kconfig) && sync_kconfig) {
+ fprintf(stderr,
+ "\n*** Error during sync of the configuration.\n\n");
+ return 1;
+ }*/
}
return 0;
}