[转]Qtopia2.2.0移植
?原文:http://blog.mcuol.com/User/longren/article/11362_1.htm
第一步:編譯jpeg-6b得到j(luò)peg庫
先使用命令進(jìn)行配置:./configure –enable-shared –enable-static –prefix=/install_software –build=i386 –host=arm
然后修改生成的Makefile ,如下:
CC=? gcc 修改為:CC= arm-linux-gcc
AR= ar rc 修改為:AR= arm-linux-ar rc
AR2= ranlib 修改為:AR2=arm-linux-ranlib
最后是編譯和安裝
make
安裝之前要在安裝的路徑下面建幾個(gè)目錄: /man/man1 , /lib , /include , /bin,否則提示:
No such file or directory
make? install-lib
第二步:編譯e2fsprogs-1.41.4 得到uuid庫
在源文件目錄下建立一個(gè)目錄放mke2fs工具:mkdir build
# cd build
#../configure –with-cc=arm-linux-gcc? –with-linker=arm-linux-ld? --enable-elf-shlibs? --host=arm? -prefix=/install_software/e2fsprogs
編譯
#make
錯(cuò)誤:In file included from http://www.cnblogs.com/../lib/ext2fs/getsize.c:30:
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/http://www.cnblogs.com/http://www.cnblogs.com/arm-linux/sys-include/linux/fd.h:342: error: variable or field `__user'' declared void
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/http://www.cnblogs.com/http://www.cnblogs.com/arm-linux/sys-include/linux/fd.h:342: error: parse error before ''*'' token
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/http://www.cnblogs.com/http://www.cnblogs.com/arm-linux/sys-include/linux/fd.h:360: error: parse error before ''}'' token
make[2]: *** [getsize.o] Error 1
解決:在引用#include 的文檔前面加上??? #include
安裝
make install-libs
第三步:編譯觸摸屏共享庫tslib-1.0(tslib-1.4版本)
(1)# cd tslib-1.0/?? 進(jìn)入tslib的目錄
(2)# ./autogen.sh?? 生成config文件
(3)# echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache? //為了防止出現(xiàn)undefined reference to `rpl_malloc'' 錯(cuò)誤
(4)# ./configure –host=arm-linux –cache-file=arm-linux.cache? -enable-inputapi=no ?--prefix=/opt/tslib1.4?????? //--prefix增加安裝路徑
(5)make
(6)make install
(7)庫文件在 /tslib-1.0/src/.lib
(8)拷貝各種文件
?# cp ts_calibrate ts_harvest ts_print ts_print_raw ts_test ??/long_nfs/myfs-1/qtopia/bin/tests/?? //為根文件系統(tǒng)
# cp libts-0.0.so.0*? /long_nfs/myfs-1/qtopia/lib
# cp libts.so?? /long_nfs/myfs-1/qtopia/lib
# cp tslib-1.0/plugins/.libs/*.so ?/long_nfs/myfs-1/qtopia/lib/ts
第四步:實(shí)現(xiàn)qtopia-free-2.2.0的移植
(1)?????? 拷貝庫文件
拷貝uuid庫
?????? cp –rfv ?build/lib/uuid??? qtopia/include
?????? cp –fvr ?build/lib/libuuid.so*? /usr/local/arm/3.4.1/arm-linux/lib
?????? 拷貝jpeg庫
?????? cp -rfv libjpeg.so*? /Qtopia-repot/qtopia-free-2.2.0/qt2/lib
?????? cp -fvr jpeglib.h? /Qtopia-repot/qtopia-free-2.2.0/qt2/include? //解壓出來沒有include這個(gè)文件
?????? cp -rfv libjpeg.so*? /Qtopia-repot/qtopia-free-2.2.0/qtopia/lib
?????? cp -fvr jpeglib.h? /Qtopia-repot/qtopia-free-2.2.0/qtopia/include //include是自己建立的,以后連接的時(shí)候注意一下路徑
(2) 配置命令如下:
????? ?./configure -qte ''embedded -no-xft -xplatform linux-arm-g++ -qc
onfig qpe -depths 16,32 -no-qvfb -system-jpeg -gif -tslib'' -qpe ''-xplatform linux-arm-g++ -edition
pda -displaysize 240x320'' -qt2 ''-no-xft'' -dqt ''-no-xft''
(3) 修改文件
??vi/home/arm/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? //(-lpng需要png庫,-lts???????????????? 是連接ts庫的) ?
(4)?????? export QTDIR=/home/arm/qtopia-free-2.2.0/qt2
?????? export QPEDIR=/home/arm/qtopia-free-2.2.0/qtopia
?????? export LD_LIBRARY_PATH=$QTDIR/lib:$QPEDIR/lib:$LD_LIBRARY_PATH
?????? export TMAKEDIR=/home/arm/qtopia-free-2.2.0/tmake
export TMAKEPATH=$TMAKEDIR/lib/qws/linux-arm-g++
cd $QPEDIR/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?
(5)?????? 另外一種configure方式,建議使用這種
#./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 320x240 -I/home/arm/include -L/home/arm/lib -prefix=/home/arm/qtopia''
解釋:-I/是需要的頭文件 –L/是需要連接的庫文件,要增加觸摸屏而且用到tslib的一定要加-lts ,-prefix=/是設(shè)置安裝路徑的
(6)?????? make? 編譯通過以后 make install 然后把相應(yīng)的庫文件拷貝到qtopia,然后將qtopia整個(gè)文件一起拷貝到根文件系統(tǒng)中,利用NFS掛載測(cè)試。 記著設(shè)置環(huán)境變量
export QTDIR=/qtopia
export QPEDIR=/qtopia
export QWS_MOUSE_PROTO=TPanel:/dev/ts0 (這個(gè)根據(jù)自己的情況設(shè)定)
export LD_LIBRARY_PATH=/qtopia/lib
export TSLIB_TSEVENTTYPE=H3600??對(duì)tslib中的設(shè)備結(jié)構(gòu)體定義
export TSLIB_CONSOLEDEVICE=none tslib運(yùn)行需要的控制臺(tái),這里就是LCD屏幕 ,設(shè)定控制臺(tái)設(shè)備為none,否則默認(rèn)為/dev/tty
export TSLIB_FBDEVICE=/dev/fb0??指定幀緩沖設(shè)備
export TSLIB_TSDEVICE=/dev/ts0 (這個(gè)根據(jù)自己的情況設(shè)定)
export TSLIB_CALIBFILE=/etc/pointercal指定觸摸屏校準(zhǔn)文件pintercal的存放位置
export TSLIB_CONFFILE=/etc/ts.conf 指定TSLIB設(shè)置文件的位置
export TSLIB_PLUGINDIR=$QTDIR/lib/ts 指定觸摸屏插件所在路徑
(7)?????? 校準(zhǔn)
#cd /qtopia/bin/tests
#./ts_calibrate
再運(yùn)行測(cè)試
#./ts_test
運(yùn)行PDA
#cd ..
#./qpe
出現(xiàn)“Tap anywhere to continue”,然后進(jìn)行qpe5點(diǎn)校準(zhǔn),進(jìn)入qpe
?
(8)?????? 建立一個(gè)腳本用來運(yùn)行qtopia,在開發(fā)板的根目錄/bin下建立qpe.sh文件,它用來設(shè)置環(huán)境變量,啟動(dòng)qtopia,內(nèi)容如下:
#!/bin/sh
export HOME=/root
export QTDIR=/qtopia
export QPEDIR=/qtopia
export QWS_DISPLAY=LinuxFb:/dev/fb0
export QWS_KEYBOARD="TTY:/dev/tty1"
#export QWS_MOUSE_PROTO="USB:/dev/mouse0"
export QWS_MOUSE_PROTO="TPanel:/dev/ts0"
export PATH=$QPEDIR/bin:$PATH
export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH
export TSLIB_PLUGINDIR=$QTDIR/lib/ts
$QPEDIR/bin/qpe &
?
(9)?????? 編譯的時(shí)候出現(xiàn)的錯(cuò)誤
kernel/qwsmouse_qws.cpp:63:19: tslib.h: No such file or directory
kernel/qwsmouse_qws.cpp: In member function `void QTSLibHandlerPrivate::openTs()'':
kernel/qwsmouse_qws.cpp:1773: error: `ts_open'' undeclared (first use this function)
kernel/qwsmouse_qws.cpp:1773: error: (Each undeclared identifier is reported only once for each function it appears in.)
kernel/qwsmouse_qws.cpp:1780: error: `ts_config'' undeclared (first use this function)
kernel/qwsmouse_qws.cpp:1784: error: `ts_fd'' undeclared (first use this function)
kernel/qwsmouse_qws.cpp: In member function `void QTSLibHandlerPrivate::closeTs()'':
kernel/qwsmouse_qws.cpp:1793: error: `ts_close'' undeclared (first use this function)
kernel/qwsmouse_qws.cpp: In member function `void QTSLibHandlerPrivate::readMouseData()'':
kernel/qwsmouse_qws.cpp:1855: error: aggregate `ts_sample sample'' has incomplete type and cannot be defined
kernel/qwsmouse_qws.cpp:1863: error: `ts_read'' undeclared (first use this function)
kernel/qwsmouse_qws.cpp: In member function `void QTSLibHandlerPrivate::interpolateSample()'':
kernel/qwsmouse_qws.cpp:1882: error: elements of array `ts_sample samples[25]'' have incomplete type
kernel/qwsmouse_qws.cpp:1882: error: storage size of `samples'' isn''t known
kernel/qwsmouse_qws.cpp:1893: error: `ts_read_raw'' undeclared (first use this function)
kernel/qwsmouse_qws.cpp:1916: error: invalid application of `sizeof'' to incomplete type `ts_sample''
kernel/qwsmouse_qws.cpp:1920: error: invalid application of `sizeof'' to incomplete type `ts_sample''
kernel/qwsmouse_qws.cpp: In static member function `static int QTSLibHandlerPrivate::sortByX(const void*, const void*)'':
kernel/qwsmouse_qws.cpp:1931: error: invalid use of undefined type `const struct ts_sample''
kernel/qwsmouse_qws.cpp:1931: error: forward declaration of `const struct ts_sample''
kernel/qwsmouse_qws.cpp:1932: error: invalid use of undefined type `const struct ts_sample''
kernel/qwsmouse_qws.cpp:1931: error: forward declaration of `const struct ts_sample''
kernel/qwsmouse_qws.cpp: In static member function `static int QTSLibHandlerPrivate::sortByY(const void*, const void*)'':
kernel/qwsmouse_qws.cpp:1942: error: invalid use of undefined type `const struct ts_sample''
kernel/qwsmouse_qws.cpp:1942: error: forward declaration of `const struct ts_sample''
kernel/qwsmouse_qws.cpp:1943: error: invalid use of undefined type `const struct ts_sample''
kernel/qwsmouse_qws.cpp:1942: error: forward declaration of `const struct ts_sample''
kernel/qwsmouse_qws.cpp: At global scope:
kernel/qwsmouse_qws.cpp:1624: warning: unused parameter ''mouseDev''
kernel/qwsmouse_qws.cpp:1624: warning: unused parameter ''mouseDev''
kernel/qwsmouse_qws.cpp: In member function `void QTSLibHandlerPrivate::interpolateSample()'':
kernel/qwsmouse_qws.cpp:1882: error: storage size of `samples'' isn''t known
kernel/qwsmouse_qws.cpp: At global scope:
kernel/qwsmouse_qws.cpp:160: warning: ''void limitToScreen(QPoint&)'' defined but not used
make[1]: *** [tmp/release-shared-linux-arm-g++-no-keypad/kernel/qwsmouse_qws.o] Error 1
make[1]: Leaving directory `/root/2410s/qtopia-free-2.2.0/qt2/src''
解決:將tslib/src目錄下的tslib.h tslib-filter.h tslib-private.h拷貝到如下目錄:
/root/2410s/qtopia-free-2.2.0/qtopia/include.
1:tsdev (compaq touchscreen emulation) is scheduled for removal.
See Documentation/feature-removal-schedule.txt for details.
這句是內(nèi)核發(fā)出的,在drivers\input\Tsdev.c?? tsdev_open()
2: option `module_raw'' not recognized
3: Cannot configure touchscreen /dev/ts0 (No such file or directory)
? qt2\src\kernel\qwsmouse_qws.pp openTs() 發(fā)出的
? 解決:將plugins拷貝到根文件系統(tǒng),正確指定export TSLIB_PLUGINDIR。
4: Couldnt load module input
No raw modules loaded.
ts_config: Success
解決:正確設(shè)置TSLIB_PLUGINDIR,而且要在/etc/profile中設(shè)置
轉(zhuǎn)載于:https://www.cnblogs.com/sky1991/archive/2013/04/29/3050726.html
總結(jié)
以上是生活随笔為你收集整理的[转]Qtopia2.2.0移植的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 匹配行linux中grep命令的使用
- 下一篇: Python包管理必备–pi