This repository has been archived by the owner on May 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 654
Cross compilation
Saúl Ibarra Corretgé edited this page Jul 29, 2014
·
3 revisions
Ubuntu 12.04 mingw-w64 package is missing some definitions needed to build libuv, the following commands can be used to patch libuv sources and work around the problem:
# Create a header with some definitions missing mingw-w64 2.0.1
# which is the version shipped with ubuntu 12.04
# ref: http://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/thread/[email protected]/
cat > "src/win/missing.h" << EOF
#include <ntddndis.h>
#include <naptypes.h>
typedef int MIB_TCP_STATE;
EOF
# patch src/win/util.c to include the generated header after winsock2.h include
sed -i '/#include <winsock2.h>/a#include ".\/missing.h"' src/win/util.c
NOTE: this is not a problem with recent versions of the MinGW-w64 toolchain.
Install the required mingw packages with sudo apt-get install binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64
, then:
sh autogen.sh
./configure --disable-shared --enable-static --host=x86_64-w64-mingw32
make
make check
The make check
command will fail to execute(unless wine is installed), but it will generate the test/run-tests.exe file which can be dropped into a windows machine(or virtual machine) to run the tests