qt5.7和编译器不多说,这里只说重点
配置参数:
#!/bin/sh
./configure \
-v \
-prefix /usr/local/qt5.7.0-arm \
-release \
-opensource \
-make libs \
-xplatform linux-arm-gnueabi-g++ \
-optimized-qmake \
-pch \
-qt-sql-sqlite \
-qt-libjpeg \
-qt-zlib \
-no-opengl \
-skip qt3d \
-skip qtcanvas3d \
-skip qtpurchasing \
-no-sse2 \
-no-openssl \
-no-nis \
-no-cups \
-no-glib \
-no-iconv \
-nomake examples \
-nomake tools \
-skip qtvirtualkeyboard \
-I/opt/tslib/include \
-L/opt/tslib/lib
exit
qmake.conf修改:
#
# qmake configuration for building with arm-linux-gnueabi-g++
#
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
QT_QPA_DEFAULT_PLATFORM = linux
QMAKE_CFLAGS_RELEASE += -O2 -march=armv7-a
QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
QMAKE_INCDIR += /usr/local/tslib/include
QMAKE_LIBDIR += /usr/local/tslib/lib #cons
# modifications to g++.conf
QMAKE_CC = /opt/5.4.0/bin/arm-none-linux-gnueabi-gcc
QMAKE_CXX = /opt/5.4.0/bin/arm-none-linux-gnueabi-g++
QMAKE_LINK = /opt/5.4.0/bin/arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = /opt/5.4.0/bin/arm-none-linux-gnueabi-g++
# modifications to linux.conf
QMAKE_AR = /opt/5.4.0/bin/arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = /opt/5.4.0/bin/arm-none-linux-gnueabi-objcopy
QMAKE_NM = /opt/5.4.0/bin/arm-none-linux-gnueabi-nm -P
QMAKE_STRIP = /opt/5.4.0/bin/arm-none-linux-gnueabi-strip
load(qt_config)