Changes for GNU make 3.75.93.
authorPaul Smith <psmith@gnu.org>
Fri, 5 Sep 1997 21:01:49 +0000 (21:01 +0000)
committerPaul Smith <psmith@gnu.org>
Fri, 5 Sep 1997 21:01:49 +0000 (21:01 +0000)
ChangeLog
Makefile.DOS.template
Makefile.am
configure.in
getopt.c
job.c

index 314074aa109d5634de8013333e5d48845ab9f04a..eaf8c0b0f349d9cfa898049abb6966ac596f9f0b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,39 @@
+Fri Aug 29 02:01:27 1997  Paul D. Smith  <psmith@baynetworks.com>
+
+       * Version 3.75.93.
+
+Thu Aug 28 19:39:06 1997  Rob Tulloh  <rob_tulloh@tivoli.com>
+
+       * job.c (exec_command): [WINDOWS32] If exec_command() is invoked
+       from main() to re-exec make, the call to execvp() would
+       incorrectly return control to parent shell before the exec'ed
+       command could run to completion. I believe this is a feature of
+       the way that execvp() is implemented on top of WIN32 APIs. To
+       alleviate the problem, use the supplied process launch function in
+       the sub_proc library and suspend the parent process until the
+       child process has run.  When the child exits, exit the parent make
+       with the exit code of the child make.
+
+Thu Aug 28 17:04:47 1997  Paul D. Smith  <psmith@baynetworks.com>
+
+       * Makefile.DOS.template (distdir): Fix a line that got wrapped in
+       email.
+
+       * Makefile.am (loadavg): Give the necessary cmdline options when
+       linking loadavg.
+
+       * configure.in: Check for pstat_getdynamic for getloadvg on HP.
+
+       * job.c (start_job_command): [VMS,_AMIGA] Don't perform empty
+       command optimization on these systems; it doesn't make sense.
+
 Wed Aug 27 17:09:32 1997  Paul D. Smith  <psmith@baynetworks.com>
 
         * Version 3.75.92
 
 Tue Aug 26 11:59:15 1997  Paul D. Smith  <psmith@baynetworks.com>
-       * main.c (print_version): Add 97 to copyright years.
+
+       * main.c (print_version): Add '97 to copyright years.
 
        * read.c (do_define): Check the length of the array before looking
        at a particular offset.
index e2f8135897ac3b17b692a2713b3a1237f75b2847..4c6a9db3499230459f242a693d3594591a7b4182 100644 (file)
@@ -296,9 +296,7 @@ distdir: $(DISTFILES)
        rm -rf $(distdir)
        mkdir $(distdir)
        -chmod 777 $(distdir)
-       @for file in $(DISTFILES); do    d=$(srcdir);    test -f $(distdir)/$$file    || ln $$d/$$file $(distdir)/$$file 2> /dev/null    || cp -p $$d/$$file $(distdir)/$$file;  done
-       for subdir in $(SUBDIRS); do   test -d $(distdir)/$$subdir   || mkdir $(distdir)/$$subdir   || exit 1;   chmod 777 $(distdir)/$$subdir;   (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir)      || exit
-1;  done
+       @for file in $(DISTFILES); do d=$(srcdir); test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; for subdir in $(SUBDIRS); do test -d $(distdir)/$$subdir || mkdir $(distdir)/$$subdir || exit 1; chmod 777 $(distdir)/$$subdir; (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir) || exit 1; done
        $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
        $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
 alloca.o alloca.lo: alloca.c config.h
index 3a8451e89b159bcd2e6375352ad43e3cf25a7129..58bdc953b6beb9026fffc1b452d9580516dbcab4 100644 (file)
@@ -48,7 +48,7 @@ check-local: check-loadavg check-regression
 #
 loadavg: loadavg.c config.h
        @rm -f loadavg
-       $(LINK) -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
+       $(LINK) -I. -I$(srcdir) -DHAVE_CONFIG_H -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
 # We copy getloadavg.c into a different file rather than compiling it
 # directly because some compilers clobber getloadavg.o in the process.
 loadavg.c: getloadavg.c
index 862e538bd642025d17ce62575c95799577a14cd7..7b4e5ca5cdf9499377a777b062ffa3f6d49bc450 100644 (file)
@@ -3,7 +3,7 @@ AC_REVISION([$Id$])
 AC_PREREQ(2.12)dnl             dnl Minimum Autoconf version required.
 AC_INIT(vpath.c)dnl            dnl A distinctive file to look for in srcdir.
 
-AM_INIT_AUTOMAKE(make, 3.75.92)
+AM_INIT_AUTOMAKE(make, 3.75.93)
 AM_CONFIG_HEADER(config.h)
 AC_CONFIG_SUBDIRS(glob)
 
@@ -45,7 +45,7 @@ changequote([,])dnl
 fi
 AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
 
-AC_CHECK_FUNCS(memmove psignal mktemp \
+AC_CHECK_FUNCS(memmove psignal mktemp pstat_getdynamic \
               dup2 getcwd sigsetmask getgroups setlinebuf \
               seteuid setegid setreuid setregid strerror strsignal)
 AC_CHECK_SYMBOL(sys_siglist)
index c6b134537c73da8b49272f8a655e04cd3894538d..7b56b57eb1022bfbf28452f70302d87920ad8c62 100644 (file)
--- a/getopt.c
+++ b/getopt.c
@@ -79,7 +79,7 @@ USA.  */
 #endif
 #endif
 
-#if defined (_WINDOWS32) && !defined (__CYGWIN32__)
+#if defined (WINDOWS32) && !defined (__CYGWIN32__)
 /* It's not Unix, really.  See?  Capital letters.  */
 #include <windows.h>
 #define getpid() GetCurrentProcessId()
diff --git a/job.c b/job.c
index 09b946939b208f619f370415b3324bfd149127d0..2227bef7a3ad8722c7975b282b570adcb7cf6493 100644 (file)
--- a/job.c
+++ b/job.c
@@ -787,6 +787,7 @@ start_job_command (child)
   /* Optimize an empty command.  People use this for timestamp rules,
      and forking a useless shell all the time leads to inefficiency. */
 
+#if !defined(VMS) && !defined(_AMIGA)
   if (
 #ifdef __MSDOS__
       unixy_shell      /* the test is complicated and we already did it */
@@ -800,6 +801,7 @@ start_job_command (child)
       set_command_state (child->file, cs_running);
       goto next_command;
     }
+#endif  /* !VMS && !_AMIGA */
 
   /* Tell update_goal_chain that a command has been started on behalf of
      this target.  It is important that this happens here and not in
@@ -827,9 +829,7 @@ start_job_command (child)
   fflush (stderr);
 
 #ifndef VMS
-#ifndef WINDOWS32
-#ifndef _AMIGA
-#ifndef __MSDOS__
+#if !defined(WINDOWS32) && !defined(_AMIGA) && !defined(__MSDOS__)
 
   /* Set up a bad standard input that reads from a broken pipe.  */
 
@@ -857,9 +857,7 @@ start_job_command (child)
        }
     }
 
-#endif /* !AMIGA */
-#endif /* !WINDOWS32 */
-#endif /* !__MSDOS__ */
+#endif /* !WINDOWS32 && !_AMIGA && !__MSDOS__ */
 
   /* Decide whether to give this child the `good' standard input
      (one that points to the terminal or whatever), or the `bad' one
@@ -869,7 +867,7 @@ start_job_command (child)
   if (child->good_stdin)
     good_stdin_used = 1;
 
-#endif /* Not VMS */
+#endif /* !VMS */
 
   child->deleted = 0;
 
@@ -1602,11 +1600,66 @@ exec_command (argv, envp)
      char **argv, **envp;
 {
 #ifdef VMS
-    /* Run the program.  */
-    execve (argv[0], argv, envp);
-    perror_with_name ("execve: ", argv[0]);
-    _exit (EXIT_FAILURE);
+  /* Run the program.  */
+  execve (argv[0], argv, envp);
+  perror_with_name ("execve: ", argv[0]);
+  _exit (EXIT_FAILURE);
 #else
+#ifdef WINDOWS32
+  HANDLE hPID;
+  HANDLE hWaitPID;
+  int err = 0;
+  int exit_code = EXIT_FAILURE;
+
+  /* make sure CreateProcess() has Path it needs */
+  sync_Path_environment();
+
+  /* launch command */
+  hPID = process_easy(argv, envp);
+
+  /* make sure launch ok */
+  if (hPID == INVALID_HANDLE_VALUE)
+    {
+      int i;
+      fprintf(stderr,
+              "process_easy() failed failed to launch process (e=%d)\n",
+              process_last_err(hPID));
+      for (i = 0; argv[i]; i++)
+          fprintf(stderr, "%s ", argv[i]);
+      fprintf(stderr, "\nCounted %d args in failed launch\n", i);
+      exit(EXIT_FAILURE);
+    }
+
+  /* wait and reap last child */
+  while (hWaitPID = process_wait_for_any())
+    {
+      /* was an error found on this process? */
+      err = process_last_err(hWaitPID);
+
+      /* get exit data */
+      exit_code = process_exit_code(hWaitPID);
+
+      if (err)
+          fprintf(stderr, "make (e=%d, rc=%d): %s",
+                  err, exit_code, map_windows32_error_to_string(err));
+
+      /* cleanup process */
+      process_cleanup(hWaitPID);
+
+      /* expect to find only last pid, warn about other pids reaped */
+      if (hWaitPID == hPID)
+          break;
+      else
+          fprintf(stderr,
+                  "make reaped child pid %d, still waiting for pid %d\n",
+                  hWaitPID, hPID);
+    }
+
+  /* return child's exit code as our exit code */
+  exit(exit_code);
+
+#else  /* !WINDOWS32 */
+
   /* Be the user, permanently.  */
   child_access ();
 
@@ -1658,18 +1711,19 @@ exec_command (argv, envp)
     }
 
   _exit (127);
+#endif /* !WINDOWS32 */
 #endif /* !VMS */
 }
 #else /* On Amiga */
 void exec_command (argv)
      char **argv;
 {
-    MyExecute (argv);
+  MyExecute (argv);
 }
 
 void clean_tmp (void)
 {
-    DeleteFile (amiga_bname);
+  DeleteFile (amiga_bname);
 }
 
 #endif /* On Amiga */