Mipsel 平台下 编译QT 5.9

1,交叉编译器信息:

mipsel-linux-gcc -v
使用内建 specs。
COLLECT_GCC=/mips/host/usr/bin/mipsel-linux-gcc.br_real
COLLECT_LTO_WRAPPER=/mips/host/usr/libexec/gcc/mipsel-buildroot-linux-gnu/4.9.3/lto-wrapper
目标:mipsel-buildroot-linux-gnu
配置为:./configure --prefix=/mips/host/usr --sysconfdir=/mips/host/etc --enable-static --target=mipsel-buildroot-linux-gnu --with-sysroot=/mips/host/usr/mipsel-buildroot-linux-gnu/sysroot --disable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --with-gmp=/mips/host/usr --with-mpfr=/mips/host/usr --with-pkgversion='Buildroot 2016.02' --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath --enable-tls --enable-plugins --enable-lto --disable-libmudflap --enable-threads --with-mpc=/opt/mips/Gm9260/host/usr --with-isl=/mips/host/usr --with-cloog=/mips/host/usr --with-float=soft --disable-decimal-float --with-arch=mips32 --with-abi=32 --enable-languages=c,c++ --with-build-time-tools=/mips/host/usr/mipsel-buildroot-linux-gnu/bin --enable-shared --enable-libgomp
线程模型:posix
gcc 版本 4.9.3 (Buildroot 2016.02) 

2,相关库:

     1)qt-everywhere-opensource-src-5.9.9.tar.xz

     2)libts库:https://github.com/libts/tslib  

cd tslib
./autogen.sh
./configure --host=mipsel-linux --prefix=/opt/mips_qt_project/tslib
make
make install

3,qt编译

     1)tar -xvf qt-everywhere-opensource-src-5.9.9.tar.xz

     2)cd qt-everywhere-opensource-src-5.9.9

     3)vi qtbase/mkspecs/devices/linux-mipsel-ci20-g++/qmake.conf 

#
# qmake configuration for building with mips-mti-linux-gnu-g++
# build for CI20 targets X11
#

CROSS_COMPILE           = mipsel-linux-   #此处修改成实际使用的交叉编译器

include(../common/linux_device_pre.conf)

QMAKE_CFLAGS            = -EL -march=mips32r2 -lts #此处增加 -lts 链接tslib库
QMAKE_CXXFLAGS          = $${QMAKE_CFLAGS}
QMAKE_LFLAGS            = -EL

QT_QPA_DEFAULT_PLATFORM = linuxfb   #xcb  本人编译后插件没有xcb,所以修改默认平台为linuxfb

QMAKE_LIBS_EGL          = -lEGL -lIMGegl -lusc
QMAKE_LIBS_OPENGL_ES2   = -lGLESv2 $${QMAKE_LIBS_EGL}

include(../common/linux_device_post.conf)

load(qt_config)

  4)qt编译选项

./configure -prefix /opt/mips_qt_project/qt5 \
            -opensource -release -shared -pch \
            -sql-sqlite -qt-libjpeg -qt-zlib \
            -qt-libpng -qt-freetype -no-openssl \
            -nomake examples -nomake tests \
            -nomake tools -optimized-qmake \
            -no-opengl -no-cups -no-xkb -no-sm \
            -no-separate-debug-info \
            -xplatform devices/linux-mipsel-ci20-g++ \
            -linuxfb -confirm-license \
            -tslib -I/opt/mips_qt_project/tslib/include -L/opt/mips_qt_project/tslib/lib

4,执行./configure 时的错误

Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
...
ERROR: Feature 'tslib' was enabled, but the pre-condition 'libs.tslib' failed
 

提示tslib有错误可能的原因:

1)检查编译选项的 -I/opt/mips_qt_project/tslib/include -L/opt/mips_qt_project/tslib/lib 是否有对应的库和头文件

2)tslib库编译有问题,需要重新编译tslib;(本人初始使用tslib1.4编译时,提示错误,通过修改tslib源码后编译通过,但是编译出来的tslib库不正确,重新从github下载后,未修改编译通过,这个tslib正确)

3)重新编译后仍提示这个问题,删除qt源码的目录,重新解压出来

 

6,环境变量

#tslib环境变量
export TSLIB_ROOT=/usr/local/tslib   #tslib 编译出来的文件,全部拷贝到此目录 /usr/local/tslib
export TSLIB_CONSOLEDEVICE=none    
export TSLIB_FBDEVICE=/dev/fb0 
export TSLIB_TSDEVICE=/dev/input/event0 
export TSLIB_CALIBFILE=/etc/pointercal 
export TSLIB_CONFFILE=/usr/local/tslib/etc/ts.conf 
export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts 
export TSLIB_TSEVENTTYPE=INPUT 
#QT的环境变量
export QTDIR=/usr/local/qt5  
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/local/qt5/plugins #qt5编译出来的plugins 
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
export QT_QPA_FONTDIR=$QTDIR/lib/fonts
export TSDEVICE=/dev/input/event0   #此处是实际的触摸屏设备
export QT_QPA_GENERIC_PLUGINS=tslib:$TSDEVICE  # tstlib:/dev/input/event0表示使用的插件是 tslib
export QWS_MOUSE_PROTO=tslib:$TSDEVICE
export set QWS_DISPLAY=Linuxfb:/dev/fb0
export set QWS_DISPLAY="LinuxFb:mmWidth100:mmHeight130:0"
export set QT_QWS_FONTDIR=$QTDIR/lib/fonts/  #放编码文件,不然中文乱码

export LD_PRELOAD=/usr/lib/preloadable_libiconv.so #若提示下面内容,则需要此库
#QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
#QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed

 

发布了53 篇原创文章 · 获赞 18 · 访问量 8万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 精致技术 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览