Skip to content

Commit

Permalink
Merge pull request #4 from setanta/master
Browse files Browse the repository at this point in the history
Adds some options to the build script.
  • Loading branch information
ossy-szeged committed Jun 12, 2012
2 parents 82771f7 + 5b4aaf2 commit 1ae6d25
Showing 1 changed file with 50 additions and 6 deletions.
56 changes: 50 additions & 6 deletions build-qt5.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,57 @@
#!/bin/bash

N_THREADS=30
BUILD_TYPE="-release"
DEVELOPER_BUILD=

function usage() {
echo "Usage: $0 [-d] [-D] [-j #NUMBER]"
echo " -d : builds with debug symbols."
echo " -D : builds in developer mode (do not install anything)."
echo " -j #: builds with # threads (default is $N_THREADS)."
}

while getopts "h?dDj:" opt; do
case $opt in
h|\?)
usage
exit 0
;;
d)
echo "[$0] Building with debug symbols."
BUILD_TYPE="-debug"
;;
D)
echo "[$0] Developer build enabled."
DEVELOPER_BUILD=1
;;
j)
echo "[$0] Building with $OPTARG threads."
N_THREADS=$OPTARG
;;
esac
done

RELDIR=`dirname $0`
ABSDIR=`cd $RELDIR;pwd`

. $ABSDIR/build-qt5-env
THREADS=-j30
NEW_QTDIR=/usr/local/Trolltech/Qt5/Qt-5.0.0-$QT_WEEKLY_REV

rm -rf $NEW_QTDIR
THREADS=
if [ $N_THREADS -gt 1 ]; then
THREADS=-j$N_THREADS
fi

NEW_QTDIR=
INSTALL_TYPE=
if [ $DEVELOPER_BUILD ]; then
NEW_QTDIR=$ABSDIR/qt5/qtbase
INSTALL_TYPE=-developer-build
else
NEW_QTDIR=/usr/local/Trolltech/Qt5/Qt-5.0.0-$QT_WEEKLY_REV
INSTALL_TYPE="-prefix $NEW_QTDIR"
rm -rf $NEW_QTDIR
fi

if [ ! -d qt5 ]
then
Expand All @@ -33,17 +77,17 @@ echo ==========================================================
export QTDIR=$NEW_QTDIR
export PATH=$QTDIR/bin:$PATH

./configure -opensource -confirm-license -no-pch -nomake examples -nomake demos -nomake tests -no-gtkstyle -nomake translations -qt-zlib -qt-libpng -qt-libjpeg -qt-sql-sqlite -release -prefix $QTDIR
./configure -opensource -confirm-license -no-pch -nomake examples -nomake demos -nomake tests -no-gtkstyle -nomake translations -qt-zlib -qt-libpng -qt-libjpeg -qt-sql-sqlite $BUILD_TYPE $INSTALL_TYPE

cd qtbase && make $THREADS && make install && cd ..
cd qtbase && make $THREADS && if [ ! $DEVELOPER_BUILD ]; then make install; fi && cd ..
if [ $? -ne 0 ] ; then
echo FAIL: building qtbase
exit 1
fi

for module in $QT5_MODULES
do
cd $module && qmake && make $THREADS && make install && cd ..
cd $module && qmake && make $THREADS && if [ ! $DEVELOPER_BUILD ]; then make install; fi && cd ..
if [ $? -ne 0 ] ; then
echo FAIL: building $module.
exit 1
Expand Down

0 comments on commit 1ae6d25

Please sign in to comment.