-
今天想將以前的虛擬機的 QT4.8.5 集成到一個虛擬機里面,所以就重新編譯了一次 QT4.8.5的源碼
-
走了一點點小彎路,特此記錄。
-
一、交叉編譯器,不能直接從原來的虛擬機里面拷貝,必須使用官網的交叉編譯器
// 鏈接從下面的鏈接倆面找
http://www.deyisupport.com/question_answer/dsp_arm/sitara_arm/f/25/p/113233/308047.aspx#308047
-
二、 交叉編譯器的解壓和環境變量就不多描述了,基本上的都會。
-
三、 要把 tslib 編譯好也添加進去。
-
四、 將 qt4.8.5 的源碼解壓后
1. 復制一份 qt-everywhere-opensource-src-4.8.5/mkspecs/qws/linux-arm-gnueabi-g++
為 qt-everywhere-opensource-src-4.8.5/mkspecs/qws/linux-arm-gnueabihf-g++
2. 修改上述復制文件夾里面的 qmake.conf 為下面內容
#
# qmake configuration for building with arm-none-linux-gnueabi-g++
#
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)
# modifications to g++.conf
QMAKE_CC = arm-linux-gnueabihf-gcc -lts
QMAKE_CXX = arm-linux-gnueabihf-g++ -lts
QMAKE_LINK = arm-linux-gnueabihf-g++ -lts
# modifications to linux.conf
QMAKE_AR = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
QMAKE_STRIP = arm-linux-gnueabihf-strip
QMAKE_INCDIR = /home/SBC_7109_QT/aplex/tslib/include
QMAKE_LIBDIR = /home/SBC_7109_QT/aplex/tslib/lib
load(qt_config)
3. 修改 qt-everywhere-opensource-src-4.8.5/mkspecs/common/linux.conf
QMAKE_LIBS_THREAD = -lpthread -lts // 添加 -lts
4. 在 qt-everywhere-opensource-src-4.8.5 里面添加配置文件 my.sh
#!/bin/sh
./configure \
-opensource \
-prefix /home/SBC_7109_QT/aplex/qtlib_output \
-confirm-license \
-release \
-shared \
-embedded arm \
-force-pkg-config \
-xplatform qws/linux-arm-gnueabihf-g++ \
-depths 16,18,24,32 \
-fast \
-optimized-qmake \
-no-pch \
-qt-sql-sqlite \
-qt-libjpeg \
-qt-zlib \
-qt-libpng \
-qt-freetype \
-little-endian -host-little-endian \
-no-qt3support \
-qt-libtiff -qt-libmng \
-make translations \
-qt-gfx-linuxfb -qt-gfx-transformed -qt-gfx-multiscreen \
-no-gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput \
-no-kbd-qvfb -armfpa \
-no-mouse-qvfb \
-no-opengl \
-no-mmx -no-sse -no-sse2 \
-no-3dnow \
-no-openssl \
-webkit \
-no-qvfb \
-no-phonon \
-no-nis \
-no-opengl \
-no-cups \
-no-glib \
-no-xcursor -no-xfixes -no-xrandr -no-xrender \
-no-separate-debug-info \
-nomake examples -make tools -make docs \
-qt-mouse-tslib -DQT_QLOCALE_USES_FCVT \
-I/home/SBC_7109_QT/aplex/tslib/include \
-L/home/SBC_7109_QT/aplex/tslib/lib
-
五、 給 my.sh 添加執行權限 ./my.sh
make -j4
make install