[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Gawk compile error Mingw32
From: |
Eli Zaretskii |
Subject: |
Re: [bug-gawk] Gawk compile error Mingw32 |
Date: |
Tue, 15 Mar 2016 19:40:23 +0200 |
> From: Ivan Suchý <address@hidden>
> Date: Mon, 14 Mar 2016 20:39:13 +0100
>
> Hello I tried to compile GNU Gawk 4.1.3 on Windows 10 using MingW32 compiler
> copying content of pc
> directory to gawk sources according to manual
>
> https://www.gnu.org/software/gawk/manual/html_node/PC-Compiling.html#PC-Compiling
>
> but compilation in Msys ended with following error:
>
> https://gist.github.com/is73/3902d517c37d04b33f27
>
> Please could you help me, I'm not so skilled in C.
The patch below should fix this:
--- pc/Makefile~ 2015-04-05 11:13:50.000000000 +0300
+++ pc/Makefile 2016-03-15 12:27:22.062033000 +0200
@@ -168,28 +168,28 @@
mingw32:
$(MAK) all \
- CC=gcc O=.o CF="-D__USE_MINGW_ANSI_STDIO -O2 -gdwarf-2 -g3" \
+ CC=gcc O=.o CF="-D__USE_MINGW_ANSI_STDIO -O2 -gdwarf-2 -g3
-Wno-deprecated-declarations" \
OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" \
LF2="-lws2_32 -lmsvcp60" RSP=
mingw32-readline:
$(MAK) all \
CC=gcc O=.o \
- CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_LIBREADLINE -O2 -gdwarf-2 -g3" \
+ CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_LIBREADLINE -O2 -gdwarf-2 -g3
-Wno-deprecated-declarations" \
OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" \
LF2="-lreadline -lws2_32 -lmsvcp60 -Wl,--enable-auto-import" RSP=
mingw32-mpfr:
$(MAK) all \
CC=gcc O=.o \
- CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_MPFR -O2 -gdwarf-2 -g3" \
+ CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_MPFR -O2 -gdwarf-2 -g3
-Wno-deprecated-declarations" \
OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" \
LF2="-lmpfr -lgmp -lws2_32 -lmsvcp60 -Wl,--enable-auto-import" RSP=
mingw32-readline-mpfr:
$(MAK) all \
CC=gcc O=.o \
- CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_LIBREADLINE -DHAVE_MPFR -O2
-gdwarf-2 -g3" \
+ CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_LIBREADLINE -DHAVE_MPFR -O2
-gdwarf-2 -g3 -Wno-deprecated-declarations" \
OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" \
LF2="-lmpfr -lgmp -lreadline -lws2_32 -lmsvcp60
-Wl,--enable-auto-import" RSP=
--- pc/gawkmisc.pc~ 2015-04-27 18:01:59.000000000 +0300
+++ pc/gawkmisc.pc 2016-03-15 12:30:00.704596900 +0200
@@ -584,6 +584,9 @@
return setenv (name, "", 1);
}
+/* MinGW 3.21 and later defines usleep as an inline function in
+ unistd.h, which conflicts with the version below. */
+#if __MINGW32_MAJOR_VERSION + (__MINGW32_MINOR_VERSION > 20) < 4
int
usleep(unsigned int usec)
{
@@ -593,6 +596,7 @@
return usec - msecf * 1000 < 0 ? 0 : (int)(usec - msecf * 1000);
}
+#endif
/* The implementation of wctob in the MS runtime is problematic
because it doesn't allow to distinguish between WEOF and 0xff, due