QT4.8.5 源码编译记录

时间:2023-03-09 03:20:13
QT4.8.5 源码编译记录
  • 今天想将以前的虚拟机的 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