git:// links no longer work, refer to the https:// one.
[wiki] / examples / cross-compiling-64-bit-windows-binary.mdwn
index f35ab4c..bb09af1 100644 (file)
@@ -21,7 +21,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 git-core wget
+       sudo apt-get install mingw-w64 git-core wget quilt
        sudo apt-get build-dep tinc
 
 Other Linux distributions may also have 64-bit MinGW packages, use their respective
@@ -40,7 +40,7 @@ apt-get and wget to get the required libraries necessary for tinc, and use
        mkdir $HOME/mingw64
        cd $HOME/mingw64
        apt-get source liblzo2-dev zlib1g-dev libssl-dev
-       git clone git://tinc-vpn.org/tinc
+       git clone https://tinc-vpn.org/git/tinc
 
 ### Making cross-compilation easy
 
@@ -49,7 +49,7 @@ up the necessary environment variables so configure scripts and Makefiles will
 use the 64-bit MinGW version of GCC and binutils:
 
        mkdir $HOME/bin
-       cat >$HOME/bin/mingw64 << EOF
+       cat >$HOME/bin/mingw64 << 'EOF'
        #!/bin/sh
        PREFIX=x86_64-w64-mingw32
        export CC=$PREFIX-gcc
@@ -77,7 +77,7 @@ time it is needed.
 
 Cross-compiling LZO is easy:
 
-       cd $HOME/mingw64/lzo2-2.06
+       cd $HOME/mingw64/lzo2-2.08
        ./configure --host=x86_64-w64-mingw32
        make
        DESTDIR=$HOME/mingw64 make install
@@ -90,24 +90,19 @@ create a symlink for the missing getopt.h file as mentioned above.
 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/mingw64/zlib-1.2.7.dfsg
-       mingw64 ./configure
-       mingw64 make libz.a
+       cd $HOME/mingw64/zlib-1.2.8.dfsg
+       mingw64 ./configure --static
+       mingw64 make
        DESTDIR=$HOME/mingw64 mingw64 make install
 
-### Compiling OpenSSL
+### Compiling LibreSSL
 
-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.
+Tinc can use either OpenSSL or LibreSSL. The latter is recommended.
 
-       cd $HOME/mingw64/openssl-1.0.1c
-       quilt pop -a
-       mingw64 ./Configure --openssldir=$HOME/mingw64/usr/local mingw64
-       mingw64 make
-       mingw64 make install
+       cd $HOME/mingw/libressl-2.3.3
+       CC=x86_64-w64-mingw32-gcc ./configure --host=x86_64-w64-mingw32
+       make
+       DESTDIR=$HOME/mingw make install
 
 ### Compiling tinc
 
@@ -118,5 +113,5 @@ this is not necessary.
 
        cd $HOME/mingw64/tinc
        autoreconf -fsi
-       ./configure --host=x86_64-w64-mingw32 --with-openssl=$HOME/mingw64/usr/local
+       ./configure --host=x86_64-w64-mingw32 --with-zlib=$HOME/mingw64/usr/local
        make