【瑞芯微】【rk3128】【移植 qt 5.12.9】

一、移植 QT 5.12.9

1. 源码下载

qt5.12.9源码下载

2. 配置 QT

进入 rk3128 docker 环境

复制代码
./rk3128_docker_env/init.sh
c 复制代码
进入已存在的开发环境...
my_rk3128_dev
developer@c8aa26115a95:/workspace$ vim /home/developer/.bashrc 
c 复制代码
ARM_BIN_PATH=/workspace/RK3128/buildroot/output/rockchip_rk312x/host/bin
export PATH=$ARM_BIN_PATH:$PATH
c 复制代码
developer@c8aa26115a95:/workspace/qt-everywhere-src-5.12.9$ vim qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf


MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf  修改为 buildroot 里面的 交叉工具链
QMAKE_CC                = arm-buildroot-linux-gnueabihf-gcc
QMAKE_CXX               = arm-buildroot-linux-gnueabihf-g++
QMAKE_LINK              = arm-buildroot-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-buildroot-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = arm-buildroot-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = arm-buildroot-linux-gnueabihf-objcopy
QMAKE_NM                = arm-buildroot-linux-gnueabihf-nm -P
QMAKE_STRIP             = arm-buildroot-linux-gnueabihf-strip
load(qt_config)

进入qt-everywhere-src-5.12.9文件夹下 配置一个编辑文件 名字可以自己命名

shell 复制代码
cd qt-everywhere-src-5.12.9
gedit autoconfigure.sh
c 复制代码
./configure -prefix /workspace/qt-everywhere-src-5.12.9/arm-qt \
-opensource \
-confirm-license \
-release \
-strip \
-shared \
-xplatform linux-arm-gnueabi-g++ \
-optimized-qmake \
-c++std c++11 \
--rpath=no \
-pch \
-skip qt3d \
-skip qtactiveqt \
-skip qtandroidextras \
-skip qtcanvas3d \
-skip qtconnectivity \
-skip qtdatavis3d \
-skip qtdoc \
-skip qtgamepad \
-skip qtlocation \
-skip qtmacextras \
-skip qtnetworkauth \
-skip qtpurchasing \
-skip qtremoteobjects \
-skip qtscript \
-skip qtscxml \
-skip qtsensors \
-skip qtspeech \
-skip qtsvg \
-skip qttools \
-skip qttranslations \
-skip qtwayland \
-skip qtwebengine \
-skip qtwebview \
-skip qtwinextras \
-skip qtx11extras \
-skip qtxmlpatterns \
-make libs \
-make examples \
-nomake tools -nomake tests \
-gui \
-widgets \
-dbus-runtime \
--glib=no \
--iconv=no \
--pcre=qt \
--zlib=qt \
-no-openssl \
--freetype=qt \
--harfbuzz=qt \
-no-opengl \
-linuxfb \
--xcb=no \
--libpng=qt \
--libjpeg=qt \
--sqlite=qt \
-plugin-sql-sqlite \
-recheck-all
c 复制代码
developer@c8aa26115a95:/workspace/qt-everywhere-src-5.12.9$ ./autoconfigure.sh



Note: Also available for Linux: linux-clang linux-icc

Note: -optimized-tools is not useful in -release mode.

WARNING: Cross compiling without sysroot. Disabling pkg-config

Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/workspace/qt-everywhere-src-5.12.9/arm-qt'.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.

3. 编译安装

c 复制代码
# 直接在 当前目录执行

make

make install  # 最终将 编译后的 QT 生成到 /workspace/qt-everywhere-src-5.12.9/arm-qt 目录下

4. 放到板子里

将上面编译出来的 arm-qt 放到我们的板子里面就可以了

c 复制代码
cp -r arm-qt/ /usr/lib/

在板子里面更新环境变量

c 复制代码
vi /etc/profile

export QT_ROOT=/usr/lib/arm-qt
export QT_QPA_FONTDIR=/usr/share/fonts
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
export QT_PLUGIN_PATH=$QT_ROOT/plugins
export LD_LIBRARY_PATH=$QT_ROOT/lib:$QT_ROOT/plugins/platforms
export QML2_IMPORT_PATH=$QT_ROOT/qml
export QT_QPA_FB_TSLIB=1
相关推荐
Quincy_Freak21 小时前
信创内网数据规范实践:银河麒麟下SQLite本地数据安全管理方案
数据库·sqlite·arm·数据库管理·大数据分析·银河麒麟·aarch64
小短腿的代码世界1 天前
Qt Bluetooth源码深度解析:从HCI协议到跨平台API的完整架构
开发语言·qt·架构
小短腿的代码世界1 天前
Qt WebEngine多进程架构与IPC通信:从Chromium多进程到Qt信号槽融合
qt·架构·系统架构
尘中远1 天前
【Qwt 7.0 系列】快速入门与核心新特性概览 —— 更现代的 Qt 数据可视化库
qt·数据可视化·绘图·qwt·科学绘图
初阳7851 天前
【Qt】系统相关(3)——多线程
qt
凉、介1 天前
ARMv8 架构下的刷 Cache 操作
c语言·笔记·学习·架构·嵌入式·arm
初阳7851 天前
【Qt】系统相关(2)——文件
开发语言·qt
尘中远2 天前
【Qwt 7.0 系列】坐标轴与刻度系统 —— 刻度引擎、网格、图例与刻度朝内
qt·数据可视化·qcustomplot·qwt·工业软件·科学绘图
sycmancia2 天前
Qt——多线程间的互斥
开发语言·qt
尘中远2 天前
【Qwt 7.0 系列】常用图表类型实战 —— 柱状图、散点图、箱线图与直方图
qt·qwt·工业软件·科学绘图