chenkf 发表于 2016-5-31 16:04:28

目标运行机器是rk3288,请教在ubuntu下交叉编译Qt5

目标运行机器是rk3288,请教在ubuntu下交叉编译Qt5,使用什么交叉编译工具链,如果已经编译过的同学,希望给个编译过程或是使用了的交叉编译工具链名称。非常感谢!

chenkf 发表于 2016-5-31 19:15:42

问题已经解决,把方法放出,希望能帮到大家、

操作系统:ubuntu 12

一、环境变量设置

export ARCH=arm
export CROSS_COMPILE_DIR=/home/lya/qt/gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux/bin
export CROSS_COMPILE=$CROSS_COMPILE_DIR/arm-linux-gnueabihf-
#cross arm
export CROSS_COMPILE_NAME=$PWD/qtbase/mkspecs/linux-arm-gnueabihf-g++
#pc


二、交叉编译工具链设置

qmake.conf

#
# qmake configuration for building with ${CROSS_COMPILE}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                = ${CROSS_COMPILE}gcc
QMAKE_CXX               = ${CROSS_COMPILE}g++
QMAKE_LINK            = ${CROSS_COMPILE}g++
QMAKE_LINK_SHLIB      = ${CROSS_COMPILE}g++

# modifications to linux.conf
QMAKE_AR                = ${CROSS_COMPILE}ar cqs
QMAKE_OBJCOPY         = ${CROSS_COMPILE}objcopy
QMAKE_NM                = ${CROSS_COMPILE}nm -P
QMAKE_STRIP             = ${CROSS_COMPILE}strip
load(qt_config)

三、编译设置
-- arm
./configure -opensource -confirm-license -prefix /opt/qt531-linaro-arm -xplatform ${CROSS_COMPILE_NAME} -shared -release -no-accessibility -no-sse2 -no-openssl -no-dbus -no-nis -no-audio-backend -no-opengl -no-openvg -nomake tools -nomake examples -no-sql-sqlite -no-pch -fontconfig -linuxfb -alsa --accessibility -v -evdev -skip qtwebkit -skip qttools -skip qtimageformats -skip qtscript

-- pc
./configure -opensource -confirm-license -prefix /opt/qt531-pc-shared -release -no-accessibility -no-sse2 -no-openssl -no-dbus -no-nis -no-audio-backend -no-opengl -no-openvg -nomake tools -nomake examples -no-sql-sqlite -no-pch -fontconfig -linuxfb -alsa --accessibility -v -evdev -skip qtwebkit -skip qttools -skip qtimageformats -skip qtscript

三、qt运行环境设置

export QTDIR=/opt/linuxarm
export PATH="$QTDIR/bin:/home/lya/qt/gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux/bin:$PATH"
export LD_LIBRARY_PATH=$QTDIR/lib:/chenkf:/usr/local/lib:$LD_LIBRARY_PATH
export QT_QPA_FONTDIR=$QTDIR/lib/fonts
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins/platforms
export QT_QPA_FONTDIR=$QTDIR/lib/fonts
#export LD_PRELOAD=$QTDIR/plugins/libiconv/preloadable_libiconv.so
#export QMAKESPEC=$QTDIR/mkspecs/linux-g++

lizhengchao 发表于 2016-8-1 14:20:33

楼主你好,能不能说的更详细一点,跪谢啊
页: [1]
查看完整版本: 目标运行机器是rk3288,请教在ubuntu下交叉编译Qt5