Document cross-compile from Linux to Windows.

This uses the mingw32 tool chain on Linux to build Windows
binaries.
This commit is contained in:
Stephen Williams 2019-03-22 13:57:38 -07:00
parent c3d5b23ac4
commit df92caadbc
1 changed files with 27 additions and 0 deletions

27
mingw-cross.txt Normal file
View File

@ -0,0 +1,27 @@
These are instructions for building Icarus Verilog binaries for
Windows using mingw cross compiler tools on Linux.
To start with, you need the mingw64-cross-* packages for your linux
distribution, which gives you the x86_64-w64-mingw32-* commands
installed on your system. Installing the cross environment is outside
the scope of this writeup.
First, configure with this command:
$ ./configure --host=x86_64-w64-mingw32
This generates the Makefiles needed to cross compile everything with
the mingw32 compiler. The configure script will generate the command
name paths, so long as commands line x86_64-w64-mingw32-gcc
et. al. are in your path.
Next, compile with the command:
$ make HOSTCC=cc HOSTCFLAGS=-O
The configure generated the cross compiler flags, but there are a few
bits that need to be compiled with the native compiler. (version.exe
for example is used by the build process but is not installed.) The
MOSTCC= flag on the make command line makes sure the Makefile knows
about the native tool.