韦东山imx6ull QT移植

韦东山imx6ull QT移植

1. 下载安装 qt-opensource-linux-x64-5.12.8.run # 安装qt designer		默认安装在/opt 文件夹下
2. 下载 qt-everywhere-src-5.12.8.tar.xz,  #配置arm交叉编译工具,在linux平台编译arm版的qt文件
	tar vxf qt-everywhere-src-5.12.8.tar.xz cd 	# 解压
	qt-everywhere-src-5.12.8/ 
	vi qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf   #配置对qmake.conf进行编辑(下文内容)
	vim  compile.sh						# 在解压出来的qt目录创建一个脚本,编辑(下文内容)
	chmod 777 compile.sh 
	./compile.sh					#运行脚本
	
	make  -j 12   
	make install
3.  在linux的qt designer 配置编译器 和交叉编译器
	配置linux的qt环境变量
4. 配置arm开发板 环境
	cp arm-qt /usr/lib     将生成的arm-qt文件夹复制arm板的/usr/lib
	vi /etc/profile  # 配置环境(下文)
	source /etc/profile		
	cp /usr/lib/arm-qt/lib/*so* -d  /lib #移植动态库

5. 测试
cd /usr/lib/arm-qt/examples/widgets/widgets/digitalclock
./digitalclock
#####  qmake.conf 文件
# qmake configuration for building with arm-linux-gnueabi-g++
#
MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

QT_QPA_DEFAULT_PLATFORM = linuxfb
QMAKE_CFLAGS_RELEASE += -O2 -march=armv7-a 		# 自己的cpu型号
QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a 	 #

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

# modifications to g++.conf
QMAKE_CC                = arm-buildroot-linux-gnueabihf-gcc		# linux自己的交叉编译器
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		# linux自己的交叉编译器
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)

## compile.sh文件
#!/bin/bash
./configure -prefix /home/book/13_qt/qt-everywhere-src-5.12.8/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 \
-tslib \
--libpng=qt \
--libjpeg=qt \
--sqlite=qt \
-plugin-sql-sqlite \		
-I/home/book/11_tslib/tslib-1.21/tmp/include \		# tslib 头文件
-L/home/book/11_tslib/tslib-1.21/tmp/lib \			# 库文件
-recheck-all
## arm开发板的环境配置  /etc/profile
export PATH=/bin:/sbin:/usr/bin:/usr/sbin

if [ "$PS1" ]; then
        if [ "`id -u`" -eq 0 ]; then
                export PS1='# '
        else
                export PS1='$ '
        fi
fi

export PAGER='/bin/more'
export EDITOR='/bin/vi'

# Source configuration files from /etc/profile.d
for i in /etc/profile.d/*.sh ; do
        if [ -r "$i" ]; then
                . $i
        fi
done
unset i

# tslib  修改
export TSLIB_ROOT=/usr/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
#export LD_PRELOAD=usr/lib/libts.so		

# qt 修改
export QT_ROOT=/usr/lib/arm-qt
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/input/event1
export QT_QPA_FONTDIR=/usr/share/fonts/liberation
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


# debug 调试专用
# export QT_DEBUG_PLUGINS=1		# 调试

export $(dbus-launch)
#export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0				##
#export QT_QPA_FONTDIR=/usr/lib/fonts					##
HOSTNAM='/bin/hostname:'
PS1='\[\e[0;32m\][\u@\h:\w]\$ \[\e[m\]'
shopt -s checkwinsize
resize
export PS1 HOSTNAME
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值