【瑞芯微】【rk3128】【移植 qt 5.12.9】
一、移植 QT 5.12.9
1. 源码下载
qt5.12.9源码下载
2. 配置 QT
进入 rk3128 docker 环境
./rk3128_docker_env/init.sh
进入已存在的开发环境...
my_rk3128_dev
developer@c8aa26115a95:/workspace$ vim /home/developer/.bashrc
ARM_BIN_PATH=/workspace/RK3128/buildroot/output/rockchip_rk312x/host/bin
export PATH=$ARM_BIN_PATH:$PATH
developer@c8aa26115a95:/workspace/qt-everywhere-src-5.12.9$ vim qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.confMAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublibinclude(../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文件夹下 配置一个编辑文件 名字可以自己命名
cd qt-everywhere-src-5.12.9
gedit autoconfigure.sh
./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
developer@c8aa26115a95:/workspace/qt-everywhere-src-5.12.9$ ./autoconfigure.shNote: Also available for Linux: linux-clang linux-iccNote: -optimized-tools is not useful in -release mode.WARNING: Cross compiling without sysroot. Disabling pkg-configQt 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. 编译安装
# 直接在 当前目录执行makemake install # 最终将 编译后的 QT 生成到 /workspace/qt-everywhere-src-5.12.9/arm-qt 目录下
4. 放到板子里
将上面编译出来的 arm-qt 放到我们的板子里面就可以了
cp -r arm-qt/ /usr/lib/
在板子里面更新环境变量
vi /etc/profileexport 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
