-
Notifications
You must be signed in to change notification settings - Fork 14
/
xcomp.sh
executable file
·53 lines (47 loc) · 1.99 KB
/
xcomp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Working setup to cross-compile Windows binaries hosted on a
# Vagrant Ubuntu 16.04 VM using non-Canonical ppas for MXE and Qt5.7:
# deb http://pkg.mxe.cc/repos/apt/debian wheezy main
# Doesn't seem to pass the QT directives through, though. Tough.
# Basic path bindings
PATH=/usr/lib/mxe/usr/bin:$PATH
MXE_PATH=/usr/lib/mxe
MXE_INCLUDE_PATH=/usr/lib/mxe/usr/i686-w64-mingw32.static/include
MXE_LIB_PATH=/usr/lib/mxe/usr/i686-w64-mingw32.static/lib
# Belt and braces
CXXFLAGS="-std=gnu++11 -march=i686"
LDFLAGS="-march=i686"
target="i686-w64-mingw32.static"
# Particularise for cross-compiling
export BOOST_LIB_SUFFIX=-mt
export BOOST_THREAD_LIB_SUFFIX=_win32-mt
export BOOST_INCLUDE_PATH=${MXE_INCLUDE_PATH}/boost
export BOOST_LIB_PATH=${MXE_LIB_PATH}
export OPENSSL_INCLUDE_PATH=${MXE_INCLUDE_PATH}/openssl
export OPENSSL_LIB_PATH=${MXE_LIB_PATH}
export BDB_INCLUDE_PATH=${MXE_INCLUDE_PATH}
export BDB_LIB_PATH=${MXE_LIB_PATH}
export MINIUPNPC_INCLUDE_PATH=${MXE_INCLUDE_PATH}
export MINIUPNPC_LIB_PATH=${MXE_LIB_PATH}
export QMAKE_LRELEASE=${MXE_PATH}/usr/${target}/qt5/bin/lrelease
# Call qmake to create Makefile.[Release|Debug]
${target}-qmake-qt5 \
MXE=1 \
USE_O3=1 \
USE_QRCODE=0 \
FIRST_CLASS_MESSAGING=1 \
RELEASE=1 \
USE_UPNPC=1 \
BOOST_LIB_SUFFIX=${BOOST_LIB_SUFFIX} \
BOOST_THREAD_LIB_SUFFIX=${BOOST_THREAD_LIB_SUFFIX} \
BOOST_INCLUDE_PATH=${BOOST_INCLUDE_PATH} \
BOOST_LIB_PATH=${BOOST_LIB_PATH} \
OPENSSL_INCLUDE_PATH=${OPENSSL_INCLUDE_PATH} \
OPENSSL_LIB_PATH=${OPENSSL_LIB_PATH} \
BDB_INCLUDE_PATH=${BDB_INCLUDE_PATH} \
BDB_LIB_PATH=${BDB_LIB_PATH} \
MINIUPNPC_INCLUDE_PATH=${MINIUPNPC_INCLUDE_PATH} \
MINIUPNPC_LIB_PATH=${MINIUPNPC_LIB_PATH} \
QMAKE_LRELEASE=${QMAKE_LRELEASE} 808.pro
# Go for it. If successful, Windows binary will be written out to ./release/808.exe
make -f Makefile.Release CXXFLAGS="-DQT_GUI -DQT_NO_PRINTER -std=gnu++11 -march=i686" LDFLAGS="-march=i686"