You need to download the latest source code from Nokia website. Click here to download version 4.7.1. Ignore the below task if you already have download the source.
# wget http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.1.tar.gz
Untar the source to a local directory (example: /home/user/USER/)
# tar -xzvf qt-everywhere-opensource-src-4.7.1.tar.gz
Specify which cross-compiler to use by setting the PATH environment variable.
# export PATH=path/to/cross/compiler:$PATH
You have to modify the mkspecs/qws/linux-arm-g++/qmake.conf file for toolchain related paths that Qt will use for compilation. Modify the below entries according to your toolchain.
QMAKE_CC = arm-none-linux-gnueabi-gcc
QMAKE_CXX = arm-none-linux-gnueabi-g++
QMAKE_LINK = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
QMAKE_RANLIB = arm-none-linux-gnueabi-ranlib
Now your code base is ready for compilation. Start the compilation by following command.
# cd qt-everywhere-opensource-src-4.7.1
# ./configure -embedded arm -xplatform qws/linux-arm-g++ -prefix /usr/local/Qt \
-qt-mouse-tslib -little-endian -no-webkit -no-qt3support -no-cups -no-largefile \
-optimized-qmake -no-openssl -nomake tools
# make && make install
To run your ARM compiled applications we have to set following environment variables on the NFS root of the board.
# export TSLIB_TSEVENTTYPE=INPUT
# export TSLIB_CONSOLEDEVICE=none
# export TSLIB_FBDEVICE=/dev/fb0
# export TSLIB_TSDEVICE=/usr/input/ts
# export TSLIB_CALIBFILE=/usr/etc/pointercal
# export TSLIB_CONFFILE=/usr/etc/ts.conf
# export TSLIB_PLUGINDIR=/usr/lib/ts
# export LD_LIBRARY_PATH=/usr/local/Qt/lib
# export QTDIR=/usr/local/Qt
# export QWS_MOUSE_PROTO=tslib:/usr/input/ts
# export QWS_DISPLAY=LinuxFB:mmWidth=240:mmHeight=320
The Qt library binary (and fonts subdir) should be placed on a user defined directory of the board and then set LD_LIBRARY_PATH to this directory.
Qt binary application must be run with -qws command line argument to inform Qt that we are working on a Linux embedded system.