* main.c(main): Disable output sync without parallel builds.
diff --git a/main.c b/main.c
index 62ed7a8..22af601 100644
--- a/main.c
+++ b/main.c
@@ -1464,13 +1464,6 @@
decode_env_switches (STRING_SIZE_TUPLE ("MAKEFLAGS"));
- /* In output sync mode we need to sync any output generated by reading the
- makefiles, such as in $(info ...) or stderr from $(shell ...) etc. */
-
- syncing = make_sync.syncout = (output_sync == OUTPUT_SYNC_LINE
- || output_sync == OUTPUT_SYNC_TARGET);
- OUTPUT_SET (&make_sync);
-
#if 0
/* People write things like:
MFLAGS="CC=gcc -pipe" "CFLAGS=-g"
@@ -1478,6 +1471,13 @@
decode_env_switches (STRING_SIZE_TUPLE ("MFLAGS"));
#endif
+ /* In output sync mode we need to sync any output generated by reading the
+ makefiles, such as in $(info ...) or stderr from $(shell ...) etc. */
+
+ syncing = make_sync.syncout = (output_sync == OUTPUT_SYNC_LINE
+ || output_sync == OUTPUT_SYNC_TARGET);
+ OUTPUT_SET (&make_sync);
+
decode_switches (argc, (const char **)argv, 0);
/* Set a variable specifying whether stdout/stdin is hooked to a TTY. */
@@ -2053,6 +2053,17 @@
}
#endif
+ /* If we're not using parallel jobs, then we don't need output sync.
+ This is so people can enable output sync in GNUMAKEFLAGS or similar, but
+ not have it take effect unless parallel builds are enabled. */
+ if (syncing && job_slots == 1)
+ {
+ OUTPUT_UNSET ();
+ output_close (&make_sync);
+ syncing = 0;
+ output_sync = OUTPUT_SYNC_NONE;
+ }
+
#ifndef MAKE_SYMLINKS
if (check_symlink_flag)
{