configure: conftest win32: don't translate LF to CRLF

This removes a spurious \r at $gcc_{major,minor} in configure on cygwin.

Details:

The EOL output of conftest.exe for windows was \r\n . Now it's only \n .
The output of conftest is used with sh command substitutions which trim
trailing newlines, but not all windows shells consider \r\n as newline.

E.g. msys2 and busybox (for windows) were designed for tight integration
with windows apps and their shells do trim \r\n, but cygwin sh is closer
to POSIX and trims only \n - leaving \r at the string.
This commit is contained in:
Avi Halachmi (:avih) 2019-06-25 15:43:24 +03:00
parent 84779b2b84
commit a7eef33859

View File

@ -1,5 +1,9 @@
#include <stdio.h>
#if defined(_WIN32)
#include <fcntl.h>
#endif
/* Define architecture */
#if defined(__i386__) || defined _M_IX86
# define TRIPLET_ARCH "i386"
@ -49,6 +53,9 @@ int _CRT_glob = 0;
int main(int argc, char *argv[])
{
#if defined(_WIN32)
_setmode(_fileno(stdout), _O_BINARY); /* don't translate \n to \r\n */
#endif
switch(argc == 2 ? argv[1][0] : 0) {
case 'b':
{