From 2127680e49f61083db64fc0cefe9d1b0b533d54a Mon Sep 17 00:00:00 2001 From: Udi Finkelstein Date: Thu, 8 Dec 2016 00:11:22 +0200 Subject: [PATCH] Fixed cross-compile using mingw 64 bit under Windows 10 Linux subsystem (Ubunto 14.04) Should work with true Ubuntu 14.04 as-is. --- Makefile.in | 5 ++--- aclocal.m4 | 2 ++ vvp/Makefile.in | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index d5f79a199..a3b94c908 100644 --- a/Makefile.in +++ b/Makefile.in @@ -70,7 +70,6 @@ dllib=@DLLIB@ HOSTCC = @CC@ HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@ -CC = @CC@ CXX = @CXX@ DLLTOOL = @DLLTOOL@ INSTALL = @INSTALL@ @@ -129,7 +128,7 @@ all: dep config.h _pli_types.h version_tag.h ivl@EXEEXT@ version.exe iverilog-vp ifeq (@MINGW32@,yes) all: dosify.exe dosify.exe: $(srcdir)/dosify.c - $(HOSTCC) $(HOSTCFLAGS) -o dosify.exe $(srcdir)/dosify.c + $(CC) $(CFLAGS) -o dosify.exe $(srcdir)/dosify.c endif # This rule rules the compiler in the trivial hello.vl program to make @@ -239,7 +238,7 @@ iverilog-vpi: $(srcdir)/iverilog-vpi.sh Makefile endif version.exe: $(srcdir)/version.c $(srcdir)/version_base.h version_tag.h - $(HOSTCC) $(HOSTCFLAGS) -o version.exe -I. -I$(srcdir) $(srcdir)/version.c + $(CC) $(CFLAGS) -o version.exe -I. -I$(srcdir) $(srcdir)/version.c %.o: %.cc config.h $(CXX) $(CPPFLAGS) $(CXXFLAGS) @DEPENDENCY_FLAG@ -c $< -o $*.o diff --git a/aclocal.m4 b/aclocal.m4 index f44632fe2..8b2b8d2f9 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -225,6 +225,8 @@ AC_DEFUN([AX_C99_STRTOD], [# On MinGW we need to jump through hoops to get a C99 compliant strtod(). # mingw-w64 doesn't need this, and the 64-bit version doesn't support it. case "${host}" in + x86_64-w64-mingw32) + ;; *-*-mingw32) LDFLAGS+=" -Wl,--undefined=___strtod,--wrap,strtod,--defsym,___wrap_strtod=___strtod" ;; diff --git a/vvp/Makefile.in b/vvp/Makefile.in index faae3736a..6235edb57 100644 --- a/vvp/Makefile.in +++ b/vvp/Makefile.in @@ -35,7 +35,6 @@ includedir = @includedir@ HOSTCC = @CC@ HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@ -CC = @CC@ CXX = @CXX@ DLLTOOL = @DLLTOOL@ AR = @AR@ @@ -153,7 +152,7 @@ endif mv $*.d dep/$*.d tables.cc: $(srcdir)/draw_tt.c - $(HOSTCC) $(HOSTCFLAGS) -o draw_tt.exe $(srcdir)/draw_tt.c + $(CC) $(CFLAGS) -o draw_tt.exe $(srcdir)/draw_tt.c ./draw_tt.exe > tables.cc rm draw_tt.exe