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.

Make sure that the installer script is executable:<br />

$ chmod +x install.sh<br />

Install the ELDK:<br />

$ ./install.sh armv7a<br />

He asks for the user password to get root privileges and then he will install the ELDK into<br />

/opt/eldk-5.2.1/armv7a/. It is possible to install the ELDK into a different directory, see<br />

$ ./install ­­help<br />

for more information.<br />

Now you have to set <strong>up</strong> some <strong>environment</strong> variables that are required to use the <strong>cross</strong> compiler. Add<br />

this at the end of your .profile file in the users home directory. It may be required to modify it to the<br />

version number and paths according to the version of ELDK you are using (there are no spaces in<br />

the lines!).<br />

export PATH=/opt/eldk­5.2.1/armv7a/sysroots/i686­eldk­linux/usr/bin/armv7avfp­neon­linux­gnueabi/:$PATH<br />

export PATH=/opt/eldk­5.2.1/armv7a/sysroots/i686­eldk­linux/usr/bin/:$PATH<br />

export ARCH=arm<br />

export PKG_CONFIG_PATH="/opt/eldk­5.2.1/armv7a/sysroots/i686­eldklinux/usr/lib/pkgconfig"<br />

export PKG_CONFIG_SYSROOT_DIR="/opt/eldk­5.2.1/armv7a/sysroots/i686­eldklinux"<br />

export CROSS_COMPILE=arm­linux­gnueabi­<br />

You will need to log off and on again that the changes will take effect.<br />

Now the basic <strong>cross</strong> <strong>compiling</strong> <strong>environment</strong> is set <strong>up</strong>. To compile a simple C program you type<br />

$ ${CROSS_COMPILE}gcc ­o hello hello.c<br />

5 Eclipse<br />

An more comfortable way of <strong>cross</strong> <strong>compiling</strong> is Eclipse. Besides the basic features you get from an<br />

IDE like syntax highlighting and automatic makefile generation Eclipse also provides functions for<br />

a remote launch of your application.<br />

5.1 Install Eclipse<br />

Before you can install Eclipse you have to make sure that you have installed a Java Runtime<br />

Environment. Open a Terminal and execute this command:<br />

$ apt­get install default­jre<br />

Now go to http://www.eclipse.org/downloads/ and download the Eclipse Classic version for Linux<br />

32Bit. Extract the archive to your desktop.<br />

Start Eclipse by executing the file called eclipse in the extracted folder.<br />

Go the Help → Install new Software and add a new Repository by clicking on Add on the top right<br />

of the window. Call it CDT and use this link: http://download.eclipse.org/tools/cdt/releases/juno<br />

This path may be adjusted, when you are not using Eclipse Juno. Click OK to add the new<br />

repository.<br />

3/20

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

Saved successfully!

Ooh no, something went wrong!