2013-09-21 Paul Smith <psmith@gnu.org>
+ Invert the output-sync #define to NO_OUTPUT_SYNC
+
+ * configure.ac: Don't set OUTPUT_SYNC.
+ * makeint.h: Ditto.
+ * main.c: Use NO_OUTPUT_SYNC instead of OUTPUT_SYNC.
+ * output.c: Ditto.
+ * output.h: Ditto.
+ * job.h: Ditto.
+ * job.c: Ditto.
+ * config.ami.template: Set NO_OUTPUT_SYNC.
+ * config.h-vms.template: Ditto.
+ * config.h.W32.template: Ditto.
+ * configh.dos.template: Ditto.
+
Output generated while reading makefiles should be synced.
* main.c (make_sync): Define a context for syncing while reading
/* Define if you have the sun library (-lsun). */
/* #undef HAVE_LIBSUN */
+/* Output sync sypport */
+#define NO_OUTPUT_SYNC
+
/* Define for Case Insensitve behavior */
#define HAVE_CASE_INSENSITIVE_FS
#define alloca(n) __ALLOCA(n)
#endif
+/* Output sync sypport */
+#define NO_OUTPUT_SYNC
+
/* Build host information. */
#define MAKE_HOST "VMS"
#ifdef HAVE_CYGWIN_SHELL
#undef BATCH_MODE_ONLY_SHELL
#endif
-
-#define OUTPUT_SYNC
/* Define to the version of this package. */
#define PACKAGE_VERSION "%VERSION%"
-/* Define to 1 if the C compiler supports function prototypes. */
-#define PROTOTYPES 1
+/* Output sync sypport */
+#define NO_OUTPUT_SYNC
/* Version number of package */
#define VERSION "%VERSION%"
[AM_CONDITIONAL([WINDOWSENV], [true])
w32_target_env=yes
AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
- AC_DEFINE([OUTPUT_SYNC], [1], [Support synchronized output])
AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
])
}
else
{
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
/* If we're sync'ing per line, write the previous line's
output before starting the next one. */
if (output_sync == OUTPUT_SYNC_LINE)
/* When we get here, all the commands for c->file are finished. */
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
/* Synchronize any remaining parallel output. */
output_dump (&c->output);
-#endif /* OUTPUT_SYNC */
+#endif
/* At this point c->file->update_status is success or failed. But
c->file->command_state is still cs_running if all the commands
OUTPUT_SET (&child->output);
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
if (! child->output.syncout)
/* We don't want to sync this command: to avoid misordered
output ensure any already-synced content is written. */
output_dump (&child->output);
-#endif /* OUTPUT_SYNC */
+#endif
/* Print the command if appropriate. */
if (just_print_flag || trace_flag
/* make sure CreateProcess() has Path it needs */
sync_Path_environment ();
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
/* Divert child output if output_sync in use. Don't capture
recursive make output unless we are synchronizing "make" mode. */
if (child->output.syncout)
# define CLOSE_ON_EXEC(_d) (void) fcntl ((_d), F_SETFD, FD_CLOEXEC)
#endif
-#ifdef OUTPUT_SYNC
+#ifdef NO_OUTPUT_SYNC
+# define RECORD_SYNC_MUTEX(m) \
+ error (NILF, \
+ _("-O[TYPE] (--output-sync[=TYPE]) is not configured for this build."));
+#else
# ifdef WINDOWS32
/* For emulations in w32/compat/posixfcn.c. */
# define F_GETFD 1
# define RECORD_SYNC_MUTEX(m) record_sync_mutex(m)
void record_sync_mutex (const char *str);
void prepare_mutex_handle_string (intptr_t hdl);
-
# else /* !WINDOWS32 */
typedef int sync_handle_t; /* file descriptor */
# define RECORD_SYNC_MUTEX(m) (void)(m)
# endif
-#else /* !OUTPUT_SYNC */
-#define RECORD_SYNC_MUTEX(m) \
- error (NILF, \
- _("-O[TYPE] (--output-sync[=TYPE]) is not configured for this build."));
-#endif /* OUTPUT_SYNC */
+#endif /* !OUTPUT_SYNC */
/* Structure describing a running or dead child process. */
#ifdef WINDOWS32
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
/* This is called from start_job_command when it detects that
output_sync option is in effect. The handle to the synchronization
}
}
-#endif /* OUTPUT_SYNC */
+#endif /* NO_OUTPUT_SYNC */
/*
* HANDLE runtime exceptions by avoiding a requestor on the GUI. Capture
#ifdef MAKE_JOBSERVER
" jobserver"
#endif
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
" output-sync"
#endif
#ifdef MAKE_SYMLINKS
error (NILF, _("warning: -jN forced in submake: disabling jobserver mode."));
}
#ifndef WINDOWS32
-#define FD_OK(_f) ((fcntl ((_f), F_GETFD) != -1) || (errno != EBADF))
+#ifdef HAVE_FCNTL
+# define FD_OK(_f) ((fcntl ((_f), F_GETFD) != -1) || (errno != EBADF))
+#else
+# define FD_OK(_f) 1
+#endif
/* Create a duplicate pipe, that will be closed in the SIGCHLD
handler. If this fails with EBADF, the parent has closed the pipe
on us because it didn't think we were a submake. If so, print a
# endif
#endif
-#ifdef POSIX
-# define OUTPUT_SYNC
-#endif
-
#define OUTPUT_SYNC_NONE 0
#define OUTPUT_SYNC_LINE 1
#define OUTPUT_SYNC_TARGET 2
#define OUTPUT_ISSET(_out) ((_out)->out >= 0 || (_out)->err >= 0)
+#ifdef HAVE_FCNTL
+# define STREAM_OK(_s) ((fcntl (fileno (_s), F_GETFD) != -1) || (errno != EBADF))
+#else
+# define STREAM_OK(_s) 1
+#endif
+
/* I really want to move to gnulib. However, this is a big undertaking
especially for non-UNIX platforms: how to get bootstrapping to work, etc.
I don't want to take the time to do it right now. Use a hack to get a
}
\f
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
/* Semaphore for use in -j mode with output_sync. */
static sync_handle_t sync_handle = -1;
-#define STREAM_OK(_s) ((fcntl (fileno (_s), F_GETFD) != -1) || (errno != EBADF))
-
#define FD_NOT_EMPTY(_f) ((_f) != OUTPUT_NONE && lseek ((_f), 0, SEEK_END) > 0)
/* Set up the sync handle. Disables output_sync on error. */
}
}
}
-#endif /* OUTPUT_SYNC */
+#endif /* NO_OUTPUT_SYNC */
\f
/* Provide support for temporary files. */
return;
}
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
output_dump (out);
#endif
void
output_start ()
{
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
if (output_context && output_context->syncout && ! OUTPUT_ISSET(output_context))
setup_tmpfile (output_context);
#endif
/* Show a message on stdout or stderr. Will start the output if needed. */
void outputs (int is_err, const char *msg);
-#ifdef OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
int output_tmpfd (void);
/* Dump any child output content to stdout, and reset it. */
void output_dump (struct output *out);