使用Qt5.5.1源码包进行编译:下载地址 http://download.qt.io/official_releases/qt/
tslib1.4编译
1.解压并进入Tslib目录3.拷贝安装脚本并运行 installTslib.sh
#!/bin/sh
./autogen.sh
make clean && make distclean
echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
CC=arm-fsl-linux-gnueabi-gcc
./configure --host=arm-fsl-linux-gnueabi --prefix=/usr/local/arm/tslib1.4 --cache-file=arm-linux.cache
make && make install
Qt编译
1、进入源码包根目录,配置qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf
1 #
2 # qmake configuration for building with arm-linux-gnueabi-g++
3 #
4
5 MAKEFILE_GENERATOR = UNIX
6 CONFIG += incremental
7 QMAKE_INCREMENTAL_STYLE = sublib
8
9 QT_QPA_DEFAULT_PLATFORM = linuxfb
10 QMAKE_CFLAGS_RELEASE += -O2 -march=armv7-a
11 QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a #cortex-a8
12
13 include(../common/linux.conf)
14 include(../common/gcc-base-unix.conf)
15 include(../common/g++-unix.conf)
16
17 # modifications to g++.conf
18 QMAKE_CC = /usr/local/arm/arm-linux-gcc-4.8.3/bin/arm-none-linux-gnueabi-gcc
19 QMAKE_CXX = /usr/local/arm/arm-linux-gcc-4.8.3/bin/arm-none-linux-gnueabi-g++
20 QMAKE_LINK = /usr/local/arm/arm-linux-gcc-4.8.3/bin/arm-none-linux-gnueabi-g++
21 QMAKE_LINK_SHLIB = /usr/local/arm/arm-linux-gcc-4.8.3/bin/arm-none-linux-gnueabi-g++
22
23 # modifications to linux.c/usr/local/arm/arm-linux-gcc-4.8.3/bin/arm-none-linux-gnueabi
24 QMAKE_AR = /usr/local/arm/arm-linux-gcc-4.8.3/bin/arm-none-linux-gnueabi-ar cqs
25 QMAKE_OBJCOPY = /usr/local/arm/arm-linux-gcc-4.8.3/bin/arm-none-linux-gnueabi-objcopy
26 QMAKE_NM = /usr/local/arm/arm-linux-gcc-4.8.3/bin/arm-none-linux-gnueabi-nm -P
27 QMAKE_STRIP = /usr/local/arm/arm-linux-gcc-4.8.3/bin/arm-none-linux-gnueabi-strip
28 load(qt_config)
2、配置编译选项
./configure -release -opensource -xplatform linux-arm-gnueabi-g++ -prefix /usr/local/qt -no-c++11 -no-opengl -no-dbus -no-icu -no-eglfs -no-iconv -I/usr/local/tslib/include -L/usr/local/tslib/lib
配置成功显示内容
This is the Qt Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU Lesser General Public License (LGPL) versions 3.
Type '3' to view the GNU Lesser General Public License version 3.
Type 'L' to view the Lesser GNU General Public License version 2.1.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.
Do you accept the terms of either license? yes
Creating qmake...
.Done.
Running configuration tests...
Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.
Configure summary
Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: linux-arm-gnueabi-g++ (arm, CPU features: none detected)
Platform notes:
- Also available for Linux: linux-kcc linux-icc linux-cxx
Build options:
Configuration .......... accessibility audio-backend clock-gettime clock-monotonic compile_examples concurrent cross_compile dbus enable_new_dtags evdev eventfd freetype full-config getaddrinfo getifaddrs harfbuzz iconv inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap nis no-pkg-config pcre png posix_fallocate precompile_header qpa qpa reduce_exports release rpath shared small-config zlib
Build parts ............ libs examples
Mode ................... release
Using sanitizer(s)...... none
Using C++11 ............ no
Using gold linker....... no
Using new DTAGS ........ yes
Using PCH .............. yes
Target compiler supports:
Neon ................. no
Qt modules and options:
Qt D-Bus ............... yes (loading dbus-1 at runtime)
Qt Concurrent .......... yes
Qt GUI ................. yes
Qt Widgets ............. yes
Large File ............. yes
QML debugging .......... yes
Use system proxies ..... no
Support enabled for:
Accessibility .......... yes
ALSA ................... no
CUPS ................... no
Evdev .................. yes
FontConfig ............. no
FreeType ............... yes (bundled copy)
Glib ................... no
GStreamer .............. no
GTK theme .............. no
HarfBuzz ............... yes (bundled copy)
Iconv .................. yes
ICU .................... no
Image formats:
GIF .................. yes (plugin, using bundled copy)
JPEG ................. yes (plugin, using bundled copy)
PNG .................. yes (in QtGui, using bundled copy)
journald ............... no
libinput................ no
mtdev .................. no
Networking:
getaddrinfo .......... yes
getifaddrs ........... yes
IPv6 ifname .......... yes
libproxy.............. no
OpenSSL .............. no
NIS .................... yes
OpenGL / OpenVG:
EGL .................. no
OpenGL ............... no
OpenVG ............... no
PCRE ................... yes (bundled copy)
pkg-config ............. no
PulseAudio ............. no
QPA backends:
DirectFB ............. no
EGLFS ................ no
EGLFS i.MX6....... .
EGLFS KMS .......... no
EGLFS Mali .........
EGLFS Raspberry Pi .
EGLFS X11 .......... no
LinuxFB .............. yes
XCB .................. no
Session management ..... yes
SQL drivers:
DB2 .................. no
InterBase ............ no
MySQL ................ no
OCI .................. no
ODBC ................. no
PostgreSQL ........... no
SQLite 2 ............. no
SQLite ............... yes (plugin, using bundled copy)
TDS .................. no
tslib .................. no
udev ................... no
xkbcommon-x11........... no
xkbcommon-evdev......... no
zlib ................... yes (bundled copy)
Info: creating super cache file /home/djq/Downloads/qt-everywhere-opensource-src-5.5.0/.qmake.super
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into /usr/local/qt
Prior to reconfiguration, make sure you remove any leftovers from
the previous build.
3、sudo make -j4 & sudo make install
echo "Compile usr app (gcc version 4.8.3),Support Qt version 5.5.1"
# config qts env parm
export QTDIR=/usr/local/qt
export QPEDIR=$QTDIR
export QT_QWS_FONTDIR=$QTDIR/lib/fonts
export QWS_SIZE=1366x768
#export QWS_DISPLAY=LinuxFb:/dev/fb0
export PATH=$QTDIR/bin:$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0
export QT_QPA_GENERIC_PLUGINS=EvdevTouch:/dev/input/event1
#export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1:rotate=180 #可以使触摸屏旋转一定角度90-180-270