这一篇记录 Qt 5.x cross-compiler with eglfs , 平台是 TI-AM3354, 上一篇SGX的移植就是为了这一次的交叉编译。
一、 下载QT的源码:
地址: http://download.qt.io/official_releases/qt/5.7/5.7.0/single/
// 定义一个配置脚本
// vim ti_qtcon.sh
#!/bin/sh
./configure -v -opensource -confirm-license -no-pch \
-prefix /home/sbc_7109_454_pdk3/qt_5.7/qtlib \
-release \
-opengl es2 -make libs -device linux-beagleboard-g++ \
-device-option CROSS_COMPILE=/home/sbc_7109_454_pdk3/ti_sdk/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf- \
-sysroot /home/sbc_7109_454_pdk3/ti_sdk/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi \
-linuxfb \
-eglfs \
-no-gcc-sysroot \
-make examples -make tools -nomake tests
// 再看一下
// vim qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf
1 #
2 # qmake configuration for the BeagleBoard and BeagleBoard xM boards
3 # http://beagleboard.org/
4
5 MAKEFILE_GENERATOR = UNIX
6 CONFIG += incremental
7 QMAKE_INCREMENTAL_STYLE = sublib
8
9 include(../../common/linux.conf)
10 include(../../common/gcc-base-unix.conf)
11 include(../../common/g++-unix.conf)
12
13 load(device_config)
14
15 QT_QPA_DEFAULT_PLATFORM = eglfs
16
17 # modifications to g++.conf
18 QMAKE_CC = $${CROSS_COMPILE}gcc
19 QMAKE_CXX = $${CROSS_COMPILE}g++
20 QMAKE_LINK = $${QMAKE_CXX}
21 QMAKE_LINK_SHLIB = $${QMAKE_CXX}
22
23 # modifications to linux.conf
24 QMAKE_AR = $${CROSS_COMPILE}ar cqs
25 QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
26 QMAKE_NM = $${CROSS_COMPILE}nm -P
27 QMAKE_STRIP = $${CROSS_COMPILE}strip
28
29 COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mthumb
30
31 #modifications to gcc-base.conf
32 QMAKE_CFLAGS += $${COMPILER_FLAGS}
33 QMAKE_CXXFLAGS += $${COMPILER_FLAGS}
34 QMAKE_CXXFLAGS_RELEASE += -O3
35
36 QMAKE_LIBS += -lrt -lpthread -ldl
37
38 # Extra stuff (OpenGL, DirectFB, ...)
39 QMAKE_INCDIR_EGL =
40 QMAKE_LIBDIR_EGL =
41 QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
42 QMAKE_LIBDIR_OPENGL_ES2 = $${QMAKE_LIBDIR_EGL}
43 QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL}
44 QMAKE_LIBDIR_OPENVG = $${QMAKE_LIBDIR_EGL}
45
46 QMAKE_LIBS_EGL = -lEGL -lIMGegl -lsrv_um
47 QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 $${QMAKE_LIBS_EGL}
48 QMAKE_LIBS_OPENVG = -lOpenVG $${QMAKE_LIBS_EGL}
49
50 DISTRO_OPTS += hard-float
51
52 # No need for any special EGL device integration.
53 # Prioritize the default, compiled-in integration over any plugins.
54 EGLFS_DEVICE_INTEGRATION = none
55
56 include(../common/linux_arm_device_post.conf)
57
58 load(qt_config)
make
make install
生成的文件会放在 sysroot 下面的 /home/sbc_7109_454_pdk3/qt_5.7/qtlib 里面