Qt5.12.8的QtWebEngine库编译随笔(rk3588板卡)

守听  金牌会员 | 2025-1-10 18:16:01 | 显示全部楼层 | 阅读模式
打印 上一主题 下一主题

主题 873|帖子 873|积分 2619

起因

项目从rk3399板卡改为rk3588后原先的qtwebengine库直接无法使用了,故实验在新的板卡下举行编译。
编译环境

板卡: rk3588
体系: unbuntu 20.04 LTS
gcc version: aarch64-linux-gnu 9.4.0
源码

下载地址:https://download.qt.io/new_archive/qt/5.12/5.12.8/single/

下载到板块后解压
  1. sudo tar -xf qt-everywhere-src-5.12.8.tar.xz
  2. cd qt-everywhere-src-5.12.8
复制代码
配置

由于配置的信息相当多,发起创建一个主动配置脚本,比如auto.sh,方便根据自己的体系举行参数调解。
  1. sudo touch auto.sh
  2. sudo chmod 755 auto.sh
  3. sudo vim auto.sh
复制代码
  1. #auto.sh
  2. ./configure -prefix /root/honglingfeng/arm-qt-5.12.8 \
  3. -opensource \
  4. -confirm-license \
  5. -release \
  6. -strip \
  7. -shared \
  8. -optimized-qmake \
  9. -c++std c++11 \
  10. --rpath=no \
  11. -pch \
  12. -webengine-proprietary-codecs \
  13. -skip qt3d \
  14. -skip qtactiveqt \
  15. -skip qtandroidextras \
  16. -skip qtcanvas3d \
  17. -skip qtconnectivity \
  18. -skip qtdatavis3d \
  19. -skip qtdoc \
  20. -skip qtgamepad \
  21. -skip qtlocation \
  22. -skip qtmacextras \
  23. -skip qtnetworkauth \
  24. -skip qtpurchasing \
  25. -skip qtremoteobjects \
  26. -skip qtscript \
  27. -skip qtscxml \
  28. -skip qtsensors \
  29. -skip qtspeech \
  30. -skip qtsvg \
  31. -skip qttools \
  32. -skip qttranslations \
  33. -skip qtwayland \
  34. -skip qtwinextras \
  35. -skip qtx11extras \
  36. -skip qtxmlpatterns \
  37. -skip qtgraphicaleffects \
  38. -make libs \
  39. -nomake tools \
  40. -nomake tests \
  41. -gui \
  42. -widgets \
  43. -dbus-runtime \
  44. --glib=no \
  45. --iconv=no \
  46. --pcre=qt \
  47. -qt-zlib \
  48. -no-vulkan \
  49. -no-openssl \
  50. --freetype=qt \
  51. --harfbuzz=qt \
  52. -opengl es2 \
  53. -xcb \
  54. -xcb-xlib \
  55. -egl \
  56. -eglfs \
  57. --pcre=qt \
  58. -linuxfb \
  59. -no-tslib \
  60. -qt-libpng \
  61. -qt-libjpeg \
  62. --sqlite=qt \
复制代码
详细configure参数剖析可以参考以下文章:https://blog.csdn.net/qing666888/article/details/79597473
官方英文帮助文档: ./configure --help
注意:每次改变auto.sh内里的参数,记得将config.cache删除后在运行脚本
运行auto.sh脚本举行配置
因为缺少依靠文件,绝大部分情况下configure都无法通过的,即报WARNING: QtXXX will not be built.。所以必须要安装依靠文件,直到不报错为止。
  1. root@ok3588:~/qtSource/qt-everywhere-src-5.12.8# sh auto.sh
  2. + cd qtbase
  3. + /root/qtSource/qt-everywhere-src-5.12.8/qtbase/configure -top-level -prefix /root/honglingfeng/arm-qt-5.12.8 -opensource -confirm-license -release -strip -shared -optimized-qmake -c++std c++11 --rpath=no -pch -webengine-proprietary-codecs -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 qtwinextras -skip qtx11extras -skip qtxmlpatterns -skip qtgraphicaleffects -make libs -nomake tools -nomake tests -gui -widgets -dbus-runtime --glib=no --iconv=no --pcre=qt -qt-zlib -no-vulkan -no-openssl --freetype=qt --harfbuzz=qt -opengl es2 -xcb -xcb-xlib -egl -eglfs --pcre=qt -linuxfb -no-tslib -qt-libpng -qt-libjpeg --sqlite=qt
  4. Creating qmake...
  5. .Done.
  6. This is the Qt Open Source Edition.
  7. You have already accepted the terms of the Open Source license.
  8. Running configuration tests...
  9. Checking for gold linker... yes
  10. Checking for machine tuple... yes
  11. Checking for valid makespec... yes
  12. Checking for target architecture... arm64
  13. Checking for alloca() in alloca.h... yes
  14. Checking for C99 support... yes
  15. Checking for C11 support... yes
  16. Checking for new dtags support... yes
  17. Checking for pkg-config... yes
  18. Checking for D-Bus >= 1.2 (host)... yes
  19. Checking for udev... yes
  20. Checking for POSIX fallocate()... yes
  21. Checking for precompiled header support... yes
  22. Checking for RDRAND instruction... no
  23. Checking for symbol visibility support... yes
  24. Checking for -Bsymbolic-functions support... no
  25. Checking for STL compatibility... yes
  26. Checking for clock_gettime()... yes
  27. Checking for POSIX monotonic clock... yes
  28. Checking for C++11 <future>... yes
  29. Checking for dlopen()... yes
  30. Checking for eventfd... yes
  31. Checking for futimens()... yes
  32. Checking for getauxval()... yes
  33. Checking for getentropy()... yes
  34. Checking for GNU libc... yes
  35. Checking for ICU... yes
  36. Checking for inotify... yes
  37. Checking for SysV IPC... yes
  38. Checking for linkat()... yes
  39. Checking for ppoll()... yes
  40. Checking for renameat2()... yes
  41. Checking for slog2... no
  42. Checking for statx() in libc... yes
  43. Checking for 64 bit atomics... yes
  44. Checking for DoubleConversion... no
  45. Checking for O_CLOEXEC... yes
  46. Checking for C++11 <random>... yes
  47. Checking for working std::atomic for function pointers... yes
  48. Checking for getifaddrs()... yes
  49. Checking for IPv6 ifname... yes
  50. Checking for Linux AF_NETLINK sockets... yes
  51. Checking for xkbcommon >= 0.5.0... yes
  52. Checking for XCB >= 1.9... yes
  53. Checking for atspi... yes
  54. Checking for OpenGL ES 2.0... yes
  55. Checking for KMS... yes
  56. Checking for DRM Atomic API... yes
  57. Checking for EGL... yes
  58. Checking for XLib... yes
  59. Checking for EGL on X11... yes
  60. Checking for EGLDevice... yes
  61. Checking for GBM... no
  62. Checking for Mali EGL... no
  63. Checking for Mali 2 EGL... no
  64. Checking for i.Mx6 EGL... no
  65. Checking for XCB Xlib... yes
  66. Checking for evdev... yes
  67. Checking for libinput... no
  68. Checking for LinuxFB... yes
  69. Checking for mtdev... no
  70. Checking for OpenGL ES 3.0... yes
  71. Checking for OpenGL ES 3.1... yes
  72. Checking for OpenGL ES 3.2... yes
  73. Checking for OpenVG... no
  74. Checking for default QPA platform... xcb
  75. Checking for XCB ICCCM >= 0.3.9... yes
  76. Checking for XCB SHM... yes
  77. Checking for XCB Image >= 0.3.9... yes
  78. Checking for XCB Keysyms >= 0.3.9... yes
  79. Checking for XCB RandR... yes
  80. Checking for XCB XRender... yes
  81. Checking for XCB Renderutil >= 0.3.9... yes
  82. Checking for XCB Shape... yes
  83. Checking for XCB Sync... yes
  84. Checking for XCB Xfixes... yes
  85. Checking for XCB Xinerama... yes
  86. Checking for XCB (extensions)... yes
  87. Checking for X11 prefix... /usr
  88. Checking for X11 session management... yes
  89. Checking for XCB XInput... yes
  90. Checking for XCB XKB >= 1.10... yes
  91. Checking for xkbcommon-x11... yes
  92. Checking for CUPS... yes
  93. Checking for DB2 (IBM)... no
  94. Checking for InterBase... no
  95. Checking for MySQL... no
  96. Checking for OCI (Oracle)... no
  97. Checking for ODBC... no
  98. Checking for PostgreSQL... no
  99. Checking for SQLite (version 2)... no
  100. Checking for TDS (Sybase)... no
  101. Checking for Socket CAN... yes
  102. Checking for Socket CAN FD... yes
  103. Checking for jasper... no
  104. Checking for mng... no
  105. Checking for tiff... yes
  106. Checking for webp... no
  107. Checking for C++14 make_unique()... no
  108. Checking for Direct3D 12... no
  109. Checking for ALSA... yes
  110. Checking for Vivante GPU... no
  111. Checking for GStreamer 1.0... no
  112. Checking for GStreamer 0.10... no
  113. Checking for Video for Linux... yes
  114. Checking for OpenAL... no
  115. Checking for PulseAudio >= 0.9.10... yes
  116. Checking for libresourceqt5... no
  117. Checking for alsa... yes
  118. Checking for embedded... no
  119. Checking for bison... yes
  120. Checking for flex... yes
  121. Checking for gperf... yes
  122. Checking for host pkg-config... /usr/bin/pkg-config
  123. Checking for linker supports -z noexecstack... yes
  124. Checking for x11... yes
  125. Checking for libdrm... yes
  126. Checking for xcomposite... yes
  127. Checking for xcursor... yes
  128. Checking for xi... yes
  129. Checking for xtst... yes
  130. Checking for poppler-cpp... no
  131. Checking for pulseaudio >= 0.9.10... yes
  132. Checking for python2... /usr/bin/python2
  133. Checking for d-bus... yes
  134. Checking for fontconfig... yes
  135. Checking for glib-2.0 >= 2.32.0... yes
  136. Checking for glibc > 2.16... yes
  137. Checking for jsoncpp... no
  138. Checking for khr... yes
  139. Checking for lcms2... no
  140. Checking for libevent... no
  141. Checking for libvpx... no
  142. Checking for libwebp, libwebpmux and libwebpdemux... no
  143. Checking for libxml2 and libxslt... no
  144. Checking for minizip... no
  145. Checking for system ninja... no
  146. Checking for nss >= 3.26... yes
  147. Checking for opus... no
  148. Checking for protobuf... no
  149. Checking for re2... no
  150. Checking for snappy... no
  151. Done running configuration tests.
  152. Configure summary:
  153. Build type: linux-g++ (arm64, CPU features: cx16 neon)
  154. Compiler: gcc 9.4.0
  155. Configuration: use_gold_linker compile_examples enable_new_dtags largefile neon precompile_header shared release c++11 concurrent dbus reduce_exports release_tools stl
  156. Build options:
  157.   Mode ................................... release; optimized tools
  158.   Optimize release build for size ........ no
  159.   Building shared libraries .............. yes
  160.   Using C standard ....................... C11
  161.   Using C++ standard ..................... C++11
  162.   Using ccache ........................... no
  163.   Using gold linker ...................... yes
  164.   Using new DTAGS ........................ yes
  165.   Using precompiled headers .............. yes
  166.   Using LTCG ............................. no
  167.   Target compiler supports:
  168.     NEON ................................. yes
  169.   Build parts ............................ libs
  170. Qt modules and options:
  171.   Qt Concurrent .......................... yes
  172.   Qt D-Bus ............................... yes
  173.   Qt D-Bus directly linked to libdbus .... no
  174.   Qt Gui ................................. yes
  175.   Qt Network ............................. yes
  176.   Qt Sql ................................. yes
  177.   Qt Testlib ............................. yes
  178.   Qt Widgets ............................. yes
  179.   Qt Xml ................................. yes
  180. Support enabled for:
  181.   Using pkg-config ....................... yes
  182.   udev ................................... yes
  183.   Using system zlib ...................... no
  184. Qt Core:
  185.   DoubleConversion ....................... yes
  186.     Using system DoubleConversion ........ no
  187.   GLib ................................... no
  188.   iconv .................................. no
  189.   ICU .................................... yes
  190.   Tracing backend ........................ <none>
  191.   Logging backends:
  192.     journald ............................. no
  193.     syslog ............................... no
  194.     slog2 ................................ no
  195.   Using system PCRE2 ..................... no
  196. Qt Network:
  197.   getifaddrs() ........................... yes
  198.   IPv6 ifname ............................ yes
  199.   libproxy ............................... no
  200.   Linux AF_NETLINK ....................... yes
  201.   OpenSSL ................................ no
  202.     Qt directly linked to OpenSSL ........ no
  203.   OpenSSL 1.1 ............................ no
  204.   DTLS ................................... no
  205.   SCTP ................................... no
  206.   Use system proxies ..................... yes
  207. Qt Gui:
  208.   Accessibility .......................... yes
  209.   FreeType ............................... yes
  210.     Using system FreeType ................ no
  211.   HarfBuzz ............................... yes
  212.     Using system HarfBuzz ................ no
  213.   Fontconfig ............................. no
  214.   Image formats:
  215.     GIF .................................. yes
  216.     ICO .................................. yes
  217.     JPEG ................................. yes
  218.       Using system libjpeg ............... no
  219.     PNG .................................. yes
  220.       Using system libpng ................ no
  221.   EGL .................................... yes
  222.   OpenVG ................................. no
  223.   OpenGL:
  224.     Desktop OpenGL ....................... no
  225.     OpenGL ES 2.0 ........................ yes
  226.     OpenGL ES 3.0 ........................ yes
  227.     OpenGL ES 3.1 ........................ yes
  228.     OpenGL ES 3.2 ........................ yes
  229.   Vulkan ................................. no
  230.   Session Management ..................... yes
  231. Features used by QPA backends:
  232.   evdev .................................. yes
  233.   libinput ............................... no
  234.   INTEGRITY HID .......................... no
  235.   mtdev .................................. no
  236.   tslib .................................. no
  237.   xkbcommon .............................. yes
  238.   X11 specific:
  239.     XLib ................................. yes
  240.     XCB Xlib ............................. yes
  241.     EGL on X11 ........................... yes
  242. QPA backends:
  243.   DirectFB ............................... no
  244.   EGLFS .................................. yes
  245.   EGLFS details:
  246.     EGLFS OpenWFD ........................ no
  247.     EGLFS i.Mx6 .......................... no
  248.     EGLFS i.Mx6 Wayland .................. no
  249.     EGLFS RCAR ........................... no
  250.     EGLFS EGLDevice ...................... yes
  251.     EGLFS GBM ............................ no
  252.     EGLFS VSP2 ........................... no
  253.     EGLFS Mali ........................... no
  254.     EGLFS Raspberry Pi ................... no
  255.     EGLFS X11 ............................ yes
  256.   LinuxFB ................................ yes
  257.   VNC .................................... yes
  258.   Mir client ............................. no
  259.   XCB:
  260.     Using system-provided XCB libraries .. yes
  261.     XCB XKB .............................. yes
  262.     XCB XInput ........................... yes
  263.     Native painting (experimental) ....... no
  264.     GL integrations:
  265.       GLX Plugin ......................... no
  266.       EGL-X11 Plugin ..................... yes
  267. Qt Sql:
  268.   SQL item models ........................ yes
  269. Qt Widgets:
  270.   GTK+ ................................... no
  271.   Styles ................................. Fusion Windows
  272. Qt PrintSupport:
  273.   CUPS ................................... yes
  274. Qt Sql Drivers:
  275.   DB2 (IBM) .............................. no
  276.   InterBase .............................. no
  277.   MySql .................................. no
  278.   OCI (Oracle) ........................... no
  279.   ODBC ................................... no
  280.   PostgreSQL ............................. no
  281.   SQLite2 ................................ no
  282.   SQLite ................................. yes
  283.     Using system provided SQLite ......... no
  284.   TDS (Sybase) ........................... no
  285. Qt Testlib:
  286.   Tester for item models ................. yes
  287. Qt SerialBus:
  288.   Socket CAN ............................. yes
  289.   Socket CAN FD .......................... yes
  290. Further Image Formats:
  291.   JasPer ................................. no
  292.   MNG .................................... no
  293.   TIFF ................................... yes
  294.     Using system libtiff ................. yes
  295.   WEBP ................................... yes
  296.     Using system libwebp ................. no
  297. Qt QML:
  298.   QML network support .................... yes
  299.   QML debugging and profiling support .... yes
  300.   QML sequence object .................... yes
  301.   QML list model ......................... yes
  302.   QML XML http request ................... yes
  303.   QML Locale ............................. yes
  304.   QML delegate model ..................... yes
  305. Qt Quick:
  306.   Direct3D 12 ............................ no
  307.   AnimatedImage item ..................... yes
  308.   Canvas item ............................ yes
  309.   Support for Qt Quick Designer .......... yes
  310.   Flipable item .......................... yes
  311.   GridView item .......................... yes
  312.   ListView item .......................... yes
  313.   TableView item ......................... yes
  314.   Path support ........................... yes
  315.   PathView item .......................... yes
  316.   Positioner items ....................... yes
  317.   Repeater item .......................... yes
  318.   ShaderEffect item ...................... yes
  319.   Sprite item ............................ yes
  320. Qt Multimedia:
  321.   ALSA ................................... yes
  322.   GStreamer 1.0 .......................... no
  323.   GStreamer 0.10 ......................... no
  324.   Video for Linux ........................ yes
  325.   OpenAL ................................. no
  326.   PulseAudio ............................. yes
  327.   Resource Policy (libresourceqt5) ....... no
  328.   Windows Audio Services ................. no
  329.   DirectShow ............................. no
  330.   Windows Media Foundation ............... no
  331. Qt WebEngine:
  332.   Embedded build ......................... no
  333.   Full debug information ................. no
  334.   Pepper Plugins ......................... yes
  335.   Printing and PDF ....................... yes
  336.   Proprietary Codecs ..................... yes
  337.   Spellchecker ........................... yes
  338.   Native Spellchecker .................... no
  339.   WebRTC ................................. yes
  340.   Use System Ninja ....................... no
  341.   Geolocation ............................ no
  342.   WebChannel support ..................... yes
  343.   Use v8 snapshot ........................ yes
  344.   Kerberos Authentication ................ no
  345.   Support qpa-xcb ........................ yes
  346.   Use ALSA ............................... yes
  347.   Use PulseAudio ......................... yes
  348.   Optional system libraries used:
  349.     re2 .................................. no
  350.     icu .................................. no
  351.     libwebp, libwebpmux and libwebpdemux . no
  352.     opus ................................. no
  353.     ffmpeg ............................... no
  354.     libvpx ............................... no
  355.     snappy ............................... no
  356.     glib ................................. yes
  357.     zlib ................................. no
  358.     minizip .............................. no
  359.     libevent ............................. no
  360.     jsoncpp .............................. no
  361.     protobuf ............................. no
  362.     libxml2 and libxslt .................. no
  363.     lcms2 ................................ no
  364.     png .................................. no
  365.     JPEG ................................. no
  366.     harfbuzz ............................. no
  367.     freetype ............................. no
  368.   Required system libraries:
  369.     fontconfig ........................... yes
  370.     dbus ................................. yes
  371.     nss .................................. yes
  372.     khr .................................. yes
  373.     glibc ................................ yes
  374.   Required system libraries for qpa-xcb:
  375.     x11 .................................. yes
  376.     libdrm ............................... yes
  377.     xcomposite ........................... yes
  378.     xcursor .............................. yes
  379.     xi ................................... yes
  380.     xtst ................................. yes
  381. Note: Also available for Linux: linux-clang linux-icc
  382. Note: -optimized-tools is not useful in -release mode.
  383. Qt is now configured for building. Just run 'make'.
  384. Once everything is built, you must run 'make install'.
  385. Qt will be installed into '/root/honglingfeng/arm-qt-5.12.8'.
  386. Prior to reconfiguration, make sure you remove any leftovers from
  387. the previous build.
复制代码
QWebEngine底子依靠
  1. sudo apt-get install bison flex gperf libdus* dbus* libfontconfig1-dev fontconfig libnss3-dev python2 pkg-config
  2. sudo apt-get install libicu-dev ninja-build
复制代码
OpenGL相关依靠
  1. sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev libegl1-mesa-dev freeglut* libgles* libglew*
复制代码
xcb相关依靠
  1. sudo apt-get install libx11-*
  2. sudo apt-get install libx11*
  3. sudo apt-get install libxcb-*
  4. sudo apt-get install libxcb*
  5. sudo apt-get install libxkbcommon-devsudo
  6. sudo apt-get install libxkbcommon-x11-dev
  7. sudo apt-get install libxcb-xinerama0-dev
  8. sudo apt-get install libxcb-sync-dev
复制代码
若报Could not find all necessary libraries for qpa-xcb support
发起再安装一遍依靠
  1. sudo apt-get install bison build-essential gperf flex libasound2-dev\
  2. libcups2-dev libdrm-dev libegl1-mesa-dev libnss3-dev libpci-dev\
  3. libpulse-dev libudev-dev nodejs libxtst-dev gyp ninja-build\
  4. libssl-dev libxcursor-dev libxcomposite-dev libxrandr-dev
复制代码
QtWebEngine库大部分问题都是没有依靠库导致的,如果堕落就安装相关的依靠库即可。
编译

  1. make -j4
  2. make install
复制代码
这里要提一下QWebEngine使用了chromium-browser大部分功能,基本第三方库中的chromium都需要编译。rk3588板卡只有8g内存,需要添加10G swap假造内存空间来支持编译。不然容易编译中途因为内存耗尽而中断。
  1. sudo mkdir /swapfile
  2. sudo dd if=/dev/zero of=swapfile bs=1G count=10
  3. sudo mkswap /swapfile
  4. # 开启
  5. sudo swapon /swapfile
  6. # 查看是否启用
  7. free -h #swap那一栏
复制代码
遇到问题



  • build chromium错误
  1. WARNING: C++14 support is required in order to build chromium.
  2. WARNING: QtWebEngine will not be built.
复制代码
可以通过安装chromium-brower办理
  1. sudo apt update
  2. sudo apt install chromium-browser
复制代码
引用

1:【Qt编译】ARM环境 Qt5.14.2-QtWebEngine库编译 (完备版)https://blog.csdn.net/Monster_H7/article/details/137630448
2: 交叉编译 Qt5.12 armv8(aarch64) 带 WebEngine - NVIDIA JETSON TX2 https://www.cnblogs.com/zekexiao/p/17681933.html
3:【研究Qt webengine 模块编译】linux 交叉编译qt5.12的webengine模块乐成的条件 https://liucjy.blog.csdn.net/article/details/104422691

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

守听

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表