make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU make 3.81beta4 released


From: Markus Mauhart
Subject: Re: GNU make 3.81beta4 released
Date: Sun, 5 Feb 2006 18:11:26 +0100

Hi all,


I have put together a few suggestions for files ...

    ChangeLog
    README.W32.template
    README.cvs
    config.h.W32.template
    job.c
    w32/subproc/sub_proc.c


Changelog - I cant remember to submit changes for make_msvc_net2003.vcproj,
but IIRC J.Grant recently added pre-build commands.


W.r.t. the docs, README.cvs contained errors from my previous addition.
I have fixed it and aditionally made README.W32.template again self-contained
(removed "must read README.cvs first").


I have added some defines to config.h.W32.template.


job.c - added "goto error;" to the existing w32 error handling, because ...
1) ... it is also used in other error handling code paths
2) ... without it, the existing w32 error handling would result first
   in one job slot lost and later in gmake hanging in a loop forever.


w32/subproc/sub_proc.c
* Added error handling to functions process_signal, process_last_err and
  process_exit_code, to avoid accessing invalid pointers.
* Commented out the other similar but unused process_xxx- functions, because
  there is the same risk of accessing invalid pointers.
* process_begin(..): Removed no-ops looking like (safety-?) checks.



Best Regards,
Markus.



--- ChangeLog   2006-02-02 21:22:02.187500000 +0100
+++ ChangeLog.mau       2006-02-05 17:40:54.562500000 +0100
@@ -11,7 +11,7 @@
        * README.cvs: Applied patch #4786 from
        Markus Mauhart <address@hidden>.
        * make_msvc_net2003.vcproj [WINDOWS32]: New version from
-       Markus Mauhart <address@hidden>.
+       J. Grant <address@hidden>.

        * main.c: Update the copyright year in the version output.
        * prepare_w32.bat: Remove this file from the distribution.
--- README.W32.template 2006-02-02 21:22:02.296875000 +0100
+++ README.W32.template.mau     2006-02-05 16:19:25.968750000 +0100
@@ -13,11 +13,12 @@
 Do this first, regardless of the build method you choose:
 ---------------------------------------------------------

- 0. If your sources come from CVS, read the Windows-specific section of
-    README.cvs.
+ 0. If your sources come from CVS, then make sure that there exists no file
+    config.h that stems from some ./configure.

  1. At the Windows command prompt run:

+       if not exist NMakefile copy NMakefile.template NMakefile
        if not exist config.h copy config.h.W32 config.h

     Then edit config.h to your liking (especially the few shell-related
--- README.cvs  2006-02-02 21:22:02.328125000 +0100
+++ README.cvs.mau      2006-02-05 16:34:56.843750000 +0100
@@ -96,23 +96,11 @@
 Windows builds from CVS
 -----------------------

-IF you have managed to successfully perform the 1st two or three steps of
-the general build procedure as explained above:
-
-  $ autoreconf [-i] -s
-  $ ./configure
- [$ make update]
-
-THEN proceed with file README.W32.
-
-ELSE ignore the general build procedure, instead execute the following
-command lines at a Windows command prompt:
-
-  if not exist README.W32 copy README.W32.template README.W32
-  if not exist config.h.W32 copy config.h.W32.template config.h.W32
-  if not exist NMakefile copy NMakefile.template NMakefile
-
-Now proceed with file README.W32.
+If you don't have or don't want to use a UNIX emulation like CYGWIN to
+successfully run the general build procedure ("Building From CVS"), then
+rename file README.W32.template to README.W32 and follow its instructions.
+Otherwise you may want to use option '--enable-case-insensitive-file-system'
+for ./configure.


 Appendix A - For The Brave
--- config.h.W32.template       2006-02-02 21:22:02.375000000 +0100
+++ config.h.W32.template.mau   2006-02-05 15:27:21.015625000 +0100
@@ -198,13 +198,13 @@
 /*#define HAVE_STDINT_H 1*/

 /* Define to 1 if you have the <stdlib.h> header file. */
-/* #define HAVE_STDLIB_H 1*/
+#define HAVE_STDLIB_H 1

 /* Define to 1 if you have the `strcasecmp' function. */
 /* #undef HAVE_STRCASECMP */

 /* Define to 1 if you have the `strchr' function. */
-/* #define HAVE_STRCHR 1 */
+#define HAVE_STRCHR 1

 /* Define to 1 if you have the `strcoll' function and it is properly defined.
    */
@@ -308,7 +308,7 @@
 #define PACKAGE "%PACKAGE%"

 /* Define to 1 if the C compiler supports function prototypes. */
-/*#define PROTOTYPES 1*/
+#define PROTOTYPES 1

 /* Define as the return type of signal handlers (`int' or `void'). */
 #define RETSIGTYPE void
--- job.c       2006-02-02 21:22:02.531250000 +0100
+++ job.c.mau   2006-02-05 12:35:01.625000000 +0100
@@ -1387,6 +1387,7 @@ start_job_command (struct child *child)
                for (i = 0; argv[i]; i++)
                  fprintf(stderr, "%s ", argv[i]);
                fprintf(stderr, _("\nCounted %d args in failed launch\n"), i);
+        goto error;
       }
   }
 #endif /* WINDOWS32 */
--- w32/subproc/sub_proc.c      2006-02-02 21:22:02.796875000 +0100
+++ w32/subproc/sub_proc.c.mau  2006-02-05 14:58:14.328125000 +0100
@@ -173,29 +173,39 @@ process_wait_for_any(void)
 }

 long
-process_errno(HANDLE proc)
-{
-       return (((sub_process *)proc)->lerrno);
-}
-
-long
 process_signal(HANDLE proc)
 {
+       if (proc == INVALID_HANDLE_VALUE) return 0;
        return (((sub_process *)proc)->signal);
 }

        long
 process_last_err(HANDLE proc)
 {
+       if (proc == INVALID_HANDLE_VALUE) return ERROR_INVALID_HANDLE;
        return (((sub_process *)proc)->last_err);
 }

        long
 process_exit_code(HANDLE proc)
 {
+       if (proc == INVALID_HANDLE_VALUE) return EXIT_FAILURE;
        return (((sub_process *)proc)->exit_code);
 }

+/*
+2006-02:
+All the following functions are currently unused.
+All of them would crash gmake if called with argument INVALID_HANDLE_VALUE.
+Hence whoever wants to use one of this functions must invent and implement
+a reasonable error handling for this function.
+
+long
+process_errno(HANDLE proc)
+{
+       return (((sub_process *)proc)->lerrno);
+}
+
        char *
 process_outbuf(HANDLE proc)
 {
@@ -228,7 +238,7 @@ process_pipes(HANDLE proc, int pipes[3])
        pipes[2] = ((sub_process *)proc)->sv_stderr[0];
        return;
 }
-
+*/

        HANDLE
 process_init()
@@ -379,7 +389,7 @@ find_file(char *exec_path, LPOFSTRUCT fi
 /*
  * Description:   Create the child process to be helped
  *
- * Returns:
+ * Returns: succes <=> 0
  *
  * Notes/Dependencies:
  */
@@ -546,18 +556,12 @@ process_begin(
        CloseHandle(procInfo.hThread);

        /* Close the halves of the pipes we don't need */
-       if (pproc->sv_stdin) {
-               CloseHandle((HANDLE)pproc->sv_stdin[1]);
-               pproc->sv_stdin[1] = 0;
-       }
-       if (pproc->sv_stdout) {
-               CloseHandle((HANDLE)pproc->sv_stdout[1]);
-               pproc->sv_stdout[1] = 0;
-       }
-       if (pproc->sv_stderr) {
-               CloseHandle((HANDLE)pproc->sv_stderr[1]);
-               pproc->sv_stderr[1] = 0;
-       }
+       CloseHandle((HANDLE)pproc->sv_stdin[1]);
+       CloseHandle((HANDLE)pproc->sv_stdout[1]);
+       CloseHandle((HANDLE)pproc->sv_stderr[1]);
+       pproc->sv_stdin[1] = 0;
+       pproc->sv_stdout[1] = 0;
+       pproc->sv_stderr[1] = 0;

        free( command_line );
        if (envblk) free(envblk);







reply via email to

[Prev in Thread] Current Thread [Next in Thread]