qt-configure-tizen.sh 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. #!/bin/bash
  2. set -e
  3. CURRENT_DIR=$PWD
  4. SCRIPTDIR=$(cd $(dirname $0); pwd)
  5. export MAKEFLAGS="-j $(cat /proc/cpuinfo | grep -c proc)"
  6. export TIZEN_SDK_ROOT=~/tizen-sdk
  7. export TIZEN_TOOLCHAIN_VERSION=4.8
  8. function setX86Toolchain() {
  9. export TIZEN_TOOLCHAIN_PREFIX=i386-linux-gnueabi
  10. export TIZEN_SYSROOT=$TIZEN_SDK_ROOT/platforms/mobile-2.3/rootstraps/mobile-2.3-emulator.core
  11. export COMPILER_BIN_PATH=$TIZEN_SDK_ROOT/tools/$TIZEN_TOOLCHAIN_PREFIX-gcc-$TIZEN_TOOLCHAIN_VERSION/bin
  12. export COMPILER=$TIZEN_TOOLCHAIN_PREFIX-gcc
  13. export PATH=$COMPILER_BIN_PATH:$PATH
  14. }
  15. function setArmv7lToolchain() {
  16. export TIZEN_TOOLCHAIN_PREFIX=arm-linux-gnueabi
  17. export TIZEN_SYSROOT=$TIZEN_SDK_ROOT/platforms/mobile-2.3/rootstraps/mobile-2.3-device.core
  18. export COMPILER_BIN_PATH=$TIZEN_SDK_ROOT/tools/$TIZEN_TOOLCHAIN_PREFIX-gcc-$TIZEN_TOOLCHAIN_VERSION/bin
  19. export COMPILER=$TIZEN_TOOLCHAIN_PREFIX-gcc
  20. export PATH=$COMPILER_BIN_PATH:$PATH
  21. }
  22. if [ "$XCB_INSTALL_PATH" = "" ]; then
  23. export XCB_INSTALL_PATH=$(mktemp -d)
  24. export XCB_SOURCES_PATH=$(mktemp -d)
  25. echo XCB_SOURCES_PATH: $XCB_SOURCES_PATH
  26. echo XCB_INSTALL_PATH: $XCB_INSTALL_PATH
  27. cd $XCB_SOURCES_PATH
  28. wget -O xproto.tar.gz http://xorg.freedesktop.org/releases/individual/proto/xproto-7.0.27.tar.gz
  29. wget -O libpthread-stubs.tar.gz http://xcb.freedesktop.org/dist/libpthread-stubs-0.3.tar.gz
  30. wget -O libXau.tar.gz http://xorg.freedesktop.org/releases/individual/lib/libXau-1.0.8.tar.gz
  31. wget -O xcb-proto.tar.gz http://xcb.freedesktop.org/dist/xcb-proto-1.11.tar.gz
  32. wget -O libxcb.tar.gz http://xcb.freedesktop.org/dist/libxcb-1.11.tar.gz
  33. function buildAndInstall() {
  34. mkdir $1
  35. tar -xf $1.tar.gz -C $1 --strip-components 1
  36. export PKG_CONFIG_PATH=$2/lib/pkgconfig
  37. export CC=$COMPILER
  38. export CFLAGS="--sysroot $TIZEN_SYSROOT -fPIC"
  39. cd $1
  40. if [ "$1" != "libxcb" ]; then
  41. ./configure --host $TIZEN_TOOLCHAIN_PREFIX --disable-shared --with-pic --prefix $2
  42. else
  43. ./configure --host $TIZEN_TOOLCHAIN_PREFIX --prefix $2 \
  44. --with-pic \
  45. --disable-shared \
  46. --disable-composite \
  47. --disable-damage \
  48. --disable-dpms \
  49. --disable-dri2 \
  50. --disable-dri3 \
  51. --disable-glx \
  52. --disable-present \
  53. --disable-randr \
  54. --disable-record \
  55. --disable-render \
  56. --disable-resource \
  57. --disable-screensaver \
  58. --disable-shape \
  59. --disable-shm \
  60. --disable-sync \
  61. --disable-xevie \
  62. --disable-xfixes \
  63. --disable-xfree86-dri \
  64. --disable-xinerama \
  65. --disable-xinput \
  66. --disable-xkb \
  67. --disable-xprint \
  68. --disable-selinux \
  69. --disable-xtest \
  70. --disable-xv \
  71. --disable-xvmc
  72. # rm $2/lib/*.so*
  73. fi
  74. make && make install
  75. unset CC CFLAGS
  76. cd ..
  77. rm -rf $1
  78. }
  79. parts="xproto libpthread-stubs libXau xcb-proto libxcb"
  80. setX86Toolchain
  81. for part in $parts; do
  82. buildAndInstall $part $XCB_INSTALL_PATH/x86
  83. done
  84. setArmv7lToolchain
  85. for part in $parts; do
  86. buildAndInstall $part $XCB_INSTALL_PATH/armv7l
  87. done
  88. fi
  89. cd $CURRENT_DIR
  90. for i in {1..200}; do
  91. padding="${padding}_"
  92. done
  93. RPATH_TO_REPLACE="@${padding}PADDING${padding}@"
  94. function buildQt() {
  95. cd qtbase
  96. git clean -fdx .
  97. set -x
  98. ./configure \
  99. -confirm-license \
  100. -no-glib \
  101. -verbose \
  102. -xplatform devices/linux-g++-tizen-2.x-mobile \
  103. -device-option TIZEN_PROFILE="mobile" \
  104. -device-option $3 \
  105. -device-option $4 \
  106. -device-option XCB_STATIC_LINK=1 \
  107. -device-option TIZEN_ADDITIONAL_INCLUDES=$2/include \
  108. -device-option TIZEN_ADDITIONAL_LIBS=$2/lib \
  109. -opengl es2 \
  110. -egl \
  111. -no-eglfs \
  112. -no-linuxfb \
  113. -qpa xcb \
  114. -no-rpath \
  115. -force-eglx \
  116. -extprefix $1 \
  117. -opensource \
  118. -no-sql-ibase \
  119. -no-sql-mysql \
  120. -no-sql-odbc \
  121. -no-sql-psql \
  122. -plugin-sql-sqlite \
  123. -no-sql-sqlite2 \
  124. -no-sql-tds \
  125. -system-sqlite \
  126. -audio-backend \
  127. -system-zlib \
  128. -optimized-qmake \
  129. -dbus-linked \
  130. -verbose \
  131. -no-gtkstyle \
  132. -no-openvg \
  133. -nomake tests \
  134. -nomake examples \
  135. -no-xinput2 \
  136. -qt-xkbcommon \
  137. -xkb-config-root /etc/X11/xkb \
  138. -qt-xcb\
  139. -no-pkg-config \
  140. -R "$RPATH_TO_REPLACE"
  141. set +x
  142. make && make install
  143. echo "[Paths]
  144. Prefix = ..
  145. Examples=../../Examples/Qt-5.4
  146. Documentation=../../Docs/Qt-5.4" > $1/bin/qt.conf
  147. cat $1/mkspecs/qdevice.pri | grep -P "TIZEN_EMULATOR|TIZEN_PROFILE|TIZEN_TARGET_ARCH" > $1/mkspecs/qdevice.pri.tmp
  148. mv $1/mkspecs/qdevice.pri.tmp $1/mkspecs/qdevice.pri
  149. cd ../tizendeployqt
  150. $CURRENT_DIR/qtbase/bin/qmake
  151. make && make install
  152. cd ..
  153. QT_MODULES="qtimageformats qtxmlpatterns qtdeclarative qtgraphicaleffects qtquickcontrols qtsensors qttools qtsvg"
  154. for module in $QT_MODULES; do
  155. echo "Building $module"
  156. cd $module
  157. git clean -fdx .
  158. $1/bin/qmake
  159. make && make install
  160. cd ..
  161. done
  162. }
  163. setX86Toolchain
  164. buildQt ~/QtInstall/tizen_x86 $XCB_INSTALL_PATH/x86 TIZEN_EMULATOR=1 TIZEN_TARGET_ARCH=i386
  165. setArmv7lToolchain
  166. buildQt ~/QtInstall/tizen_armv7l $XCB_INSTALL_PATH/armv7l TIZEN_EMULATOR=0 TIZEN_TARGET_ARCH=armv7l
  167. echo "Building tizen plugin"
  168. export INSTALL_PATH=~/QtInstall
  169. $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