1#!/bin/bash 2 3# Build glogg for win32 using the cross-compiler 4 5QTXDIR=$HOME/qt-x-win32 6QTVERSION=5.5.1-64 7BOOSTDIR=$QTXDIR/boost_1_50_0 8 9rm release debug .obj .ui .moc -rf 10make clean 11if [ "$1" == "debug" ]; then 12 echo "Building a debug version" 13 qmake-qt4 glogg.pro -spec win64-x-g++ -r CONFIG+="debug win32 rtti no-dbus version_checker" BOOST_PATH=$BOOSTDIR 14elif [ -z "$VERSION" ]; then 15 echo "Building default version" 16 qmake glogg.pro -spec win64-x-g++ -r CONFIG+="release win32 rtti no-dbus version_checker" BOOST_PATH=$BOOSTDIR QMAKE_CXXFLAGS="-m64" CROSS_COMPILE="x86_64-w64-mingw32-" INCLUDEPATH+="$QTXDIR/$QTVERSION/include $QTXDIR/$QTVERSION/include/QtCore $QTXDIR/$QTVERSION/include/QtGui $QTXDIR/$QTVERSION/include/QtNetwork $QTXDIR/$QTVERSION/include/QtWidgets" 17else 18 echo "Building version $VERSION-x86_64" 19 qmake glogg.pro -spec win64-x-g++ -r CONFIG+="release win32 rtti no-dbus version_checker" BOOST_PATH=$BOOSTDIR VERSION="$VERSION-x86_64" QMAKE_CXXFLAGS="-m64" CROSS_COMPILE="x86_64-w64-mingw32-" INCLUDEPATH+="$QTXDIR/$QTVERSION/include $QTXDIR/$QTVERSION/include/QtCore $QTXDIR/$QTVERSION/include/QtGui $QTXDIR/$QTVERSION/include/QtNetwork $QTXDIR/$QTVERSION/include/QtWidgets" 20fi 21make -j3 22cp $QTXDIR/$QTVERSION/bin/{Qt5Core,Qt5Gui,Qt5Network,Qt5Widgets}.dll release/ 23cp $QTXDIR/$QTVERSION/plugins/platforms/qwindows.dll release/ 24cp $QTXDIR/$QTVERSION/bin/{Qt5Core,Qt5Gui,Qt5Network,Qt5Widgets}d.dll debug/ 25cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll release/ 26if [ -z "$VERSION" ]; then 27 VERSION=`git describe`; 28fi 29echo Generating installer for glogg-$VERSION 30wine $QTXDIR/NSIS/makensis -DVERSION="$VERSION-x86_64" glogg.nsi 31