X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=examples%2Fcross-compiling-windows-binary.mdwn;h=9908981a73c2f980c17bcfe0f7463230c2c8abb3;hb=HEAD;hp=3e3bd16c775b5c432caaabc405b75ba5c8065eb0;hpb=7e9013f3810b5d012a3419c84732f605f051a1af;p=wiki diff --git a/examples/cross-compiling-windows-binary.mdwn b/examples/cross-compiling-windows-binary.mdwn index 3e3bd16..ace7b38 100644 --- a/examples/cross-compiling-windows-binary.mdwn +++ b/examples/cross-compiling-windows-binary.mdwn @@ -24,7 +24,7 @@ The idea is simple: There are only a few packages that need to be installed as root to get started: - sudo apt-get install mingw-w64 wine git-core + sudo apt-get install mingw-w64 wine git-core quilt sudo apt-get build-dep tinc Other Linux distributions may also have MinGW packages, use their respective @@ -43,7 +43,7 @@ the latest development version of tinc. mkdir $HOME/mingw cd $HOME/mingw apt-get source openssl liblzo2-dev zlib1g-dev - git clone git://tinc-vpn.org/tinc + git clone https://tinc-vpn.org/git/tinc ### Making cross-compilation easy @@ -52,7 +52,7 @@ up the necessary environment variables so configure scripts and Makefiles will use the MinGW version of GCC and binutils: mkdir $HOME/bin - cat >$HOME/bin/mingw << EOF + cat >$HOME/bin/mingw << 'EOF' #!/bin/sh PREFIX=i686-w64-mingw32 export CC=$PREFIX-gcc @@ -80,7 +80,7 @@ time it is needed. Cross-compiling LZO is easy: - cd $HOME/mingw/lzo2-2.06 + cd $HOME/mingw/lzo2-2.08 ./configure --host=i686-w64-mingw32 make DESTDIR=$HOME/mingw make install @@ -90,25 +90,19 @@ Cross-compiling LZO is easy: Cross-compiling Zlib is also easy, but a plain `make` failed to compile the tests, so we only build the static library here: - cd $HOME/mingw/zlib-1.2.7.dfsg + cd $HOME/mingw/zlib-1.2.8.dfsg mingw ./configure mingw make libz.a DESTDIR=$HOME/mingw mingw make install -### Compiling OpenSSL +### Compiling LibreSSL -OpenSSL 1.0.0 and later is relatively 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: +Tinc can use either OpenSSL or LibreSSL. The latter is recommended. - cd $HOME/mingw/openssl-1.0.1c - 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 + cd $HOME/mingw/libressl-2.3.3 + CC=i686-w64-mingw32-gcc ./configure --host=i686-w64-mingw32 + make + DESTDIR=$HOME/mingw make install ### Compiling tinc