#!/bin/bash #+-------------------------------------------------------------------------------------------- #|Description: This shell script used to download qt-extended-4.4.3 code and cross compile it. #| Author: GuoWenxue #| ChangeLog: #| 1, Initialize 1.0.0 on 2012.03.28 #+-------------------------------------------------------------------------------------------- APP_NAME="qt-everywhere-opensource-src-4.6.4" PACK_SUFIX="tar.gz" DL_ADDR="http://releases.qt-project.org/qt4/source/$APP_NAME.$PACK_SUFIX" INST_PATH=/apps QT_INST_PATH=$INST_PATH/qt-everywhere-rpi ARCH=cortexa53 if [ -z "$ARCH" -a $# -gt 0 ] ; then ARCH=$1 fi sup_arch=("" "arm920t" ) function select_arch() { echo "Current support ARCH: " i=1 len=${#sup_arch[*]} while [ $i -lt $len ]; do echo "$i: ${sup_arch[$i]}" let i++; done echo "Please select: " index= read index ARCH=${sup_arch[$index]} } if [ -z "$CROSS" ] ; then if [ -z $ARCH ] ; then select_arch fi CROSS=/opt/rpi/arm-bcm2708/arm-linux-gnueabihf/bin/arm-linux-gnueabihf- fi export PATH=`dirname $CROSS`:$PATH mkdir -p ${QT_INST_PATH} echo "+------------------------------------------------------------------+" echo "| Build $APP_NAME for $ARCH " echo "| Crosstool: $CROSS" echo "+------------------------------------------------------------------+" # Download source code packet if [ ! -s $APP_NAME.$PACK_SUFIX ] ; then echo "+------------------------------------------------------------------+" echo "| Download $APP_NAME.$PACK_SUFIX now " echo "+------------------------------------------------------------------+" wget $DL_ADDR fi # Decompress source code packet if [ ! -d $APP_NAME ] ; then tar -xzf $APP_NAME.$PACK_SUFIX fi cd $APP_NAME #Configure for the QT ./configure -opensource -confirm-license -release -prefix ${QT_INST_PATH} \ -embedded arm -xplatform qws/linux-arm-g++ -shared -no-fast -no-largefile -no-multimedia \ -no-audio-backend -no-phonon -no-phonon-backend -no-svg -qt-freetype \ -little-endian -nomake tools -nomake docs -no-xmlpatterns \ -no-javascript-jit -no-script -no-scripttools -no-declarative -qt-zlib \ -no-gif -qt-libtiff -qt-libpng -no-libmng -qt-libjpeg -no-openssl \ -no-nis -no-cups -no-dbus -no-mmx -no-3dnow -no-sse -no-sse2 -no-rpath -no-glib \ -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info make -j 16 && make install cd -