$ cd qt-everywhere-opensource-src-5.9.4
$ cd qtbase/mkspecs
$ cp linux-arm-gnueabi-g++/ linux-arm-poky-gnueabi-g++/ -r
$ cd linux-arm-poky-gnueabi-g++
$ vi qmake.conf
修改交叉工具链路径,且在QMAKE_CC、QMAKE_CXX、QMAKE_LINK、QMAKE_LINK_SHLIB后加上-lts:
# modifications to g++.conf
QMAKE_CC = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -lts
QMAKE_CXX = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -lts
QMAKE_LINK = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -lts
QMAKE_LINK_SHLIB = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -lts
# modifications to linux.conf
QMAKE_AR = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-objcopy
QMAKE_NM = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-nm -P
QMAKE_STRIP = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip
$ cd ~/Qt/qt-everywhere-opensource-src-5.9.4/
$ vi qtbase/mkspecs/common/linux.conf
QMAKE_LIBS_THREAD = -lpthread 后加上-lts
即: QMAKE_LIBS_THREAD = -lpthread -lts
$ sudo ./configure -prefix /usr/local/qte5.9.4 -confirm-license -opensource -shared -release -make libs -xplatform linux-arm-poky-gnueabi-g++ -optimized-qmake -pch -qt-libjpeg -qt-libpng -qt-zlib -no-opengl -no-sse2 -no-openssl -no-cups -no-glib -no-dbus -no-xcb -no-separate-debug-info -no-fontconfig -nomake examples -nomake tools -nomake tests -no-iconv -skip qtdeclarative -tslib -I/home/myzr/Qt/tslib-install/include -L/home/myzr/Qt/tslib-install/lib
$ make
出现错误:
make: *** 没有规则可以创建“assistant_ar.qm”需要的目标“/usr/local/qte5.9.4/bin/lrelease”。 停止。
$ sudo mkdir /usr/local/qte5.9.4/bin
$ sudo cp qttools/bin/lrelease /usr/local/qte5.9.4/bin
$ sudo chmod 777 /usr/local/qte5.9.4/bin/lrelease
继续编译:
$ make
$ sudo make install
安装目录为/usr/local/qte5.9.4 可将这个文件移植到开发板相同的目录