One: Get the Qt source code
Download link: http://download.qt.io/new_archive/qt/5.5/5.5.1/single/
Two: configure compilation options
1: Create the compiled output file "arm-qt" with any name, which is used to specify the address of the subsequent compilation output
2: Create a compilation script
#!/bin/sh
./configure \
-prefix /home/jun/work/tool/qt5.5.1/qt-everywhere-opensource-src-5.5.1/arm-qt \
-confirm-license \
-opensource \
-shared \
-release \
-make libs \
-xplatform linux-arm-gnueabi-g++ \
-optimized-qmake \
-pch \
-qt-sql-sqlite \
-qt-libjpeg \
-qt-libpng \
-qt-zlib \
-no-opengl \
-no-sse2 \
-no-openssl \
-no-cups \
-no-glib \
-no-dbus \
-no-xcb \
-no-xcursor -no-xfixes -no-xrandr -no-xrender \
-no-separate-debug-info \
-no-fontconfig \
-nomake examples -nomake tools -nomake tests -no-iconv \
-tslib \
-I/home/jun/work/tool/tslib/arm-tslib/include \
-L/home/jun/work/tool/tslib/arm-tslib/lib
exit
tslib installation document reference: https://blog.csdn.net/qq_34968572/article/details/90791464
3: Specify cross compilation tool and tslib
Modify the configuration file "qmake.conf" under the corresponding file according to the script content "-xplatform linux-arm-gnueabi-g++" created in the second section of this chapter
#
# qmake configuration for building with arm-linux-gnueabi-g++
#
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
QT_QPA_DEFAULT_PLATFORM = linuxfb
QMAKE_CFLAGS += -O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon -mfloat-abi=hard
QMAKE_CXXFLAGS += -O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon -mfloat-abi=hard
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
# modifications to g++.conf
QMAKE_CC = /home/jun/work/tool/arm-linux-gcc/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
QMAKE_CXX = /home/jun/work/tool/arm-linux-gcc/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
QMAKE_LINK = /home/jun/work/tool/arm-linux-gcc/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB = /home/jun/work/tool/arm-linux-gcc/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
# modifications to linux.conf
QMAKE_AR = /home/jun/work/tool/arm-linux-gcc/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY = /home/jun/work/tool/arm-linux-gcc/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-objcopy
QMAKE_NM = /home/jun/work/tool/arm-linux-gcc/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-nm -P
QMAKE_STRIP = /home/jun/work/tool/arm-linux-gcc/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip
QMAKE_INCDIR += /home/jun/work/tool/tslib/arm-tslib/include
QMAKE_LIBDIR += /home/jun/work/tool/tslib/arm-tslib/lib
load(qt_config)
Three: Compile
1: Grant qutoconfiguer.sh script executable permissions and execute
chmod u+x autoconfigure.sh
./autoconfigure.sh
When the prompt as shown in the figure appears, the configuration is successful and you can start to compile
2: Compile: make (a bit long time)
3: Execute make install to install to the specified folder
After the installation is complete, no error is reported. /qmake -v to query the version number