qt5.4.1的imx6编译
2、到https://download.qt.io/archive/qt/5.4/5.4.1/single/下载源码包qt-everywhere-opensource-src-5.4.1.tar.gz
3、解压:
$ tar xzf qt
-
everywhere
-
opensource
-
src
-5.4
.
1.
tar.gz
$ cd qt
-
everywhere
-
opensource
-
src
-5.4
.
1
/
4、指定所用平台的arm架构以及交叉编译器:
$ vi qtbase
/
mkspecs
/
linux
-
arm-freescale
-
gnueabi
-
g
+
+
/
qmake.conf
改成以下内容,实际应需要根据自己的开发环境作出相应改变:
# # qmake configuration for building with arm-linux-gnueabi-g++ # MAKEFILE_GENERATOR = UNIX CONFIG += incremental gdb_dwarf_index xlib QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CFLAGS_RELEASE += -O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon include(../common/linux.conf) include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf) # modifications to g++.conf QMAKE_CC = arm-fsl-linux-gnueabi-gcc QMAKE_CXX = arm-fsl-linux-gnueabi-g++ QMAKE_LINK = arm-fsl-linux-gnueabi-g++ QMAKE_LINK_SHLIB = arm-fsl-linux-gnueabi-g++ # modifications to linux.conf QMAKE_AR = arm-fsl-linux-gnueabi-ar cqs QMAKE_OBJCOPY = arm-fsl-linux-gnueabi-objcopy QMAKE_NM = arm-fsl-linux-gnueabi-nm -P QMAKE_STRIP = arm-fsl-linux-gnueabi-strip load(qt_config) QMAKE_INCDIR += /opt/EmbedSky/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/include QMAKE_INCDIR += /opt/EmbedSky/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/libX11/include QMAKE_LIBDIR += /opt/EmbedSky/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/lib QMAKE_LIBDIR += /opt/EmbedSky/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/qt-5.2.1-embedded-arm-MuliTCS/lib QMAKE_LIBDIR += /opt/EmbedSky/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/libX11/lib QMAKE_LIBS+=-lXau -lxcb -lX11 -lX11-xcb QMAKE_INCDIR_OPENGL_ES2=/opt/EmbedSky/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/include QMAKE_LIBDIR_OPENGL_ES2=/opt/EmbedSky/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/lib QMAKE_LIBS_OPENGL_ES2=-lglapi -lGLESv2 -lEGL
5、根据自己的实际需求配置Qt:
./configure -prefix /usr -xplatform linux-arm-freescale-gnueabi-g++ -confirm-license -opensource -release -make libs -optimized-qmake -pch -qt-sql-sqlit
e -qt-libjpeg -qt-libpng -qt-zlib -tslib -no-sse2 -no-openssl -no-nis -no-cups -no-glib -no-separate-debug-info -nomake examples -nomake tools -nomake
tests -no-iconv -skip webkit -opengl es2 -verbose -no-xcb-xlib -qt-xcb -qpa xcb