From: Keith M. <kei...@to...> - 2006-07-13 15:23:15
|
I wrote, quoting Earnie Boyd: >> I wonder what would happen if you add /lib/binmode.o to the link step? > > Marginally better, but nothing to get excited about... Having said this, I tried this: $ make distclean $ ../../m4-1.4.4/configure --enable-changeword \ > --prefix=`cd /mingw && pwd -W` LIBS=/mingw/lib/binmode.o prior to rebuilding m4, and it still fails every one of its `make check' tests, (and the `make' output *does* show that /mingw/lib/binmode.o *is* being linked), whereas, with this explicit patch: <file name="m4.diff"> --- src/m4.c 2006/07/13 14:28:12 1.1 +++ src/m4.c 2006/07/13 14:29:33 @@ -271,6 +271,10 @@ program_name = argv[0]; + /* Prefer LF delimited output to CRLF, on MS-Windows */ + setmode (STDOUT_FILENO, O_BINARY); + setmode (STDERR_FILENO, O_BINARY); + include_init (); debug_init (); #ifdef USE_STACKOVF --- src/m4.h 2006/07/13 14:28:29 1.1 +++ src/m4.h 2006/07/13 14:32:01 @@ -35,6 +35,16 @@ # define WIN32 _WIN32 #endif +/* Prefer LF delimited output to CRLF, on MS-Windows. */ +#ifdef WIN32 +# include <fcntl.h> +# include <io.h> +#endif +#ifndef O_BINARY +# define O_BINARY 0 +# define setmode(fd,mode) /* do nothing */ +#endif + #include <sys/types.h> #ifdef __STDC__ </file> I notice a *significant* improvement; (all CRLF/LF contentions are resolved, leaving only five failures in 51 tests, of which three are differences between the program name reported in stderr messages, and what the test expected -- `d:\path\m4.exe' vs `m4'. The remaining two appear to be output, which should appear on stderr, but actually appearing on stdout). I guess /mingw/lib/binmode.o doesn't affect the CRLF behaviour of stdout and stderr? Regards, Keith. |