全志A64 QT移植

1. 把编译工具 gcc-linaro-aarch64.tar.xz 添加到环境.bashrc 中

2. 下载 tslib-1.4.tar.gz ,libiconv-1.15.tar.gz ,qt-everywhere-opensource-src-5.6.1.tar.gz

3. 由于tslib与libiconv无法识别arch64 所以需要解压编译工具并创建软链接。

#!/bin/sh
ln -s aarch64-linux-gnu-addr2line arm-linux-addr2line 
ln -s aarch64-linux-gnu-ar arm-linux-ar 
ln -s aarch64-linux-gnu-as arm-linux-as 
ln -s aarch64-linux-gnu-c++ arm-linux-c++ 
ln -s aarch64-linux-gnu-c++filt arm-linux-c++filt 
ln -s aarch64-linux-gnu-cpp arm-linux-cpp 
ln -s aarch64-linux-gnu-elfedit arm-linux-elfedit 
ln -s aarch64-linux-gnu-ct-ng.config arm-linux-ct-ng.config 
ln -s aarch64-linux-gnu-g++ arm-linux-g++ 
ln -s aarch64-linux-gnu-gcc arm-linux-gcc 
ln -s aarch64-linux-gnu-gcc-ar arm-linux-gcc-ar 
ln -s aarch64-linux-gnu-gcc-nm arm-linux-gcc-nm 
ln -s aarch64-linux-gnu-gcc-ranlib arm-linux-gcc-ranlib 
ln -s aarch64-linux-gnu-gcov arm-linux-gcov 
ln -s aarch64-linux-gnu-gdb arm-linux-gdb 
ln -s aarch64-linux-gnu-gfortran arm-linux-gfortran 
ln -s aarch64-linux-gnu-gprof arm-linux-gprof 
ln -s aarch64-linux-gnu-ld arm-linux-ld 
ln -s aarch64-linux-gnu-ldd arm-linux-ldd 
ln -s aarch64-linux-gnu-nm arm-linux-nm 
ln -s aarch64-linux-gnu-objcopy arm-linux-objcopy 
ln -s aarch64-linux-gnu-objdump arm-linux-objdump 
ln -s aarch64-linux-gnu-pkg-config arm-linux-pkg-config 
ln -s aarch64-linux-gnu-pkg-config-real arm-linux-pkg-config-real 
ln -s aarch64-linux-gnu-ranlib arm-linux-ranlib 
ln -s aarch64-linux-gnu-readelf arm-linux-readelf 
ln -s aarch64-linux-gnu-size arm-linux-size 
ln -s aarch64-linux-gnu-strings arm-linux-strings 
ln -s aarch64-linux-gnu-strip arm-linux-strip

  4. 解压tslib 并编译安装

#!/bin/sh
./autogen.sh
make clean && make distclean
echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
CC=arm-none-linux-gcc
./configure --host=arm-linux --prefix=/opt/tslib1.4 --cache-file=arm-linux.cache
make && make install

  5. 解压libiconv 并编译安装

#!/bin/sh
./configure -prefix=/opt/libiconv -host=arm-linux
make && make install

  6. 解压qt-everywhere-opensource-src 并编译安装

 修改该gcc配置

$vim qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf
#
# qmake configuration for building with arm-linux-gnueabi-g++
#

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
#QMAKE_CC                = arm-linux-gnueabi-gcc
#QMAKE_CXX               = arm-linux-gnueabi-g++
#QMAKE_LINK              = arm-linux-gnueabi-g++
#QMAKE_LINK_SHLIB        = arm-linux-gnueabi-g++

# modifications to linux.conf
#QMAKE_AR                = arm-linux-gnueabi-ar cqs
#QMAKE_OBJCOPY           = arm-linux-gnueabi-objcopy
#QMAKE_NM                = arm-linux-gnueabi-nm -P
#QMAKE_STRIP             = arm-linux-gnueabi-strip

# modifications to g++.conf
QMAKE_CC                = aarch64-linux-gnu-gcc
QMAKE_CXX               = aarch64-linux-gnu-g++
QMAKE_LINK              = aarch64-linux-gnu-g++
QMAKE_LINK_SHLIB        = aarch64-linux-gnu-g++

# modifications to linux.conf
QMAKE_AR                = aarch64-linux-gnu-ar cqs
QMAKE_OBJCOPY           = aarch64-linux-gnu-objcopy
QMAKE_NM                = aarch64-linux-gnu-nm -P
QMAKE_STRIP             = aarch64-linux-gnu-strip



load(qt_config)
~               

配置编译参数

#!/bin/sh
./configure -prefix /opt/qt-5.6-arm -release -xplatform linux-arm-gnueabi-g++ -make libs -optimized-qmake -pch -shared -qt-libjpeg -qt-libpng -tslib -I/opt/tslib1.4/include -L/opt/tslib1.4/lib -nomake tools -make examples -iconv
make
make install #在安装example时报错可以不理睬

7. 在/opt/qt-5.6-arm 下生成A64 相关的样例和库

bin  doc  etc  examples  include  lib  mkspecs  plugins  qml  share

8. 新建文件夹,拷贝/opt/qt-5.6-arm/examples ,/opt/qt-5.6-arm/lib, /opt/qt-5.6-arm/plugins ,/opt/tslib1.4/lib, /opt/libiconv/lib/ 并打包放到 开发板上

在开发板上配置环境变量运行测试程序

export QTDIR=/dav/qt-5.6-arm
export QT_QPA_FONTDIR=$QTDIR/lib/fonts 
export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins/ 
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH 
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0
export QWS_MOUSE_PROTO=/dev/input/event0
export LD_PRELOAD=/dav/qt-5.6-arm/lib/preloadable_libiconv.so


./svg/embeddedsvgviewer/embeddedsvgviewer

 

posted @ 2018-11-04 12:50  okshall  阅读(798)  评论(0编辑  收藏  举报