- Qt 4.6.3(包含Webkit)移植在Andestech platform
基本上移植的方法沒什麼不同
除了alway inline 不需作修改
改以直接在configure的時候定義 ALWAYS_INLINE
-D ALWAYS_INLINE=inline
我把需要的檔案整理在SourceForge的Andes QT Port Project中
http://sourceforge.net/downloads/andesqt/
SourceForge比較大方沒有單一檔案大小100MB的限制:-) 比起Google Code
- ag101_image_with_unalign_access是有開啟unalign access的Kernel但我沒有實際測試過,手邊只有Leopard
- bashrc.nds32le-linux-V0這個是我的source設定檔
- linux-2.6-bsp20.tgz這個為穩定版本的Andestech BSP若需要重新編譯Kernel請用此版本
- nds32le-linux-glibc-V0-Qt45.tgz這個為穩定版本的Andestech Toolchain
- xc5_image_with_unalign_access是有開啟unalign access的Kernel我有實際測試過
你下載後依照以下步驟
1.請修改為你環境變數的相關參數
1 |
source bashrc.nds32le-linux-V0 |
2.下載Qt Embedded並解壓縮
1 |
wget http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.3.tar.gz |
2 |
tar zxvf qt-everywhere-opensource-src-4.6.3.tar.gz |
3. 進入目錄
1 |
cd qt-everywhere-opensource-src-4.6.3 |
4.修改程式,使用"linux-generic-g++".
1 |
vim mkspecs/qws/linux-generic-g++/qmake.conf |
加入
01 |
include(../../common/g++.conf) |
02 |
include(../../common/linux.conf) |
03 |
include(../../common/qws.conf) |
05 |
# modifications to g++.conf |
06 |
QMAKE_CC = nds32le-linux-gcc -EL -G0 -Wa,-mno-small-data -lts |
07 |
QMAKE_CXX = nds32le-linux-g++ -EL -G0 -Wa,-mno-small-data -lts |
08 |
QMAKE_LINK = nds32le-linux-g++ -EL -G0 -Wa,-mno-small-data -lts |
09 |
QMAKE_LINK_SHLIB = nds32le-linux-g++ -EL -G0 -Wa,-mno-small-data -lts |
11 |
# modifications to linux.conf |
12 |
QMAKE_AR = nds32le-linux-ar cqs |
13 |
QMAKE_OBJCOPY = nds32le-linux-objcopy |
14 |
QMAKE_STRIP = nds32le-linux-strip |
5. 修改程式
1 |
vim /src/corelib/io/qfilesystemwatcher_inotify.cpp |
增加Andestech參數
1 |
//# error "This architecture is not supported. Please talk to qt-bugs@trolltech.com" |
2 |
# define __NR_inotify_init 316 |
3 |
# define __NR_inotify_add_watch 317 |
4 |
# define __NR_inotify_rm_watch 318 |
5 |
# define __NR_inotify_init1 360 |
6. 不需修改always_inline
src/3rdparty/webkit/JavaScriptCore/wtf/AlwaysInline.h
7.輸入(請注意最後面有增加 -D ALWAYS_INLINE=inline )
1 |
./configure -embedded generic -qt-zlib -qt-libpng -qt-gif -qt-libtiff -qt-libmng -qt-libjpeg -no-openssl -little-endian -webkit -svg -no-xmlpatterns -no-phonon -backend -no-accessibility -no-glib -no-freetype -no-dbus -no-pch -qt-mouse-tslib -I/home/liu/nds32/include -L/home/liu/nds32/lib -v -D ALWAYS_INLINE=inline |
8. 輸入
o
9. 輸入
yes
10. 輸入
make
11. 輸入
sudo make install
12.複製至SD卡或使用NFS
2 |
mount -t nfs 192.168.1.99:/home/liu/nds32/ /tmp/ -o proto=tcp -o nolock |
13. 設定變數
01 |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/tmp/lib |
02 |
export TSLIB_TSDEVICE=/dev/input/event0 |
03 |
export TSLIB_CALIBFILE=/tmp/etc/pointercal |
04 |
export TSLIB_CONFFILE=/tmp/etc/ts.conf |
05 |
export TSLIB_PLUGINDIR=/tmp/lib/ts |
06 |
export TSLIB_FBDEVICE=/dev/fb0 |
08 |
export QTDIR=/usr/local/Trolltech/QtEmbedded-4.6.3-generic/ |
09 |
export QWS_KEYBOARD=None |
10 |
export QWS_MOUSE_PROTO=tslib |
11 |
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH |
14. 增加目錄
1 |
mkdir -p /usr/local/Trolltech/ |
2 |
mount -t nfs 192.168.1.99:/usr/local/Trolltech/ /usr/local/Trolltech/ -o proto=tcp -o nolock |
3 |
ln -s /tmp/etc/pointercal /etc/pointercal |
5 |
printf "/033[9;0]" > /dev/tty0 |
15. 執行測試程式
1 |
cd /usr/local/Trolltech/QtEmbedded-4.6.3-generic/examples/layouts/borderlayout |
3 |
#如果沒有unaligned access 以下程式會Core dump |
4 |
cd /usr/local/Trolltech/QtEmbedded-4.6.3-generic/examples/widgets/sliders |
16.執行webkit測試程式
1 |
cd /usr/local/Trolltech/QtEmbedded-4.5.1-generic/examples/webkit/formextractor |
以下為我的測試成果
好熟悉的圖案
Webkit
Web Browser
請愛用穩定版的Toolchain並配合正確的BSP版本