Discussion:
Build GNUMake from git with mingw-w64
Алексей Павлов
2013-05-17 11:45:14 UTC
Permalink
Hi!

I have troubles with building Make from git with mingw-w64 compiler. I has
error:

mv -f .deps/loadapi.Tpo .deps/loadapi.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\"
-DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I.
-I../make_git -I../make_git/glob -I ../make_git/w32/include
-DMAKE_MAINTAINER_MODE -Wall -Wextra -Wdeclaration-after-statement
-Wshadow -Wpointer-arith -Wbad-function-cast -g -O2 -MT main.o -MD -MP -MF
.deps/main.Tpo -c -o main.o ../make_git/main.c
../make_git/main.c: In function 'decode_output_sync_flags':
../make_git/main.c:749:7: warning: implicit declaration of function
'RECORD_SYNC_MUTEX' [-Wimplicit-function-declaration]
../make_git/main.c: At top level:
../make_git/main.c:760:30: error: unknown type name 'sync_handle_t'
Makefile:606: recipe for target `main.o' failed
make[2]: *** [main.o] Error 1
make[2]: Leaving directory `/c/test/nativesrc/mmake'
Makefile:704: recipe for target `all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/c/test/nativesrc/mmake'
Makefile:463: recipe for target `all' failed
make: *** [all] Error 2

Regards,
Alexey.
Eli Zaretskii
2013-05-17 13:20:23 UTC
Permalink
Date: Fri, 17 May 2013 15:45:14 +0400
From: =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9 =D0=9F=D0=B0=D0=
=20
I have troubles with building Make from git with mingw-w64 compiler=
. I has
=20
mv -f .deps/loadapi.Tpo .deps/loadapi.Po
gcc -DLOCALEDIR=3D\"/usr/local/share/locale\" -DLIBDIR=3D\"/usr/loc=
al/lib\"
-DINCLUDEDIR=3D\"/usr/local/include\" -DHAVE_CONFIG_H -I.
-I../make_git -I../make_git/glob -I ../make_git/w32/include
-DMAKE_MAINTAINER_MODE -Wall -Wextra -Wdeclaration-after-stateme=
nt
-Wshadow -Wpointer-arith -Wbad-function-cast -g -O2 -MT main.o -MD =
-MP -MF
.deps/main.Tpo -c -o main.o ../make_git/main.c
../make_git/main.c:749:7: warning: implicit declaration of function
'RECORD_SYNC_MUTEX' [-Wimplicit-function-declaration]
../make_git/main.c:760:30: error: unknown type name 'sync_handle_t'
'sync_handle_t' is defined in job.h, which is included by main.c. Ar=
e
OUTPUT_SYNC_ and WINDOWS32 defined in your config.h?

Btw: you seem to be using the configure script, instead of the
build_w32.bat batch file. If so, please be advised that this build
procedure will not produce the libgnumake-1.dll.a import library that
is required to build GNU Make dynamic extensions. Patches to add tha=
t
are welcome.
Eli Zaretskii
2013-05-18 08:21:13 UTC
Permalink
[Why a personal email?]
Date: Sat, 18 May 2013 08:50:24 +0400
From: =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9 =D0=9F=D0=B0=D0=
=20
If I manually add "#define OUTPUT_SYNC" to my config.h I have anoth=
=20
mv -f .deps/getloadavg.Tpo .deps/getloadavg.Po
gcc -Wall -Wextra -Wdeclaration-after-statement -Wshadow
-Wpointer-arith -Wbad-function-cast -g -O2 -o make.exe ar.o arsca=
n.o
commands.o default.o dir.o expand.o file.o function.o getopt.o
getopt1.o implicit.o job.o load.o loadapi.o main.o misc.o read.o
remake.o rule.o signame.o strcache.o variable.o version.o vpath.o
hash.o remote-stub.o getloadavg.o glob/libglob.a
-Lw32 -lw32
c:\test\nativesrc\mmake/../make_git/job.c:740: undefined reference =
to `fcntl'

That's because the configure script was not updated to compile the
added file w32/compat/posixfcn.c. Patches are welcome.

The latest git should compile for you without OUTPUT_SYNC defined, so
that is another option.

Once again: I suggest to use the build_w32.bat script for building a
MinGW Make. That script is currently the only officially supported
way of building the Windows port of Make, and it works out of git as
well. It defines OUTPUT_SYNC automatically, and compiles all the
source files needed for that.
Алексей Павлов
2013-05-18 14:48:05 UTC
Permalink
My patch for fix issue:

--- a/configure.ac.orig 2013-05-18 17:20:17 +0400
+++ b/configure.ac 2013-05-18 18:33:00 +0400
@@ -428,6 +428,7 @@
[AM_CONDITIONAL([WINDOWSENV], [true])
w32_target_env=yes
AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
+ AC_DEFINE([OUTPUT_SYNC], [1], [Use platform specific coding])
AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
])

--- a/w32/Makefile.am.orig 2013-05-17 15:28:31 +0400
+++ b/w32/Makefile.am 2013-05-18 18:28:05 +0400
@@ -17,7 +17,8 @@

noinst_LIBRARIES = libw32.a

-libw32_a_SOURCES = subproc/misc.c subproc/sub_proc.c subproc/w32err.c \
+libw32_a_SOURCES = compat/posixfcn.c \
+ subproc/misc.c subproc/sub_proc.c subproc/w32err.c \
pathstuff.c

libw32_a_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/subproc -I$(top_srcdir)
Post by Eli Zaretskii
[Why a personal email?]
Date: Sat, 18 May 2013 08:50:24 +0400
mv -f .deps/getloadavg.Tpo .deps/getloadavg.Po
gcc -Wall -Wextra -Wdeclaration-after-statement -Wshadow
-Wpointer-arith -Wbad-function-cast -g -O2 -o make.exe ar.o arscan.o
commands.o default.o dir.o expand.o file.o function.o getopt.o
getopt1.o implicit.o job.o load.o loadapi.o main.o misc.o read.o
remake.o rule.o signame.o strcache.o variable.o version.o vpath.o
hash.o remote-stub.o getloadavg.o glob/libglob.a
-Lw32 -lw32
c:\test\nativesrc\mmake/../make_git/job.c:740: undefined reference to `fcntl'
That's because the configure script was not updated to compile the
added file w32/compat/posixfcn.c. Patches are welcome.
The latest git should compile for you without OUTPUT_SYNC defined, so
that is another option.
Once again: I suggest to use the build_w32.bat script for building a
MinGW Make. That script is currently the only officially supported
way of building the Windows port of Make, and it works out of git as
well. It defines OUTPUT_SYNC automatically, and compiles all the
source files needed for that.
Eli Zaretskii
2013-05-18 15:00:38 UTC
Permalink
Date: Sat, 18 May 2013 18:48:05 +0400
=20
Thanks, I pushed that.

Would you also mind adding the necessary stuff to produce the
libgnumake import library? All it needs is to add this to the final
link command:

-Wl,--out-implib=3Dlibgnumake-1.dll.a

TIA

Loading...