Build Environment

Warning : This Cookbook is "work in progress" I'm currently writing it and checking it. It might work for you - but it might not work at all!!
It worked for me. I compiled a QT program on the host and ran it on the OYO. If you have problems - just send me a mail.

This page has been visited 13189 times.

This is a cookbook on how I installed compilers, development environment and all the rest needed to compile software for the OYO.

I used the same openembedded and toolchain, I used for my mini2440 board.
If anyone knows better how to tailor it all to the OYO - please fix this pages !!

I using Ångström as a reference platform. The Open Embedded development environment is relatively straightforwards to setup on the Ubuntu machine I'm using.

Some of the information here if from me ( Frank ) but most comes from LinuxMce.org

If you like - you can view this pages in brown green orange blue

1.  Bit Baking Angstrom, and QT Embedded 4

1.1  Getting and preparing the required software

First let's make sure we have all the required packages.

 sudo apt-get install gawk diffstat help2man texi2html texinfo build-essential subversion cvs unzip texinfo git-core chrpath

On Ubuntu, you need to switch /bin/sh so that it points to /bin/bash rather than /bin/dash:

sudo dpkg-reconfigure dash

and choose "<No>" from the menu. (dash is the default in Ubuntu, but newer versions of sanity check warn about this: Using dash as /bin/sh causes build problems).

Now we create a place, where all the stuff will be.
Please make sure your "OE" directory is right under your HOME directory. We will rely on this in our scripts later. If you want to have it somewhere else ( /usr/local/source or whatever, you would have to adapt the scripts.)

cd ~
mkdir OE
cd OE
mkdir build
mkdir build/conf

Download latest bitbake from developer.berlios.de and extract the bitbake directory in the archive (eg. bitbake-1.8.16) to $HOME/OE

You now should have $HOME/OE/bitbake-1.8.16
Next steps are : move bitbake-1.8.16 to bitbake, get openembedded and create a config file.

cd ~/OE
tar -z -xvf bitbake-1.8.16.tar.gz
mv bitbake-1.8.16/ bitbake
git clone git://git.openembedded.org/openembedded
cp openembedded/conf/local.conf.sample build/conf/local.conf

Edit the config you have just copied to build/conf/local.conf

gedit build/conf/local.conf
MACHINE = "mini2440"

# Where to store sources
DL_DIR = "${HOME}/OE/downloads"

INHERIT += " rm_work "

# Make sure you have these installed
ASSUME_PROVIDED += "gdk-pixbuf-csource-native imagemagick-native librsvg-native"

# Which files do we want to parse:
BBFILES := "${HOME}/OE/openembedded/recipes/*/*.bb"

# What kind of images do we want?
IMAGE_FSTYPES += " tar.bz2 "

# Set TMPDIR instead of defaulting it to $pwd/tmp

# Make use of SMP and fast disks

#INHERIT += "oestats-client"
OESTATS_BUILDER      = "myname"

DISTRO = "angstrom-2008.1"

# If ENABLE_BINARY_LOCALE_GENERATION is set to "1" (default) , you can limit locales
# generated to the list provided by GLIBC_GENERATE_LOCALES. This is huge
# time-savior for developmental builds. Format: list of locale.encoding pairs
# with spaces as separators.

#  OYO comes with libc.2.6.1. We to build things with the same version
PREFERRED_VERSION_glibc = "2.6.1"
PREFERRED_VERSION_linux = "2.6.21"

Now we create a helper-script so that we don't have to set all the environment stuff manually

gedit ~/OE/source-me
export OETREE="$HOME/OE"

echo Setting up dev env for Ångström
if [ -z ${ORG_PATH} ] ; then
export ORG_PATH

if [ -z ${ORG_LD_LIBRARY_PATH} ] ; then

export LANG=C
sudo sysctl vm.mmap_min_addr=0
echo "Altered environment for OE Development"

I changes the QT4 settings, so that files get smaller and we don't need to copy too many dll's.

qedit  ~/OE/openembedded/recipes/qt4/qt4.inc
QT_CONFIG_FLAGS += "-release -shared -no-opengl -no-cups -no-xkb -no-xrender -no-xinerama -no-accessibility -reduce-relocations \
                    -qt-gfx-linuxfb -no-gfx-qvfb -no-kbd-qvfb -no-mouse-qvfb-qt-kbd-usb -confirm-license -qt-mouse-tslib \
                    -qt-gfx-transformed -qt-freetype -no-nas-sound -no-sm -no-nis \
                    -qt-gif -qt-libjpeg -qt-libpng -qt-zlib -no-libtiff\
                    -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 \
                    -no-pch -qdbus -stl -glib -phonon -webkit"

Set all grafics lib's to QT ( -qt-gif -qt-libjpeg -qt-libpng )
removed tiff (-no-libtiff)
removed sql functions (-no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 ) -qt-gfx-transformed is important.

Here you can find my qt4.inc http://www.fwma.de/pmwiki/uploads/Main/qt4.inc

1.2  Running Bitbake

Above, we made a script "source-me". We will use this script now.
source ~/OE/source-me

and start compiling

cd ~/OE/openembedded/
bitbake meta-toolchain-qte

For some unknown reason, I got an error when compiling lsusb Sitll have to find out what's going on here. Meanwhile I just disabled building it.

qedit ~/OE/angstrom-dev/work/armv4t-angstrom-linux-gnueabi/usbutils-0.86-r0/usbutils-0.86/Makefile

Change Line
sbin_PROGRAMS = lsusb$(EXEEXT)
# lsusb$(EXEEXT)

If you get any other error, trying to build a package try cleaning it: bitbake -c clean INSERTPACKAGENAME

Then try and build the image again. You should not have this problem, but it happened to a user.

A few hours later if all goes well you should find something like angstrom-2010.7-test-20101109-x86_64-linux-armv4t-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2 in ~/OE/angstrom-dev/deploy/glibc/sdk

This .....linux-gnueabi-toolchain-qte-4.6.3.tar.bz2 is a complete package that contains everything you need to compile Qt programms for arm.

Unpack the .....linux-gnueabi-toolchain-qte-4.6.3.tar.bz in your root directory

tar -C / -xjf angstrom-2010.7-test-20101109-x86_64-linux-armv4t-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2

Before using it we need to tell the environment where everything is located.

$ . /usr/local/angstrom/arm/environment-setup

Now you can use qmake2 to build software for the OYO

Let's make a simple example.

$  cd  ~
$  mkdir qte-example
$  cd qte-example

~/qte-example $  echo '#include <QApplication>
#include <QPushButton>

int main(int argc, char** argv) {
    QApplication app(argc, argv);

    QFont myFont("Helvetica",24,QFont::Bold);

    QPushButton *btn = new QPushButton("Hello World\r\nThis is a QT-embedded program\r\nrunning on OYO");
    QObject::connect(btn, SIGNAL(clicked()),
                     &app, SLOT(quit()));

    return app.exec();
' > main.cpp

~/qte-example $  qmake2 -project
~/qte-example $ qmake2 qte-example.pro
~/qte-example $ make

copy qte-example to the OYO.

Before we can run it on the OYO, we have to copy all the QT libraries and a few more libs.
On you host :

cd /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib
tar -z -cvf libqt.tgz  libQt* libglib-2.0.* libgthread-2.0.*  libts*

Copy libqt.tgz to the OYO into subdirectory /lib
Go to the OYO, into /lib and extract the libraries

cd /lib
tar -z -xvf libqt.tgz

Now everything is ready to run qte-example on the OYO.

When you run a QT programm from a telnet ( ssh ) shell, it will complain, that there is no "font dir"
Just type

export    QT_QWS_FONTDIR=/usr/local/qisda/fonts

Pls. check the script "/qdutil/em/start". Here you can find more settings.

My first QT Prog

Warning : This Cookbook is "work in progress"

2.  Building LINUX from OYO original sources

Here is a page that describes how to Build the linux kernel from OYO original sources.


tieum?10 January 2011, 08:27

Hi guys, I had the same issue with usbutils

it needs glibc 2.8 to use timerfd_settime and timerfd_create (see http://stackoverflow.com/questions/236652/timerfd-create-with-debian-linux-testing-on-amd64)

since the oyo/fnacbook binaries need glibc 2.6, I guess best option would be to use a previous version of usbutils, what do you think?

btw: thanks Frank for this great Cookbook ;)

tieum?15 January 2011, 23:46

finally managed to build everything, 2 remarks:

- did a git pull today and libusb compiles fine now

- bitbake wanted to build udev 151 (not working with glibc 2.6) and not the 141 one: somewhere the PREFERRED_VERSION_udev must be overidden.

To correct this in the build/conf/local.conf I have changed

PREFERRED_VERSION_udev = "141" to PREFERRED_VERSION_udev_local = "141" (see discussion about it here http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg08995.html)

hybrid?01 February 2011, 11:12

hello, I've replaced rootfs with my own based on busybox only and trying to make "hello world" qt app. While QEngineer is still able refresh screen and show its first screen my cannot. The screen driver is the "transformed" but without any "qbook"

amh?08 October 2014, 13:30

I am able to compile and run programs with the 'gcc-arm-linux-gnueabi' package from Ubuntu/Mint (I am not using Qt though). This seems to be by far the easiest way to get started developing for the Oyo.

Add Comment 
Sign as Author