# [FE training-materials-updates] Update the libusb lab

Maxime Ripard maxime.ripard at free-electrons.com
Fri Aug 30 16:47:02 CEST 2013

Repository : git://git.free-electrons.com/training-materials.git

On branch  : jelly-bean

>---------------------------------------------------------------

Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date:   Fri Aug 30 13:45:45 2013 +0200

Update the libusb lab

Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>

>---------------------------------------------------------------

.../android-native-library.tex                     |   36 +++++++++++++++++---
1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/labs/android-native-library/android-native-library.tex b/labs/android-native-library/android-native-library.tex
index a7b1203..865a140 100644
--- a/labs/android-native-library/android-native-library.tex
+++ b/labs/android-native-library/android-native-library.tex
@@ -9,9 +9,30 @@ After this lab, you will be able to

\section{Build a shared library}

-To get the libusb source code, go to \url{http://libusb.org} and
-\code{external/libusb} folder.
+The Android team already has put the libusb source code, but for some
+reason isn't actually using it or made a Makefile for it. Since we
+need a more recent version anyway, we will need to edit the manifest
+
+Edit the file \code{.repo/manifest.xml}. This is the manifest
+currently used by repo. As you can see, it holds the git repositories
+of every pieces assembled to form the Android source code.
+
+The first step will be to add a remote git server to the list of those
+availables to \code{repo}.
+
+\begin{verbatim}
+<remote fetch="git://libusb.org" name="libusb" />
+\end{verbatim}
+
+Then, go to the line that defines the libusb project, and edit it to
+specify that you want to use the remote we just defined (using the
+\code{remote} attribute), that we want to use the version 1.0.9, that
+is in git \code{refs/tags/1.0.9} (using the \code{revision} XML
+attribute), and change the value of the name attribute to
+\code{libusb}.
+

For this library, all the needed \code{.c} files are located in the
\code{libusb} folder and its subfolders. The headers are located in
@@ -29,7 +50,14 @@ systems. You will have to generate it by yourself, by running the
\code{configure} script \footnote{You can have some hints about the
available options available by passing the \code{--help} argument to
\code{configure}} that you can find in the \code{libusb} source
-code.
+code. The git repository doesn't have this \code{configure} script
+however. This script is also usually generated through the
+\code{autogen.sh} script that you'll find in the sources.
+
+To be able to use this script, we will need to install the packages
+\code{libtool} and \code{automake}. Once installed, you can generate
+the configure script using \code{./autogen.sh}. It should also