123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- #!/bin/bash
- # Copyright (C) 2013 Tomasz Olszak <olszak.tomasz@gmail.com>
- # All rights reserved.
- # Redistribution and use in source and binary forms, with or without
- # modification, are permitted provided that the following conditions
- # are met:
- # 1. Redistributions of source code must retain the copyright
- # notice, this list of conditions and the following disclaimer.
- # 2. Redistributions in binary form must reproduce the copyright
- # notice, this list of conditions and the following disclaimer in the
- # documentation and/or other materials provided with the distribution.
- # 3. The name of the author may not be used to endorse or promote products
- # derived from this software without specific prior written permission.
- #
- # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- #
- set -e
- CURRENT_DIR=$(pwd)
- SCRIPT_DIR=$(dirname $0)
- cd $SCRIPT_DIR
- SCRIPT_DIR=$PWD
- cd $CURRENT_DIR
- function usage {
- echo -e "\n"
- echo "Script for Qt for tizen compilation. "
- echo "Set Parameters or environment variables with absolute paths"
- echo ""
- echo "Usage:"
- echo "[MAKE_THREADS=numberOfCPUCores] [QT5SRCDIR=Qt5SrcPath] [INSTALLDIR=QtInstallPrefix] ./downloadAndBuildAll.sh"
- echo ""
- echo "QT5SRCDIR - directory with qt5 sources"
- echo "INSTALLDIR - here qmake and other host binaries will be installed"
- echo "CROSS_COMPILER - absolute path to Tizen cross compiler"
- echo "QT_TIZEN_DEVICE_MKSPEC - Qt tizen device mkspec"
- echo "TARGET_ARCH - arch (i386,armv7l)"
- echo "If corresponding environment variables are set then script can be invoked without parameters"
- echo "set MAKE_THREADS environment variable to number of your CPU cores to fast up compilation step"
- echo ""
- cd $CURRENT_DIR
- exit;
- }
- if [ "$1" == "-h" -o "$1" == "--help" ]; then
- usage
- fi
- if [ "$QT5SRCDIR" == "" ]; then
- QT5SRCDIR=$PWD/qt5.gitorious
- echo "Setting QT5SRCDIR to $QT5SRCDIR"
- fi
- if [ "$INSTALLDIR" == "" ]; then
- INSTALLDIR=$PWD/qt5hostInstall
- echo "Setting INSTALLDIR to $INSTALLDIR"
- fi
- if [ "$TARGET_ARCH" == "" ]; then
- echo "TARGET_ARCH variable undefined"
- usage
- fi
- if [ "$QT5SRCDIR" == "$PWD/qt5.gitorious" ]; then
- if [ ! -d qt5.gitorious ]; then
- mkdir qt5.gitorious
- cd qt5.gitorious
- $PWD/../../scripts/clone_or_update_tizen_repos
- cd ..
- else
- echo "Looks like qt5.gitorious directory exists"
- fi;
- fi;
- mkdir -p buildQt5/qtbase
- cd buildQt5/qtbase
- echo "================================================="
- echo "Configuration:"
- echo "QT5SRCDIR=$QT5SRCDIR"
- echo "INSTALLDIR=$INSTALLDIR"
- echo "CROSS_COMPILER=$CROSS_COMPILER"
- echo "QT_TIZEN_DEVICE_MKSPEC=$QT_TIZEN_DEVICE_MKSPEC"
- echo "================================================="
- if [ "$CROSS_COMPILER" == "" ]; then
- echo "You must set CROSS_COMPILER variable"
- exit 1
- fi
- if [ "$QT_TIZEN_DEVICE_MKSPEC" == "" ]; then
- echo "You must set QT_TIZEN_DEVICE_MKSPEC variable"
- exit 1
- fi
- TIZENSYSROOT=$CURRENT_DIR/GBS-ROOT-CROSSCOMPILE/local/BUILD-ROOTS/scratch.$TARGET_ARCH.0
- export PKG_CONFIG_LIBDIR=$TIZENSYSROOT/usr/lib
- export PKG_CONFIG_SYSROOT_DIR=$TIZENSYSROOT
- export PKG_CONFIG_PATH=$TIZENSYSROOT/usr/lib/pkgconfig
- $QT5SRCDIR/qtbase/configure --disable-static -no-rpath -confirm-license -opensource -no-warnings-are-errors -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -plugin-sql-sqlite -no-sql-sqlite2 -no-sql-tds -nomake tests -nomake examples -verbose -device $QT_TIZEN_DEVICE_MKSPEC -device-option CROSS_COMPILE=$CROSS_COMPILER -no-widgets -qpa xcb -qt-xcb -no-eglfs -sysroot $TIZENSYSROOT -hostprefix $INSTALLDIR -opengl es2 -extprefix $INSTALLDIR
- MAKE_ARGS=""
- if [ "$MAKE_THREADS" != "" ]; then
- echo "setting make thread"
- MAKE_ARGS="-j $MAKE_THREADS"
- fi
- echo =======================
- echo building qtbase: make $MAKE_ARGS
- echo =======================
- make $MAKE_ARGS
- echo Installing qtbase: make install $MAKE_ARGS
- make install $MAKE_ARGS
- cd ..
- #without qtbase
- parts="qtxmlpatterns qtgraphicaleffects qtimageformats qtdeclarative qtquickcontrols qtquickcontrols-tizen qtsensors qttools"
- for repo in $parts; do
- echo =======================
- echo building $repo: make $MAKE_ARGS
- echo =======================
- mkdir -p $repo
- cd $repo
- $INSTALLDIR/bin/qmake $QT5SRCDIR/$repo
- make $MAKE_ARGS
- echo Installing qtbase: make install $MAKE_ARGS
- make install $MAKE_ARGS
- cd ..
- done
- cd $CURRENT_DIR
|