2013-02-16 23:53:53 +00:00
|
|
|
#!/bin/sh
|
2011-11-26 03:39:30 +00:00
|
|
|
#
|
|
|
|
# just a small shell script that is used to invoke make with the right
|
|
|
|
# parameters to cross compile a binary for Windows
|
|
|
|
#
|
2013-10-11 20:25:37 +00:00
|
|
|
# the paths work for the default mingw32 install on Fedora - adjust as
|
2011-11-26 03:39:30 +00:00
|
|
|
# necessary
|
2014-04-21 15:41:11 +00:00
|
|
|
# this assumes that local cross builds for libdivecomputer and libgit2
|
|
|
|
# are in ../libdivecomputer and ../libgit2
|
2011-11-26 03:39:30 +00:00
|
|
|
|
2014-04-21 15:41:11 +00:00
|
|
|
# force recreation of the nsi file and Subsurface version header file
|
|
|
|
# in order to get the correct version number
|
2014-04-19 18:43:52 +00:00
|
|
|
BASEDIR=$(dirname $0)
|
|
|
|
rm $BASEDIR/subsurface.nsi > /dev/null 2>&1
|
2014-04-21 15:41:11 +00:00
|
|
|
rm $BASEDIR/../../ssrf-version.h > /dev/null 2>&1
|
2013-02-16 23:53:53 +00:00
|
|
|
|
2014-08-02 22:06:10 +00:00
|
|
|
if [[ $1 == "Qt5-64" ]] ; then
|
|
|
|
export PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH
|
|
|
|
else
|
|
|
|
export PATH=/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH
|
|
|
|
fi
|
2014-04-21 18:08:10 +00:00
|
|
|
export objdump=mingw-objdump
|
2014-06-06 16:15:36 +00:00
|
|
|
|
2014-08-02 22:06:10 +00:00
|
|
|
if [[ $1 == "Qt5-64" ]] ; then
|
|
|
|
shift
|
|
|
|
mingw64-qmake-qt5 \
|
|
|
|
CROSS_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw \
|
|
|
|
QMAKE_LRELEASE=/usr/x86_64-w64-mingw32/bin/qt5/lrelease \
|
|
|
|
QMAKE_MOC=/usr/x86_64-w64-mingw32/bin/qt5/moc \
|
|
|
|
QMAKE_UIC=/usr/x86_64-w64-mingw32/bin/qt5/uic \
|
|
|
|
QMAKE_RCC=/usr/x86_64-w64-mingw32/bin/qt5/rcc \
|
|
|
|
LIBMARBLEDEVEL=../marble \
|
|
|
|
LIBGIT2DEVEL=../libgit2 CONFIG+=libgit21-api \
|
|
|
|
QMAKE_LIBDIR+=../openssl \
|
|
|
|
$BASEDIR/../../subsurface.pro
|
|
|
|
|
|
|
|
elif [[ $1 == "Qt5" ]] ; then
|
2014-06-06 16:15:36 +00:00
|
|
|
shift
|
|
|
|
mingw32-qmake-qt5 \
|
|
|
|
CROSS_PATH=/usr/i686-w64-mingw32/sys-root/mingw \
|
|
|
|
QMAKE_LRELEASE=/usr/i686-w64-mingw32/bin/qt5/lrelease \
|
|
|
|
QMAKE_MOC=/usr/i686-w64-mingw32/bin/qt5/moc \
|
|
|
|
QMAKE_UIC=/usr/i686-w64-mingw32/bin/qt5/uic \
|
|
|
|
QMAKE_RCC=/usr/i686-w64-mingw32/bin/qt5/rcc \
|
|
|
|
LIBDCDEVEL=../libdivecomputer \
|
|
|
|
LIBMARBLEDEVEL=../marble \
|
|
|
|
LIBGIT2DEVEL=../libgit2 CONFIG+=libgit21-api \
|
|
|
|
$BASEDIR/../../subsurface.pro
|
|
|
|
|
2014-06-08 02:39:50 +00:00
|
|
|
elif [[ $1 == "Qt5debug" ]] ; then
|
|
|
|
shift
|
|
|
|
mingw32-qmake-qt5 \
|
|
|
|
CROSS_PATH=/usr/i686-w64-mingw32/sys-root/mingw \
|
|
|
|
QMAKE_LRELEASE=/usr/i686-w64-mingw32/bin/qt5/lrelease \
|
|
|
|
QMAKE_MOC=/usr/i686-w64-mingw32/bin/qt5/moc \
|
|
|
|
QMAKE_UIC=/usr/i686-w64-mingw32/bin/qt5/uic \
|
|
|
|
QMAKE_RCC=/usr/i686-w64-mingw32/bin/qt5/rcc \
|
|
|
|
QMAKE_CFLAGS_RELEASE='$$QMAKE_CFLAGS_DEBUG -O0 -g' \
|
|
|
|
QMAKE_CXXFLAGS_RELEASE='$$QMAKE_CXXFLAGS_DEBUG -O0 -g' \
|
|
|
|
LIBDCDEVEL=../libdivecomputer \
|
|
|
|
LIBMARBLEDEVEL=../marble \
|
|
|
|
LIBGIT2DEVEL=../libgit2 CONFIG+=libgit21-api \
|
|
|
|
V=1 \
|
|
|
|
$BASEDIR/../../subsurface.pro
|
|
|
|
|
2014-06-06 16:15:36 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
mingw32-qmake-qt4 \
|
|
|
|
CROSS_PATH=/usr/i686-w64-mingw32/sys-root/mingw \
|
|
|
|
LIBMARBLEDEVEL=../marble \
|
|
|
|
LIBGIT2DEVEL=../libgit2 CONFIG+=libgit21-api \
|
|
|
|
$BASEDIR/../../subsurface.pro
|
|
|
|
fi
|
|
|
|
|
2013-10-11 20:25:37 +00:00
|
|
|
mingw32-make $@
|