Invert the #define for output-sync: turn it off with NO_OUTPUT_SYNC
authorPaul Smith <psmith@gnu.org>
Sat, 21 Sep 2013 21:37:59 +0000 (17:37 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 21 Sep 2013 21:37:59 +0000 (17:37 -0400)
12 files changed:
ChangeLog
config.ami.template
config.h-vms.template
config.h.W32.template
configh.dos.template
configure.ac
job.c
job.h
main.c
makeint.h
output.c
output.h

index cc9ed4eeef7006711bf223a3567dc49a97a86f2a..5adb84c9406b0dd20b2acf6bff41d34224d63c35 100644 (file)
--- a/ChangeLog
+++ b/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
index c31eea4e75b012de3c8a4a123dc0fe6ab8db9d05..d9163c053eac1d39bf47fe773ef2c9cfb9e18759 100644 (file)
@@ -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
 
index 7b180cc5e89bb7d8d9b7b290df40c9c85726d665..3b4bd3b5d226436e50ef3360f112364a1b4104ce 100644 (file)
@@ -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"
index dc041bd33cef95b431a4995b6063c94caf8b20f4..f7aed9008b1d60c705f667c189edebac13bec3ef 100644 (file)
@@ -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
index 63af880eb24ce025b64ea40a88ce074bf0c25e56..797e234deab7b2820cb9abf154f331f820922712 100644 (file)
@@ -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%"
index 09b5ce25a9cba8d4c612b5da8b97f489e108602c..893ef0cfcb79aa0537ef7d1ef6b27a592f7fbf45 100644 (file)
@@ -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])
   ])
 
diff --git a/job.c b/job.c
index 79d25ee36e04fe82e00973642d3c7fd950b61ed0..12b0ff656826a1fa040540f772c9b48e84b2461f 100644 (file)
--- a/job.c
+++ b/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)
diff --git a/job.h b/job.h
index c9cb7fa35e990524582f102a15674717dee69b36..29652fce7092f9a03cf9f8b06e5880d7a7430648 100644 (file)
--- a/job.h
+++ b/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.  */
 
diff --git a/main.c b/main.c
index f0a7174dbb9951265bcdaedfa435abb8525d85f2..a180ee9c97198b4e505878553a75ecbcfa647663 100644 (file)
--- a/main.c
+++ b/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
index dac58587afca091268eeffe24ba493463b658d83..f48c08734c7422c938e020b40f956ee248d0085b 100644 (file)
--- a/makeint.h
+++ b/makeint.h
@@ -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
index 32334ebd722e21b6e4eb0ea690c09e1f9ed98f42..f58b8166037ebcf5e5e31294daa0a21b6e51f8e5 100644 (file)
--- a/output.c
+++ b/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)
 }
 \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.  */
@@ -409,7 +413,7 @@ output_dump (struct output *out)
         }
     }
 }
-#endif /* OUTPUT_SYNC */
+#endif /* NO_OUTPUT_SYNC */
 \f
 
 /* 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
index 5fef436cef625f901fcf6f889840f1bc8401a24f..e0d5daaa18d06ea0038fa227e951ad0995d7d6c9 100644 (file)
--- a/output.h
+++ b/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);