Cross compile Chaincoin

Host: Ubuntu

Target: Windows 7/8/10 64 Bit

Toolchain

Setting up the »mxe« toolchain:

Install:

Install the mxe dependencies:

sudo apt-get install p7zip-full autoconf automake autopoint bash bison bzip2 cmake flex gettext git g++ gperf intltool libffi-dev libtool libltdl-dev libssl-dev libxml-parser-perl make openssl patch perl pkg-config python ruby scons sed unzip wget xz-utils

For 64Bit Ubuntu also install:

sudo apt-get install g++-multilib libc6-dev-i386

Clone the mxe toolchain

git clone https://github.com/mxe/mxe.git

Settings

Edit ~/mxe/settings.mk. Add the following entry for 64bit.

MXE_TARGETS := x86_64-w64-mingw32.static

change Berkeley DB to version 4.8

cd ~/mxe/src
cp db.mk db4.8.mk

edit the file ~/mxe/src/db4.8.mk and change the following entries:

PKG             := db4.8
$(PKG)_VERSION  := 4.8.30
$(PKG)_CHECKSUM := e0491a07cdb21fb9aa82773bbbedaeb7639cbd0e7f96147ab46141e0045db72a

Compile libraries

Libraries needed to compile chaincoin:

cd ~/mxe
make openssl libevent boost miniupnpc qt db4.8

Environment

export PATH=$HOME/mxe/usr/bin:$PATH

unset `env | \
    grep -vi '^EDITOR=\|^HOME=\|^LANG=\|MXE\|^PATH=' | \
    grep -vi 'PKG_CONFIG\|PROXY\|^PS1=\|^TERM=' | \
    cut -d '=' -f1 | tr '\n' ' '`

Compile CHAINCOIN

git clone https://github.com/chaincoin/chaincoin.git
cd chaincoin

./configure --host=x86_64-w64-mingw32.static --enable-static --disable-shared --disable-tests --with-boost=$HOME/mxe/usr/x86_64-w64-mingw32.static/include/boost --with-boost-libdir=$HOME/mxe/usr/x86_64-w64-mingw32.static/lib

make HOST=x86_64-w64-mingw32 -j4