mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2024-12-26 14:00:56 +00:00
Invert the #define for output-sync: turn it off with NO_OUTPUT_SYNC
This commit is contained in:
parent
6c3e88e60f
commit
d2d44f76c4
12 changed files with 53 additions and 33 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,5 +1,19 @@
|
|||
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
|
||||
|
|
|
@ -321,6 +321,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
/* 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
|
||||
|
||||
|
|
|
@ -411,5 +411,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#define alloca(n) __ALLOCA(n)
|
||||
#endif
|
||||
|
||||
/* Output sync sypport */
|
||||
#define NO_OUTPUT_SYNC
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "VMS"
|
||||
|
|
|
@ -523,5 +523,3 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#ifdef HAVE_CYGWIN_SHELL
|
||||
#undef BATCH_MODE_ONLY_SHELL
|
||||
#endif
|
||||
|
||||
#define OUTPUT_SYNC
|
||||
|
|
|
@ -100,8 +100,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
/* 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%"
|
||||
|
|
|
@ -428,7 +428,6 @@ AS_CASE([$host],
|
|||
[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])
|
||||
])
|
||||
|
||||
|
|
12
job.c
12
job.c
|
@ -894,7 +894,7 @@ reap_children (int block, int err)
|
|||
}
|
||||
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)
|
||||
|
@ -930,10 +930,10 @@ reap_children (int block, int err)
|
|||
|
||||
/* 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
|
||||
|
@ -1267,12 +1267,12 @@ start_job_command (struct child *child)
|
|||
|
||||
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
|
||||
|
@ -1592,7 +1592,7 @@ start_job_command (struct child *child)
|
|||
/* 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)
|
||||
|
|
13
job.h
13
job.h
|
@ -37,7 +37,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
# 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
|
||||
|
@ -69,7 +73,6 @@ int same_stream (FILE *f1, FILE *f2);
|
|||
# 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 */
|
||||
|
@ -77,11 +80,7 @@ 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. */
|
||||
|
||||
|
|
12
main.c
12
main.c
|
@ -789,7 +789,7 @@ decode_output_sync_flags (void)
|
|||
|
||||
#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
|
||||
|
@ -814,7 +814,7 @@ prepare_mutex_handle_string (sync_handle_t handle)
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* OUTPUT_SYNC */
|
||||
#endif /* NO_OUTPUT_SYNC */
|
||||
|
||||
/*
|
||||
* HANDLE runtime exceptions by avoiding a requestor on the GUI. Capture
|
||||
|
@ -1263,7 +1263,7 @@ main (int argc, char **argv, char **envp)
|
|||
#ifdef MAKE_JOBSERVER
|
||||
" jobserver"
|
||||
#endif
|
||||
#ifdef OUTPUT_SYNC
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
" output-sync"
|
||||
#endif
|
||||
#ifdef MAKE_SYMLINKS
|
||||
|
@ -1560,7 +1560,11 @@ main (int argc, char **argv, char **envp)
|
|||
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
|
||||
|
|
|
@ -556,10 +556,6 @@ int strncasecmp (const char *s1, const char *s2, int n);
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef POSIX
|
||||
# define OUTPUT_SYNC
|
||||
#endif
|
||||
|
||||
#define OUTPUT_SYNC_NONE 0
|
||||
#define OUTPUT_SYNC_LINE 1
|
||||
#define OUTPUT_SYNC_TARGET 2
|
||||
|
|
16
output.c
16
output.c
|
@ -42,6 +42,12 @@ unsigned int stdio_traced = 0;
|
|||
|
||||
#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
|
||||
|
@ -178,13 +184,11 @@ set_append_mode (int fd)
|
|||
}
|
||||
|
||||
|
||||
#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. */
|
||||
|
@ -409,7 +413,7 @@ output_dump (struct output *out)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif /* OUTPUT_SYNC */
|
||||
#endif /* NO_OUTPUT_SYNC */
|
||||
|
||||
|
||||
/* Provide support for temporary files. */
|
||||
|
@ -555,7 +559,7 @@ output_close (struct output *out)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef OUTPUT_SYNC
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
output_dump (out);
|
||||
#endif
|
||||
|
||||
|
@ -571,7 +575,7 @@ output_close (struct output *out)
|
|||
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
|
||||
|
|
2
output.h
2
output.h
|
@ -44,7 +44,7 @@ void output_start (void);
|
|||
/* 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);
|
||||
|
|
Loading…
Reference in a new issue