Qtopia PDA 2.2.2 交叉编译过程
By
2006-12-10
HOST 环境:
cpu:intel p4 2.8
内存:1g
系统:redhat 9 完全安装
交叉工具arm 2.95.3
TARGET环境
arm 2410
240*320屏外加触摸屏
jffs2文件系统
软件:
cross-2.95.3.tar.bz2 /cross-3.4.3.1.tar.bz2
qtopia-free-src-2.2.0.tar.gz
e2fsprogs-1.35.tar.gz
jpegsrc.v6b.tar.gz
libpng-1.2.14.tar.bz2
tslib-1.3.tar.bz2
zlib-1.2.3.tar.bz2
我的arm-linux-gcc 已安装到/usr/local/arm/2.95.3/bin/,并已设置$PATH变量
编译步骤:
1.解压qtopia-free-src-2.2.0.tar.gz,将其mv qtopia-free-2.2.0 到 /home/qtopia_x86
cd /home/qtopia_x86
./configure;make
得到本机运行版本uic 工具
解压qtopia-free-src-2.2.0.tar.gz 将其mv至 /home/nfs/qtopia-free-2.2.0/
cp /home/qtopia_x86/qt2/bin/uic /home/nfs/qtopia-free-2.2.0/qt2/bin/
2.编译相关库
将上面的e2fsprogs-1.35.tar.gz,jpegsrc.v6b.tar.gz, libpng-1.2.14.tar.bz2, tslib-1.3.tar.bz2, zlib-1.2.3.tar.bz2 解压至/home/arm目录,并相应更名目录为
e2fs jpeg libpng tslib zlib
并建立mkdir /home/arm/lib ;mkdir /home/arm/include (这两个目录是存放编译后的库与头文件,为后面交叉编译用)
e2fs:
./configure --host=arm-linux --enable-elf-shlibs --with-cc=arm-linux-gcc --with-linker=arm-linux-ld --prefix=/usr/local/arm/2.95.3/arm-linux
make
cp lib/libuuid.so* /home/arm/lib
jpeg:
./configure –enable-shared
vi Makefile
修改:
CC= arm-linux-gcc
AR= arm-linux-ar rc
AR2=arm-linux-ranlib
make
zlib:
cd /home/arm/zlib
./configure –shared
vi Makefile
修改:
[begin]
...
CC=arm-linux-gcc
...
LDSHARED=arm-linux-gcc -shared -Wl,-soname,libz.so.1
CPP=arm-linux-gcc -E
...
AR=arm-linux-ar rc
RANLIB=arm-linux-ranlib
...
prefix =/usr/local/arm/2.95.3/arm-linux
...
[end]
make
cp libz.so* /home/arm/lib/
cp *.h /home/arm/include/
libpng:
/home/arm/libpng
cp scripts/makefile.linux ./Makefile
vi Makefile
修改:
[begin]
...
AR_RC=arm-linux-ar rc
CC=arm-linux-gcc
...
RANLIB=arm-linux-ranlib
...
prefix=/usr/local/arm/2.95.3/arm-linux
...
[end]
make
cp libpng12.so* /home/arm/lib/
cp libpng12.so /home/arm/lib/libpng.so
cp *.h /home/arm/include/
tslib:
/home/arm/tslib
./autogen.sh
echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
./configure --host=arm-linux --cache-file=arm-linux.cache –enable-inputapi=no
在make之前,为了支持触摸屏,这里有一点小小的修改,打开src/ts_read_raw.c文件,查看你的触摸屏驱动程序数据结构,看与ts_read_raw.c结构中的哪个一样,就将代码中的
char *defaulttseventtype="UCB1x00";
修改为
char *defaulttseventtype="H3600"; //这里因为我的驱动是h3600_ts_event结构,修改为你驱动对应的结构,好了,如果你触摸屏驱动程序支持ioctrl操作,上面的configure操作中的[—enable-inputapi=no]你可以删除。好了,现在可以make了,^_^
make
cp src/.libs/libts-0.0.so.0* /home/arm/lib/
cp src/.libs/libts.so /home/arm/lib/
cp src/*.h /home/arm/include/
3.编译Qtopia PDA 了
建立PDA安装目录
mkdir /home/nfs/qtopia
cd /home/nfs/qtopia-free-2.2.0
修改文件
vi /home/nfs/qtopia-free-2.2.0/qtopia/mkspecs/qws/linux-arm-g++/qmake.conf
将此行
QMAKE_LIBS_QT = -lqte
修改为
QMAKE_LIBS_QT = -lqte -lpng -lts -lz -luuid -ljpeg
再:
export QTDIR=/home/nfs/qtopia-free-2.2.0/qt2
export QPEDIR=/home/nfs/qtopia-free-2.2.0
export LD_LIBRARY_PATH=$QTDIR/lib:$QPEDIR/lib:$LD_LIBRARY_PATH
export TMAKEDIR=/home/nfs/qtopia-free-2.2.0/tmake
export TMAKEPATH=$TMAKEDIR/lib/qws/linux-arm-g++
cp /home/nfs/qtopia-free-2.2.0/qtopia/src/qt/qconfig-qpe.h /home/nfs/qtopia-free-2.2.0/qt2/src/tools
cd $QPEDIR/qtopia/src/libraries/qtopia
cp custom-linux-ipaq-g++.cpp custom-linux-arm-g++.cpp
cp custom-linux-ipaq-g++.h custom-linux-arm-g++.h
开始configure了
cd /home/nfs/qtopia-free-2.2.0
./configure -qte "-embedded -xplatform linux-arm-g++ -qconfig qpe -no-qvfb -depths 16,24 -system-jpeg -system-libpng -system-zlib -tslib -gif -thread -no-xft -release -I/home/arm/include -L/home/arm/lib -lpng -lts -lz -luuid -ljpeg" -qpe '-xplatform linux-arm-g++ -edition pda -displaysize 240x320 -I/home/arm/include -L/home/arm/lib -prefix=/home/nfs/qtopia'
最后
make
make install
拷贝库与触摸屏校准/测试程序
mkdir /home/nfs/qtopia/bin/tests
mkdir /home/nfs/qtopia/lib/ts
cp /home/arm/tslib/tests/.libs/ts_* /home/nfs/qtopia/bin/tests
cp /home/arm/tslib/src/.libs/libts-0.0.so.0* /home/nfs/qtopia/lib
cp /home/arm/tslib/src/.libs/libts.so /home/nfs/qtopia/lib
cp /home/arm/tslib/plugins/*.o /home/nfs/qtopia/lib/ts/
把文件/home/arm/tslib/etc/ts.conf文件拷贝到你的板子的/etc/目录下
4.运行[以下操作在目标板上进行]:
在你的板子上设置运行环境变量
export QTDIR=/mnt/nfs/qtopia
export QPEDIR=/mnt/nfs/qtopia
export QWS_MOUSE_PROTO=TPanel:/dev/touchscreen/0
export LD_LIBRARY_PATH=/mnt/nfs/qtopia/lib
export TSLIB_TSDEVICE=/dev/touchscreen/0
export TSLIB_CONSOLEDEVICE=/dev/vc/
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=$QTDIR/lib/ts
mount -t nfs [host_ip]/home/nfs /mnt/nfs
校准屏幕(5点校准)
cd /mnt/nfs/qtopia/bin/tests
./ts_calibrate
运行PDA
/home/nfs/qtopia/bin
./qpe
阅读(2002) | 评论(0) | 转发(0) |