【ARM开发】交叉编译Qt源码之(0)编译Qt源码

【ARM开发】交叉编译Qt源码之(0)编译Qt源码本⽂只说明了Qt源码交叉编译的⽅法,编译出的Qt只⽀持基础库;如需ssl、gui、qml等,请关注后续。
1#解压交叉编译⼯具
2xz -d gcc-arm-10.3-2021.07-x86_
3tar -xvf gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar
2、交叉编译Qt
吴数德
2.1、解压Qt源码
1#解压Qt源码
2xz -d qt-everywhere-src-5.15.
3tar -xvf qt-everywhere-src-5.15.2.tar
4cd qt-everywhere-src-5.15.2
2.2、配置编译设置
1cd qtbase/mkspecs
2#以linux-arm-gnueabi-g++为模板,新建⼀个交叉编译配置
3cp -r linux-arm-gnueabi-g++ linux-arm-gnueabihf-g++
4cd linux-arm-gnueabihf-g++
5#编辑f
编辑 #f
1#
2# qmake configuration for building with arm-none-linux-gnueabihf-g++
3#
4
5MAKEFILE_GENERATOR      = UNIX
6CONFIG                += incremental
7QMAKE_INCREMENTAL_STYLE = sublib
8
9include(../f)
10include(../f)
tmac5
11include(../common/g++-f)
12
13# modifications to g++.conf
14QMAKE_CC                = /home/user/toolchain/arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-gcc
15QMAKE_CXX              = /home/user/toolchain/arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-g++
16QMAKE_LINK              = /home/user/toolchain/arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-g++
17QMAKE_LINK_SHLIB        = /home/user/toolchain/arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-g++
1852se52se
泉州汽车运输总公司19# modifications f
20QMAKE_AR                = /home/user/toolchain/arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-ar cqs
21QMAKE_OBJCOPY          = /home/user/toolchain/arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-objcopy
22QMAKE_NM                = /home/user/toolchain/arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-nm -P
23QMAKE_STRIP            = /home/user/toolchain/arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-strip
24load(qt_config)
2.3、新建配置脚本
1#进⼊Qt源码⽬录电话卡复制
2cd qt-everywhere-src-5.15.2
3#新建build⽂件夹,⽤来存放编译⽂件4mkdir build
5cd build
6#新建configure.sh配置⽂件
7vi configure.sh
configure.sh
2
3#其中/path/to/prefix指编译安装⽬录
4#如/home/user/toolchain/arm-none-linux-gnueabihf/arm-none-linux-gnueabihf 5#把编译结果安装在交叉编译器中,否则引⽤到该库需要指定对应的⽬录
6../configure \
7-prefix /path/to/prefix \
8-opensource \
9-confirm-license \
10-release \
11-xplatform linux-arm-gnueabihf-g++ \
12-make libs \
13-nomake examples \
14-nomake tools \
15-nomake tests \
16-no-openssl \
17-no-opengl \
18-skip qt3d \
19-skip qtactiveqt \
20-skip qtandroidextras \
21-skip qtcharts \
22-skip qtconnectivity \
23-skip qtdatavis3d \
24-skip qtdeclarative \
25-skip qtdoc \
26-skip qtgamepad \
27-skip qtgraphicaleffects \
28-skip qtimageformats \
29-skip qtlocation \
30-skip qtlottie \
31-skip qtmacextras \
32-skip qtmultimedia \
33-skip qtnetworkauth \
34-skip qtpurchasing \
35-skip qtquick3d \
36-skip qtquickcontrols \
37-skip qtquickcontrols2 \
38-skip qtquicktimeline \
39-skip qtremoteobjects \
40-skip qtscript \
41-skip qtscxml \
42-skip qtsensors \
43-skip qtserialbus \
44-skip qtserialport \
45-skip qtspeech \
46-skip qtsvg \
水电站建设
47-skip qttools \
48-skip qttranslations \
49-skip qtvirtualkeyboard \
50-skip qtwayland \
51-skip qtwebchannel \
52-skip qtwebglplugin \
53-skip qtwebsockets \
54-skip qtwebview \
55-skip qtwinextras \
56-skip qtx11extras \
57-skip qtxmlpatterns
开始编译
2./configure.sh 3#编译
4make
5#安装
6make install

本文发布于:2024-09-22 16:43:39,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/264707.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:编译   交叉   新建
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议