16.03.2015 Views

Setting up cross compiling environment & Qt/X11 ... - Bytemark Hosting

Setting up cross compiling environment & Qt/X11 ... - Bytemark Hosting

Setting up cross compiling environment & Qt/X11 ... - Bytemark Hosting

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Qt</strong>/embedded which doesn't need a X server which makes systems very lightweight and fast. In this<br />

document we will discuss how to set <strong>up</strong> <strong>Qt</strong> using the X server but <strong>compiling</strong> it for embedded use is<br />

not a big difference.<br />

6.1 <strong>Setting</strong> <strong>up</strong> <strong>Qt</strong>/<strong>X11</strong><br />

You first need to set <strong>up</strong> the terminal compilation method described above. Download the <strong>Qt</strong> sources<br />

from http://qt.nokia.com/downloads. Scroll a bit down to "<strong>Qt</strong> libraries". The file should have a<br />

name like qt-everywhere-opensource-src-4.8.2.tar.gz. Extract the sources into you home directory:<br />

$ tar xzf Downloads/qt­everywhere­opensource­src­4.8.2.tar.gz<br />

Change into the <strong>Qt</strong> directory:<br />

$ cd qt­everywhere­opensource­src­4.8.2<br />

Copy the modified configuration for <strong>Qt</strong> and replace the existing one. You will find the modified file<br />

in the Anders DX4 wiki:<br />

$ cp ../Downloads/qmake.conf mkspecs/qws/linux­arm­gnueabi­g++/qmake.conf<br />

Then open the file in mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf and make sure that all the<br />

paths to the ELDK are correct.<br />

Make sure all required tools like make are installed:<br />

$ sudo apt­get install build­essential<br />

After that use the following command line to configure <strong>Qt</strong>. The path behind -prefix defines the<br />

folder where <strong>Qt</strong> will be installed. This is the folder for the local computer and the DX4. You should<br />

not install it in / because this will cause problems with a local x86 installation of <strong>Qt</strong>. Execute the<br />

following command to configure the <strong>Qt</strong> sources (hit return after each line):<br />

./configure ­arch arm ­xplatform qws/linux­arm­gnueabi­g++ \<br />

­force­pkg­config ­nomake demos ­nomake examples ­no­openssl \<br />

­no­sql­sqlite ­no­phonon ­no­phonon­backend ­no­webkit \<br />

­prefix /usr/local/Trolltech/<strong>Qt</strong>­arm­<strong>X11</strong> \<br />

­D QT_RX71_MULTITOUCH ­confirm­license<br />

When the script finishes without any error continue <strong>compiling</strong> <strong>Qt</strong>:<br />

$ make ­j X<br />

Where X is the number of cores your CPU has plus one. So type<br />

$ make ­j 5<br />

on a quad core machine. This will speed <strong>up</strong> things by using parallel compilation.<br />

Note: Depending on the speed of your computer this process can take several hours.<br />

To install <strong>Qt</strong> on your local machine (which is required to <strong>cross</strong> compile) just type<br />

$ sudo make install<br />

Now you should add /usr/local/Trolltech/<strong>Qt</strong>-arm-<strong>X11</strong>/bin to your PATH variable by adding the<br />

following line to your users .profile file:<br />

export PATH=/usr/local/Trolltech/<strong>Qt</strong>­arm­<strong>X11</strong>/bin/:$PATH<br />

To open the file type:<br />

$ gedit ~/.profile<br />

13/20

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!