m (BlueZ)
Line 3: Line 3:
 
== Prerequisites ==
 
== Prerequisites ==
  
=== ZLib ===
+
=== zlib ===
  
=== Libffi ===
+
[http://www.zlib.net/ zlib] is a compression library and a prerequisite for building GLib.
  
[https://sourceware.org/libffi/ libffi] is the Portable Foreign Function Interface Library. It is an interface that allows code written in one language to call code written in another language.  
+
Download, cross compile and install the zlib compression libraries. Configure doesn't accept the --host parameter (reports unknown option), so you need to hack the makefile.
 +
 
 +
<PRE>
 +
wget http://zlib.net/zlib-1.2.8.tar.gz
 +
tar -xzf zlib-1.2.8.tar.gz
 +
cd zlib-1.2.8/
 +
./configure --prefix=/usr/arm-linux-gnueabi
 +
</PRE>
 +
 
 +
Edit the makefile and prefix the build tools with arm-linux-gnueabi-.
 +
 
 +
<PRE>
 +
CC=arm-linux-gnueabi-gcc
 +
LDSHARED=arm-linux-gnueabi-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map
 +
CPP=arm-linux-gnueabi-gcc -E
 +
AR=arm-linux-gnueabi-ar
 +
RANLIB=arm-linux-gnueabi-ranlib
 +
</PRE>
 +
 
 +
Make and install:
 +
 
 +
<PRE>
 +
make
 +
make install
 +
</PRE>
 +
 
 +
=== libffi ===
 +
 
 +
[https://sourceware.org/libffi/ libffi] is the Portable Foreign Function Interface Library and is a prerequisite for building GLib. It is an interface that allows code written in one language to call code written in another language.  
 +
 
 +
Download, build and install:
  
 
<PRE>
 
<PRE>
Line 21: Line 51:
  
 
[http://www.gtk.org/download/linux.php GLib] is part of the [http://www.gtk.org/ GTK+ Project]
 
[http://www.gtk.org/download/linux.php GLib] is part of the [http://www.gtk.org/ GTK+ Project]
 +
 +
GLib requires zlib, libffi and glibc >= 2.18 to successfully build. If you are building on ubuntu 14.04, the arm-linux-gnueabi should come installed with glibc 2.19 hence we don't rebuild it.
 +
 +
To build Glib, download, build and install:
  
 
<PRE>
 
<PRE>
Line 48: Line 82:
 
=== D-Bus ===
 
=== D-Bus ===
  
[http://www.freedesktop.org/wiki/Software/dbus/ D-Bus] is a message bus system.
+
[http://www.freedesktop.org/wiki/Software/dbus/ D-Bus] is a message bus system. It requires the expat library to successfully build.
  
 
Download, build and install:
 
Download, build and install:
Line 60: Line 94:
 
make install
 
make install
 
</PRE>
 
</PRE>
 
  
 
== BlueZ ==
 
== BlueZ ==

Revision as of 13:12, 27 April 2014


Prerequisites

zlib

zlib is a compression library and a prerequisite for building GLib.

Download, cross compile and install the zlib compression libraries. Configure doesn't accept the --host parameter (reports unknown option), so you need to hack the makefile.

wget http://zlib.net/zlib-1.2.8.tar.gz
tar -xzf zlib-1.2.8.tar.gz
cd zlib-1.2.8/
./configure --prefix=/usr/arm-linux-gnueabi 

Edit the makefile and prefix the build tools with arm-linux-gnueabi-.

CC=arm-linux-gnueabi-gcc
LDSHARED=arm-linux-gnueabi-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map
CPP=arm-linux-gnueabi-gcc -E
AR=arm-linux-gnueabi-ar
RANLIB=arm-linux-gnueabi-ranlib

Make and install:

make
make install

libffi

libffi is the Portable Foreign Function Interface Library and is a prerequisite for building GLib. It is an interface that allows code written in one language to call code written in another language.

Download, build and install:

wget ftp://sourceware.org/pub/libffi/libffi-3.0.13.tar.gz
tar -xzf libffi-3.0.13.tar.gz
cd libffi-3.0.13/
./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi  
make
make install

GLib

GLib is part of the GTK+ Project

GLib requires zlib, libffi and glibc >= 2.18 to successfully build. If you are building on ubuntu 14.04, the arm-linux-gnueabi should come installed with glibc 2.19 hence we don't rebuild it.

To build Glib, download, build and install:

wget http://ftp.gnome.org/pub/gnome/sources/glib/2.40/glib-2.40.0.tar.xz
tar -xJf glib-2.40.0.tar.xz
cd glib-2.40.0
./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi PKG_CONFIG_PATH=/usr/arm-linux-gnueabi/lib/pkgconfig  glib_cv_stack_grows=no glib_cv_uscore=yes ac_cv_func_posix_getpwuid_r=yes ac_cv_func_posix_getgrgid_r=yes 
make
make install

The Expat XML Parser

Expat is an XML parser library written in C and is the only required dependency for the D-Bus daemon.

Download, build and install:

wget http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz
tar -xzf expat-2.1.0.tar.gz 
cd expat-2.1.0/
./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi
make
make install

D-Bus

D-Bus is a message bus system. It requires the expat library to successfully build.

Download, build and install:

wget http://dbus.freedesktop.org/releases/dbus/dbus-1.8.0.tar.gz
tar -xzf dbus-1.8.0.tar.gz
cd dbus-1.8.0/
./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi
make
make install

BlueZ

BlueZ is the official Bluetooth protocol stack for Linux and include tools such as hciattach, hciconfig, hcitool and rfcomm.

BlueZ 5.18 requires GLib >= 2.28, D-Bus >= 1.6 and libudev >= 143. When these prerequisites are meet, you can download, build and install BlueZ using:

wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.18.tar.xz
tar -xJf bluez-5.18.tar.xz
cd bluez-5.18
./configure --host=arm-linux-gnueabi --prefix= PKG_CONFIG_PATH=/usr/arm-linux-gnueabi/lib/pkgconfig 
make
make install