From 0e0a525a05c6919129ec0046f3144dfe9ec7cc6f Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 14 May 2011 13:48:38 +0200 Subject: [PATCH] Update cross-compiling examples. - Make sure the mingw/mingw64 scripts are executable. - Execute quilt pop -a in the OpenSSL source tree to remove Debian-specific patches that might break cross-compilation. --- .../cross-compiling-64-bit-windows-binary.mdwn | 5 +++++ examples/cross-compiling-windows-binary.mdwn | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/examples/cross-compiling-64-bit-windows-binary.mdwn b/examples/cross-compiling-64-bit-windows-binary.mdwn index be17ae2..cf4a9b5 100644 --- a/examples/cross-compiling-64-bit-windows-binary.mdwn +++ b/examples/cross-compiling-64-bit-windows-binary.mdwn @@ -67,6 +67,7 @@ use the 64-bit MinGW version of GCC and binutils: export PATH="/usr/amd64-mingw32msvc/bin:$PATH" exec "$@" EOF + chmod u+x $HOME/bin/mingw64 If `$HOME/bin` is not already part of your `$PATH`, you need to add it: @@ -105,9 +106,13 @@ tests, so we only build the static library here: ### Compiling OpenSSL Although older versions will not compile, OpenSSL 1.0.0 is easy. +However, `apt-get source` will have applied +Debian-specific patches that break cross-compiling a Windows binary. +You need to undo those patches first. Do not use the `-j` option when compiling OpenSSL, it will break. cd $HOME/mingw64/openssl-1.0.0 + quilt pop -a mingw64 ./Configure --openssldir=$HOME/mingw64/usr/local mingw64 mingw64 make mingw64 make install diff --git a/examples/cross-compiling-windows-binary.mdwn b/examples/cross-compiling-windows-binary.mdwn index fbfba1e..5574306 100644 --- a/examples/cross-compiling-windows-binary.mdwn +++ b/examples/cross-compiling-windows-binary.mdwn @@ -61,6 +61,7 @@ use the MinGW version of GCC and binutils: export PATH="/usr/i586-mingw32msvc/bin:$PATH" exec "$@" EOF + chmod u+x $HOME/bin/mingw If `$HOME/bin` is not already part of your `$PATH`, you need to add it: @@ -97,13 +98,23 @@ tests, so we only build the static library here: OpenSSL is always a bit hard to compile, because they have their own `Configure` script that needs some tweaking. There is also a small bug in -e_os2.h that breaks compilation with recent versions of GCC. First download +e_os2.h in OpenSSL 0.9.8 that breaks compilation with recent versions of GCC. +If you have this version of OpenSSL, then first download this [[openssl-cross-compilation.diff]] to your home directory, then patch -OpenSSL, and then compile as usual. Do not use the `-j` option when compiling -OpenSSL, it will break. +OpenSSL: cd $HOME/mingw/openssl-0.9.8k patch < $HOME/openssl-cross-compilation.diff + +With OpenSSL 1.0.0, this problem is no longer present. However, `apt-get source` will have applied +Debian-specific patches that break cross-compiling a Windows binary. You need to undo those patches first: + + cd $HOME/mingw/openssl-0.9.8k + quilt pop -a + +Now you can compile OpenSSL. +Do not use the `-j` option when compiling OpenSSL, it will break. + mingw ./Configure --openssldir=$HOME/mingw/usr/local mingw mingw make mingw make install -- 2.20.1