User Tools

Site Tools


Sidebar

* [[start]] * [[som|System on module]] * [[usomiq-beaglebone|Mentorel Beaglebone uSomIQ]] * [[usomiq|uSomIQ AM335x]] * [[somiq|SomIQ family]] * [[blueshark|BlueShark family]] * [[devkit|DevKits]] * [[usomiq-bone-cape|uSomIQ Bone Cape]] * [[somiqboard|Somiqboard]] * [[atoll|Atoll]] * [[expansion|Expansion boards]] * [[somiq-wlan|SomIQ-WLAN]] * [[os|OS support]] * [[ubuntu|Ubuntu Linux]] * [[sw-hints|SW hints]] * [[tslib|Tslib]] * [[qt-embedded|Qt embedded]] Follow us * [[http://twitter.com/mentorel|Twitter]] * [[http://www.linkedin.com/company/mentorel|LinkedIn]] * [[https://www.facebook.com/mentorel.company|Facebook]] * [[https://plus.google.com/105868322858146792212/posts|Google+]] * [[http://www.mentorel.com|MENTOREL home page]]

qt-embedded

====== How to compile and install Qt to an ARM platform ====== ===== Qt for Ubuntu ARM Core ===== //These instructions were tested on a Ubuntu 12.04 LTS system// ==== Prerequisites ==== First of all you need to install a cross-compiler tool that is compatible with Ubuntu Core ARM: <code> apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf </code> Other tools like autogen, libtool and others are considered to be installed on a development host. ==== Compile Qt sources ==== Download qt sources from 'ftp://ftp.qt-project.org/qt/source/'. To avoid problems connected with the latest Qt 5.x version we'll use the latest from 4.x series: 4.8.1 <code> wget ftp://ftp.qt-project.org/qt/source/qt-everywhere-opensource-src-4.8.1.tar.gz </code> Untar it in the home directory: <code> tar xf qt-everywhere-opensource-src-4.8.1.tar.gz </code> Now we need to specify a proper configuration that is suitable for our target system. Let's presume that we want to work only on a target without X-system installed, with a touchscreen for input and omit Java, SQL and WebKit support. You can still enable these packets, it only affects the build time. Qt can be a X-server itself if it's run with a key '-qws'. First, let's specify the cross-environment configuration. For this modify the file 'mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf' and make it as suggested: <code> # # qmake configuration for building with arm-linux-gnueabihf-g++ # include(../../common/linux.conf) include(../../common/gcc-base-unix.conf) include(../../common/g++-unix.conf) include(../../common/qws.conf) TSLIB_INCDIR = /usr/local/include TSLIB_LIBDIR = /usr/local/lib #Compiler Flags to take advantage of the ARM architecture QMAKE_CC = arm-linux-gnueabihf-gcc QMAKE_CXX = arm-linux-gnueabihf-g++ QMAKE_LINK = arm-linux-gnueabihf-g++ QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++ # modifications to linux.conf QMAKE_AR = arm-linux-gnueabihf-ar cqs QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy QMAKE_STRIP = arm-linux-gnueabihf-strip QMAKE_INCDIR += $$TSLIB_INCDIR QMAKE_LIBDIR += $$TSLIB_LIBDIR QMAKE_LIBS += -lts load(qt_config) </code> Please pay attention that we include the Include- and Library- paths to the build as TSLIB_INCDIR and TSLIB_LIBDIR. Next, run the configure script: <code> ./configure -prefix /opt/qte4.8.1 -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-arm-gnueabi-g++ -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -fast -qt-mouse-tslib -nomake demos -nomake examples -no-svg -no-phonon -no-qt3support -no-svg -qt-gfx-linuxfb -no-javascript-jit -confirm-license -opensource -no-webkit </code> For the installation path we chose '/opt/qte4.8.1' but you can choose the one you like. Next, run make and make install: <code> make && make install </code> So, finally you are able to compile an application for an ARM target running on a Ubuntu Core file system. To compile the application go to a folder with a *.pro file and run there qmake, like: <code> /opt/qte4.8.1/bin/qmake </code> Then usual make <code> make </code> You will have a dynamically linked binary intended to run on a ARM system. However, as we chose the build with shared libraries, at first you need to install same libraries and fonts to the target. For this you can pack the whole folder '/opt/qte4.8.1', upload it to the target and then unpack it in the same destination '/opt', so both the host and the target had the same paths to the libraries and fonts. After this you are able to run applications cross-compiled at a x86 linux system. ==== Qt application with touchscreen support ==== For Tslib installation instructions refer to the page [[tslib]] <code> export QWS_MOUSE_PROTO=tslib:/dev/input/event0 export TSLIB_CALIBFILE=/usr/local/etc/pointercal export TSLIB_CONFFILE=/usr/local/etc/ts.conf export TSLIB_PLUGINDIR=/usr/local/lib/ts </code> To run an application with touchsreen input you can export all variables as described above, or simply run the application by issuing the command: <code> QWS_MOUSE_PROTO=tslib:/dev/input/event0 ./your-app -qws </code>

qt-embedded.txt · Last modified: 2013/06/11 03:31 by maxx