|
系统是完全安装RedHat9.0(里面带QT3.1),板子是X-Hyper250B的,Toolchain用的是开发板带的hybus-arm-linux-R1.1
交叉编译所用到的文件:
qt-embedded-2.3.10-free.tar.gz
qt-x11-2.3.2.tar.gz
qtopia-free-source-2.1.1.tar.gz
tmake-1.13.tar.gz
e2fsprogs-1.35.tar.gz
主机x86的编译步骤:
tar xfz qt-embedded-2.3.10-free.tar.gz(解压后qt-2.3.10改名为qt-2.3.10-host)
export QTEDIR=$PWD/qt-2.3.10-host
tar xfz qt-x11-2.3.2.tar.gz(解压后qt-2.3.2)
export QT2DIR=$PWD/qt-2.3.2
tar xfz qtopia-free-source-2.1.1.tar.gz(解压后qtopia-free-2.1.1改名为qtopia-2.1.1-host)
export QPEDIR=$PWD/qtopia-2.1.1-host
tar xfz tmake-1.13.tar.gz(解压后tmake-1.13)
export TMAKEDIR=$PWD/tmake-1.13
export TMAKEPATH=$PWD/tmake-1.13/lib/qws/linux-x86-g++
export PATH=$TMAKEDIR/bin:$PATH
cd qt-2.3.2
export QTDIR=$QT2DIR
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
./configure -no-xft
make
make -C tools/qvfb
cd ..
cd qt-2.3.10-host
export QTDIR=$PWD
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
mkdir bin (因为解压后的qt-2.3.10没有bin文件夹)
cp $QT2DIR/bin/uic bin
cp $QT2DIR/tools/qvfb/qvfb bin
cp $QPEDIR/src/qt/qconfig-qpe.h src/tools/
./configure -qconfig qpe -qvfb -thread -system-jpeg -gif -depths 4,8,16,32
make
cd ..
tar xzf e2fsprogs-1.35.tar.gz
cd e2fsprogs-1.35
./configure -enable-elf-shlibs
make install lib/uuid/
注:这是编译libuuid库
cd ..
cd qtopia-2.1.1-host
export PATH=$QPEDIR/bin:$PATH
export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH
./configure
make
编译例子:
$qmake -project ==>>我都是这样创建.pro文件的
$tmake -o Makefile hello.pro
$qvfb &
$./hello -qws 或者$qpe
还没怎么仔细研究过。
目标机arm-linux的编译步骤:
tar xfz qt-embedded-2.3.10-free.tar.gz(解压后qt-2.3.10改名为qt-2.3.10-target)
export QTEDIR=$PWD/qt-2.3.10-target
tar xfz qt-x11-2.3.2.tar.gz
export QT2DIR=$PWD/qt-2.3.2
tar xfz qtopia-free-source-2.1.1.tar.gz(解压后qtopia-free-2.1.1改名为qtopia-2.1.1-target)
export QPEDIR=$PWD/qtopia-2.1.1-target
tar xfz tmake-1.13.tar.gz
export TMAKEDIR=$PWD/tmake-1.13
export TMAKEPATH=$PWD/tmake-1.13/lib/qws/linux-arm-g++
export PATH=$TMAKEDIR/bin:$PATH
cd qt-2.3.2
export QTDIR=$QT2DIR
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
./configure -no-xft
make
make -C tools/qvfb
cd ..
cd qt-2.3.10-target
export QTDIR=$PWD
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
mkdir bin
cp $QT2DIR/bin/uic bin
cp $QT2DIR/tools/qvfb/qvfb bin
cp $QPEDIR/src/qt/qconfig-qpe.h src/tools/
./configure -xplatform linux-arm-g++ -qconfig qpe -qvfb -thread -system-jpeg -gif -depths 4,8,16,32
make
cd ..
注:这里需要arm版本的libjpeg.so.62,hybus-arm-linux-R1.1里面包含这个库;如没有可以上网下载。
tar xzf e2fsprogs-1.35.tar.gz
cd e2fsprogs-1.35
./configure -host=arm-linux -with-cc=arm-linux-gcc -with-linker=arm-linux-ld -enable-elf-shlibs -prefix=/usr/local/hybus-arm-linux-R1.1/arm-linux
make install lib/uuid/ ===>>>这步安装到hybus-arm-linux-R1.1/lib上的libuuid.so.1.2版本不对,
要cp lib/libuuid.so.1.2 ../hybus-arm-linux-R1.1/lib
注:这步是交叉编译libuuid库,配置详情见./configure --help
(还要多谢 http://panjet.wleda.com/?p=20 这里面的大哥呀,好不容易才在网上找到的)
cd ..
cd qtopia-2.1.1-host
export PATH=$QPEDIR/bin:$PATH
export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH
cp src/libraries/qtopia/custom-linux-ipaq-g++.cpp src/libraries/qtopia/custom-linux-arm-g++.cpp
cp src/libraries/qtopia/custom-linux-ipaq-g++.h src/libraries/qtopia/custom-linux-arm-g++.h
./configure -xplatform linux-arm-g++
make
注:这里需要libstdc++库(啊~我没有啊,在网上找了一个,但是好像不配,老出现没有定义××的问题呀,谁有就帮帮忙发个给我吧,邮箱:[email protected],非常感谢啊,就差这一步了) |
|