123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- #!/bin/bash
- set -e
- CURRENT_DIR=$PWD
- SCRIPTDIR=$(cd $(dirname $0); pwd)
- export MAKEFLAGS="-j $(cat /proc/cpuinfo | grep -c proc)"
- export TIZEN_SDK_ROOT=~/tizen-sdk
- export TIZEN_TOOLCHAIN_VERSION=4.8
- function setX86Toolchain() {
- export TIZEN_TOOLCHAIN_PREFIX=i386-linux-gnueabi
- export TIZEN_SYSROOT=$TIZEN_SDK_ROOT/platforms/mobile-2.3/rootstraps/mobile-2.3-emulator.core
- export COMPILER_BIN_PATH=$TIZEN_SDK_ROOT/tools/$TIZEN_TOOLCHAIN_PREFIX-gcc-$TIZEN_TOOLCHAIN_VERSION/bin
- export COMPILER=$TIZEN_TOOLCHAIN_PREFIX-gcc
- export PATH=$COMPILER_BIN_PATH:$PATH
- }
- function setArmv7lToolchain() {
- export TIZEN_TOOLCHAIN_PREFIX=arm-linux-gnueabi
- export TIZEN_SYSROOT=$TIZEN_SDK_ROOT/platforms/mobile-2.3/rootstraps/mobile-2.3-device.core
- export COMPILER_BIN_PATH=$TIZEN_SDK_ROOT/tools/$TIZEN_TOOLCHAIN_PREFIX-gcc-$TIZEN_TOOLCHAIN_VERSION/bin
- export COMPILER=$TIZEN_TOOLCHAIN_PREFIX-gcc
- export PATH=$COMPILER_BIN_PATH:$PATH
- }
- if [ "$XCB_INSTALL_PATH" = "" ]; then
- export XCB_INSTALL_PATH=$(mktemp -d)
- export XCB_SOURCES_PATH=$(mktemp -d)
- echo XCB_SOURCES_PATH: $XCB_SOURCES_PATH
- echo XCB_INSTALL_PATH: $XCB_INSTALL_PATH
- cd $XCB_SOURCES_PATH
- wget -O xproto.tar.gz http://xorg.freedesktop.org/releases/individual/proto/xproto-7.0.27.tar.gz
- wget -O libpthread-stubs.tar.gz http://xcb.freedesktop.org/dist/libpthread-stubs-0.3.tar.gz
- wget -O libXau.tar.gz http://xorg.freedesktop.org/releases/individual/lib/libXau-1.0.8.tar.gz
- wget -O xcb-proto.tar.gz http://xcb.freedesktop.org/dist/xcb-proto-1.11.tar.gz
- wget -O libxcb.tar.gz http://xcb.freedesktop.org/dist/libxcb-1.11.tar.gz
- function buildAndInstall() {
- mkdir $1
- tar -xf $1.tar.gz -C $1 --strip-components 1
- export PKG_CONFIG_PATH=$2/lib/pkgconfig
- export CC=$COMPILER
- export CFLAGS="--sysroot $TIZEN_SYSROOT -fPIC"
- cd $1
- if [ "$1" != "libxcb" ]; then
- ./configure --host $TIZEN_TOOLCHAIN_PREFIX --disable-shared --with-pic --prefix $2
- else
- ./configure --host $TIZEN_TOOLCHAIN_PREFIX --prefix $2 \
- --with-pic \
- --disable-shared \
- --disable-composite \
- --disable-damage \
- --disable-dpms \
- --disable-dri2 \
- --disable-dri3 \
- --disable-glx \
- --disable-present \
- --disable-randr \
- --disable-record \
- --disable-render \
- --disable-resource \
- --disable-screensaver \
- --disable-shape \
- --disable-shm \
- --disable-sync \
- --disable-xevie \
- --disable-xfixes \
- --disable-xfree86-dri \
- --disable-xinerama \
- --disable-xinput \
- --disable-xkb \
- --disable-xprint \
- --disable-selinux \
- --disable-xtest \
- --disable-xv \
- --disable-xvmc
- # rm $2/lib/*.so*
- fi
- make && make install
- unset CC CFLAGS
- cd ..
- rm -rf $1
- }
- parts="xproto libpthread-stubs libXau xcb-proto libxcb"
- setX86Toolchain
- for part in $parts; do
- buildAndInstall $part $XCB_INSTALL_PATH/x86
- done
- setArmv7lToolchain
- for part in $parts; do
- buildAndInstall $part $XCB_INSTALL_PATH/armv7l
- done
- fi
- cd $CURRENT_DIR
- for i in {1..200}; do
- padding="${padding}_"
- done
- RPATH_TO_REPLACE="@${padding}PADDING${padding}@"
- function buildQt() {
- cd qtbase
- git clean -fdx .
- set -x
- ./configure \
- -confirm-license \
- -no-glib \
- -verbose \
- -xplatform devices/linux-g++-tizen-2.x-mobile \
- -device-option TIZEN_PROFILE="mobile" \
- -device-option $3 \
- -device-option $4 \
- -device-option XCB_STATIC_LINK=1 \
- -device-option TIZEN_ADDITIONAL_INCLUDES=$2/include \
- -device-option TIZEN_ADDITIONAL_LIBS=$2/lib \
- -opengl es2 \
- -egl \
- -no-eglfs \
- -no-linuxfb \
- -qpa xcb \
- -no-rpath \
- -force-eglx \
- -extprefix $1 \
- -opensource \
- -no-sql-ibase \
- -no-sql-mysql \
- -no-sql-odbc \
- -no-sql-psql \
- -plugin-sql-sqlite \
- -no-sql-sqlite2 \
- -no-sql-tds \
- -system-sqlite \
- -audio-backend \
- -system-zlib \
- -optimized-qmake \
- -dbus-linked \
- -verbose \
- -no-gtkstyle \
- -no-openvg \
- -nomake tests \
- -nomake examples \
- -no-xinput2 \
- -qt-xkbcommon \
- -xkb-config-root /etc/X11/xkb \
- -qt-xcb\
- -no-pkg-config \
- -R "$RPATH_TO_REPLACE"
- set +x
- make && make install
- echo "[Paths]
- Prefix = ..
- Examples=../../Examples/Qt-5.4
- Documentation=../../Docs/Qt-5.4" > $1/bin/qt.conf
- cat $1/mkspecs/qdevice.pri | grep -P "TIZEN_EMULATOR|TIZEN_PROFILE|TIZEN_TARGET_ARCH" > $1/mkspecs/qdevice.pri.tmp
- mv $1/mkspecs/qdevice.pri.tmp $1/mkspecs/qdevice.pri
- cd ../tizendeployqt
- $CURRENT_DIR/qtbase/bin/qmake
- make && make install
- cd ..
- QT_MODULES="qtimageformats qtxmlpatterns qtdeclarative qtgraphicaleffects qtquickcontrols qtsensors qttools qtsvg"
- for module in $QT_MODULES; do
- echo "Building $module"
- cd $module
- git clean -fdx .
- $1/bin/qmake
- make && make install
- cd ..
- done
- }
- setX86Toolchain
- buildQt ~/QtInstall/tizen_x86 $XCB_INSTALL_PATH/x86 TIZEN_EMULATOR=1 TIZEN_TARGET_ARCH=i386
- setArmv7lToolchain
- buildQt ~/QtInstall/tizen_armv7l $XCB_INSTALL_PATH/armv7l TIZEN_EMULATOR=0 TIZEN_TARGET_ARCH=armv7l
- echo "Building tizen plugin"
- export INSTALL_PATH=~/QtInstall
- $SCRIPTDIR/../qtcreator/build_and_deploy_tizen_plugin.sh -q ~/Qt/5.4/gcc_64/bin/qmake -b ~/Qt/Tools/QtCreator -s $CURRENT_DIR/qt-creator
|