分类: 嵌入式
2016-02-05 10:28:31
1 Creating Ubuntu environment
(1) Download: ubuntu-10.04.4-desktop-i386.iso
(2) Install in VMware Workstation
(3) Prepare cross–compiling tools
Download: arm-2007q3-51-arm-none-linux-gnueabi.bin
sudo ./arm-2007q3-51-arm-none-linux-gnueabi.bin
vim ~/.bashrc add: export PATH= /opt/CodeSourcery/Sourcery_G++_Lite/bin:$PATH
source ./bashrc
(4) Related tools
sudo apt-get install g++
sudo apt-get install autoconf
sudo apt-get install libtool
2 Preparing for Tslib
(1) Download: tslib-master.zip
(2) Cross-compile tslib
./autogen-clean.sh
./autogen.sh
./configure --host=arm-none-linux-gnueabi --prefix=/usr/local/tslib CC=/opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc
make
sudo make
install
3 Preparing for QT
(1) Download: qt-everywhere-opensource-src-4.6.2.tar.gz
(2) Cross-compiling QtEmbedded-4.6.2-arm
# modify: qt-everywhere-opensource-src-4.6.2/mkspecs/qws/linux-arm-g++/qmake.conf
# arm-linux-gcc --> arm-none-linux-gnueabi-gcc
# add QMAKE_INCDIR += /usr/local/tslib/include
# QMAKE_LIBDIR += /usr/local/tslib/lib
# modify: qt-everywhere-opensource-src-4.6.2/mkspecs/common/linux.conf
# add -lts in QMAKE_LIBS_THREAD
# configure error: qt-everywhere-opensource-src-4.6.2/src/corelib/tools/qlocale.cpp:6541: error: ‘fenv_t’ was not declared in this scope
# solution: cp /usr/include/fenv.h qt-everywhere-opensource-src-4.6.2/src/corelib/tools/
# vim qlocale.cpp: include
export CPLUS_INCLUDE_PATH=/opt/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/include/c++:/opt/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/include/c++/4.2.1/arm-none-linux-gnueabi
export TSLIB_ROOT=/usr/local/tslib
export PKG_CONFIG_PATH=$TSLIB_ROOT/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$TSLIB_ROOT/lib:$LD_LIBRARY_PATH
./configure \
-force-pkg-config \
-prefix /usr/local/Trolltech/QtEmbedded-4.6.2-arm \
-opensource \
-confirm-license \
-release -shared \
-embedded arm \
-xplatform qws/linux-arm-g++ \
-depths all\
-fast \
-optimized-qmake \
-pch \
-qt-sql-sqlite \
-qt-libjpeg \
-qt-zlib \
-qt-libpng \
-qt-freetype \
-little-endian -host-little-endian \
-no-qt3support \
-no-libtiff -no-libmng \
-no-opengl \
-no-mmx -no-sse -no-sse2 \
-no-3dnow \
-no-openssl \
-no-webkit \
-no-qvfb \
-no-phonon \
-no-nis \
-no-opengl \
-no-cups \
-no-glib \
-no-xcursor -no-xfixes -no-xrandr -no-xrender \
-no-separate-debug-info \
-nomake examples -nomake tools -nomake docs \
-qt-mouse-tslib -L/usr/local/tslib/lib -I/usr/local/tslib/include
make
sudo make install
4 Transplanting
(1) Transplant tslib
cd /usr/local
sudo tar -czvf tslib.tar.gz tslib
(2) Transplant QtEmbedded-4.6.2-arm
cd /usr/local/Trolltech/QtEmbedded-4.6.2-arm
sudo mkdir QtEmbedded-4.6.2-arm
sudo cp -r lib/ QtEmbedded-4.6.2-arm/
sudo cp -r plugins/ QtEmbedded-4.6.2-arm/
sudo cp -r translations/ QtEmbedded-4.6.2-arm/
sudo tar -czvf QtEmbedded-4.6.2-arm.tar.gz QtEmbedded-4.6.2-arm
(3) Setting embedded board environment
# place tslib in /usr/local
# place QtEmbedded-4.6.2-arm in /usr/local/ Trolltech
export QTDIR=/usr/local/Trolltech/QtEmbedded-4.6.2-arm
export TSLIB_ROOT=/usr/local/tslib
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:$TSLIB_ROOT/lib:$QTDIR/lib:$LD_LIBRARY_PATH
export TSLIB_TSDEVICE=/dev/input/event5
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_CONFFILE=/usr/local/tslib/etc/ts.conf
export POINTERCAL_FILE=/etc/pointercal
export TSLIB_CALIBFILE=/etc/pointercal
export QWS_MOUSE_PROTO=Tslib:/dev/input/event5
(4) Modifing ts.conf
module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear
(5) Calibrating touchscreen
cd /etc & touch pointercal
And running: ts_calibrate
You can check the result by running: ts_test