This document shows how to cross-compile bluez for another processor. date/version: 01 Feb. 2005, v0.2 author: Marco Trudel If you need help, please use the bluez-user list. If you have improvements or hints, do not hesitate to contact the autor. This howto has been testet for: i686 -> arm ------------------------------------------------------------ Ensure that the crosscompile binaries are in $PATH. For example, do: export PATH="$PATH:/thePathToYourCrossCompiler/bin" Please note: The term DESTDIR will be used in the following commands. This is the directory where bluez will be installed to. Replace it, for example, with /opt/bluez or /tmp/bluez. ########## 1. compile bluez-libs ########## - extract bluez-libs and change into the directory - configure the makefiles for cross-compiling: ./configure --build=i686-pc-linux-gnu \ --host=arm-linux \ --prefix=DESTDIR \ [--sysconfdir=DESTDIR/etc] - Explanation of the switches: --build The build platform (as example a i686). --host The target platform (as example arm-linux). Please change it to match your target-system. --prefix Where bluez will be installed to. --sysconfdir Where bluez will expect etc. You can remove this switch if /etc is ok for you. - Check the output. Some interesting lines: checking for arm-linux-gcc... arm-linux-gcc checking whether the C compiler works... yes checking whether we are cross compiling... yes - run "make", "make install" ########## 2. compile bluez-utils ########## - extract bluez-utils and change into the directory - configure the makefiles for cross-compiling. run: ./configure --build=i686-pc-linux-gnu \ --host=arm-linux \ --prefix=DESTDIR \ [--sysconfdir=DESTDIR/etc \] LDFLAGS=-LDESTDIR/lib - LDFLAGS is where the bluez lib will be searched for. (Please note that -L is needed. For example LDFLAGS=-L/opt/bluez/lib) - run "make" and "make install" ######### 3. final steps, tests ########## Please note: This mini-howto assumes you have a bluetooth enabled kernel. If you haven't already, install it now. Depending on your setup, you might be interested in every kb of diskspace to save. With -s stripping and removing of unnecessary files, it's possible to save ~350kb... copy DESTDIR to your target platform. on your target platform: - add "DESTDIR/lib" to /etc/ld.so.conf and, run "ldconfig" - run "./hcid -n" in DESTDIR/sbin Check the output. If everything works well, abort hcid and start it withhout "-n". - "DESTDIR/bin/hcitool dev" should show you your devices - "DESTDIR/bin/hcitool scan" perform an inquiry scan