Qt source code compilation
Download qt-everywhere-src-5.15.0.tar.xz from http://download.qt.io/archive/qt/5.15/5.15.0/single/ to Linux and unzip it;
Go to the unzip directory and create a new compiled script make.sh
# cd qt-everywhere-src-5.15.0 # touch make.sh # chmod 777 make.sh
- Modify the qmake. conf
# vi qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf
#
# qmake configuration for building with arm-linux-gnueabihf-g++
#
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:rotation=0
# modifications to g++.conf
QMAKE_CC = arm-linux-gnueabihf-gcc
QMAKE_CXX = arm-linux-gnueabihf-g++
QMAKE_LINK = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++
# modifications to linux.conf
QMAKE_AR = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
QMAKE_NM = arm-linux-gnueabihf-nm -P
QMAKE_STRIP = arm-linux-gnueabihf-strip
load(qt_config)
# vi make.sh
make.sh is as follows:
#!/bin/sh
PWD=`pwd`
mkdir install
./configure \
-prefix $PWD/install \
-static \
-release \
-opensource \
-xplatform linux-arm-gnueabi-g++ \
-optimized-qmake -pch \
-qt-libjpeg \
-qt-libpng \
-qt-zlib \
-no-opengl \
-skip qt3d \
-skip qtcanvas3d \
-skip qtpurchasing \
-skip qtlocation \
-skip qttools \
-no-sse2 \
-no-openssl \
-no-cups \
-no-glib \
-no-iconv \
-tslib \
-linuxfb \
-I /home/lck/ssd20x/qt/tslib-1.15/install/include \
-L /home/lck/ssd20x/qt/tslib-1.15/install/lib \
-recheck-all \
-make examples
make -j16
make install
Start cross-compiling:
# ./make.sh
After waiting for some time, the compilation is complete:
Set the qmake environment variable:
# vi ~/.bashrc
# export PATH=/home/ronnie/work/ssd201/qt/qt-everywhere-src-5.15.0/install/bin:$PATH
# source ~/.bashrc
# which qmake
文档更新时间: 2021-03-18 11:04 作者:Aeeditor