qt的移植

1、下载qt-everywhere-opensource-src-4.8.1.tar.gz, 下载连接地址如下://download.qt.io/archive/qt/4.8/4.8.1/

2. 解压qt压缩文件tar xvf qt-everywhere-opensource-src-4.8.1.tar.gz

3. 为了编译的方便编译 ,写了一个配置文件bulid.sh

内容如下:

#!/bin/sh

./configure -prefix ../qt-4.8.1-powerpc \

-release \

-opensource \

-embedded powerpc \

-no-webkit \

-no-qt3support \

-xplatform qws/linux-powerpc-g++ \

-qt-gfx-linuxfb \

-big-endian \

-no-openssl

并且修改bulid.sh的属性,chmod a+x bulid.sh

4. 添加qws的编译器

修改 vi mkspecs/qws/linux-powerpc-g++/qmake.conf

把配置文件内的工具连换成自己系统的工具连

# modifications to g++.conf

QMAKE_CC = powerpc-none-linux-gnuspe-gcc

QMAKE_CXX = powerpc-none-linux-gnuspe-g++

QMAKE_LINK = powerpc-none-linux-gnuspe-g++

QMAKE_LINK_SHLIB = powerpc-none-linux-gnuspe-g++

# modifications to linux.conf

QMAKE_AR = powerpc-none-linux-gnuspe-ar cqs

QMAKE_OBJCOPY = powerpc-none-linux-gnuspe-objcopy

QMAKE_STRIP = powerpc-none-linux-gnuspe-strip

需要修改的位置如上。

5. 配置qt

运行bulid.sh 这个脚本  ./bulid.sh

6. 编译基于powerpc的qt库文件

make -j4 && make install

编译时间大概1小时左右, 编译完成后在上一级的目录会有一个qt-4.8.1-powerpc 文件夹, 这个文件夹内的内容就是基于powerpc的qt库。

7. 再编译一个本地的QT库 , 以便于本地调试应用程序,运行命令进行配置

./configure -prefix ../qt-4.8.1-desktop

8. 编译本地的QT工程

make -j4 && make install

编译完成后在上一级的目录会有一个qt-4.8.1-desktop 文件夹, 这个文件夹内的内容就是基x86 的qt库。