Updates to Windows stuff from Markus Mauhart.

This commit is contained in:
Paul Smith 2006-02-06 16:41:49 +00:00
parent a4e3523fe4
commit ce9c63b32b
6 changed files with 55 additions and 57 deletions

View file

@ -6,6 +6,17 @@
-W, don't overwrite it with the real mtime.
Fixes Savannah bug #15341.
Updates from Markus Mauhart <qwe123@chello.at>:
* w32/subproc/sub_proc.c (process_begin): Remove no-op tests.
(process_signal, process_last_err, process_exit_code): Manage
invalid handle values.
(process_{outbuf,errbuf,outcnt,errcnt,pipes}): Unused and don't
manage invalid handles; remove them.
* job.c (start_job_command) [WINDOWS32]: Jump out on error.
* config.h.W32.template [WINDOWS32]: Set flags for Windows builds.
* README.cvs: Updates for building from CVS.
2006-02-05 Paul D. Smith <psmith@gnu.org>
* file.c (enter_file): Keep track of the last double_colon entry,
@ -34,7 +45,7 @@
* README.cvs: Applied patch #4786 from
Markus Mauhart <qwe123@chello.at>.
* make_msvc_net2003.vcproj [WINDOWS32]: New version from
Markus Mauhart <qwe123@chello.at>.
J. Grant <jg@jguk.org>.
* main.c: Update the copyright year in the version output.
* prepare_w32.bat: Remove this file from the distribution.

View file

@ -13,12 +13,10 @@ people. It was originally made by Rob Tulloh.
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.
1. At the Windows command prompt run:
if not exist config.h copy config.h.W32 config.h
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
defines near the end, or HAVE_CASE_INSENSITIVE_FS which corresponds

View file

@ -96,23 +96,13 @@ That's it, you're done!
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:
If you have a UNIX emulation like CYGWIN you can opt to run the general
build procedure above; it will work. Be sure to read
README.W32.template for information on options you might want to use
when running ./configure.
$ 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 can't or don't want to do that, then rename the file
README.W32.template to README.W32 and follow those instructions.
Appendix A - For The Brave

View file

@ -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

11
job.c
View file

@ -1382,11 +1382,12 @@ start_job_command (struct child *child)
int i;
unblock_sigs();
fprintf(stderr,
_("process_easy() failed to launch process (e=%ld)\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);
_("process_easy() failed to launch process (e=%ld)\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);
goto error;
}
}
#endif /* WINDOWS32 */

View file

@ -173,54 +173,58 @@ process_wait_for_any(void)
}
long
process_errno(HANDLE proc)
process_signal(HANDLE proc)
{
return (((sub_process *)proc)->lerrno);
if (proc == INVALID_HANDLE_VALUE) return 0;
return (((sub_process *)proc)->signal);
}
long
process_signal(HANDLE proc)
{
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
long
process_exit_code(HANDLE proc)
{
if (proc == INVALID_HANDLE_VALUE) return EXIT_FAILURE;
return (((sub_process *)proc)->exit_code);
}
char *
/*
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.
char *
process_outbuf(HANDLE proc)
{
return (((sub_process *)proc)->outp);
}
char *
char *
process_errbuf(HANDLE proc)
{
return (((sub_process *)proc)->errp);
}
int
int
process_outcnt(HANDLE proc)
{
return (((sub_process *)proc)->outcnt);
}
int
int
process_errcnt(HANDLE proc)
{
return (((sub_process *)proc)->errcnt);
}
void
void
process_pipes(HANDLE proc, int pipes[3])
{
pipes[0] = ((sub_process *)proc)->sv_stdin[0];
@ -228,7 +232,7 @@ process_pipes(HANDLE proc, int pipes[3])
pipes[2] = ((sub_process *)proc)->sv_stderr[0];
return;
}
*/
HANDLE
process_init()
@ -379,7 +383,7 @@ find_file(char *exec_path, LPOFSTRUCT file_info)
/*
* Description: Create the child process to be helped
*
* Returns:
* Returns: success <=> 0
*
* Notes/Dependencies:
*/
@ -546,18 +550,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);