# [FE training-materials-updates] Remove the static libusb generation

Maxime Ripard maxime.ripard at free-electrons.com
Thu Mar 21 16:50:34 CET 2013

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

On branch  : various-fixes

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

commit 5759017960e4119a46c0edf2f32852e4e78daff5
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date:   Thu Mar 21 11:26:39 2013 +0100

Remove the static libusb generation

Most of the time, it only confuses people because we never actually use
the static libusb, it never gets included in the image and some of
their errors only show up when we build a shared library.

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

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

5759017960e4119a46c0edf2f32852e4e78daff5
.../android-native-library.tex                     |   21 ++++++--------------
1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/labs/android-native-library/android-native-library.tex b/labs/android-native-library/android-native-library.tex
index 7bb9957..77df6b9 100644
--- a/labs/android-native-library/android-native-library.tex
+++ b/labs/android-native-library/android-native-library.tex
@@ -3,11 +3,11 @@
After this lab, you will be able to
\begin{itemize}
\item Add an external library to the Android build system
-  \item Compile it statically and dynamically
+  \item Compile it dynamically
\item Add a component to a build
\end{itemize}

-\section{Building a static library}
+\section{Build a shared library}

To get the libusb source code, go to \url{http://libusb.org} and
@@ -15,8 +15,7 @@ download version 1.0.9. Extract the archive in the

For this library, all the needed \code{.c} files are located in the
\code{libusb} folder and its subfolders. The headers are located in
-the same folders. Make the build system generate a
-\code{libusb-static.a} file.
+the same folders. You shouldn't modify the \code{libusb} source code.

You will find one missing header that you will need to
generate. Indeed, the \code{config.h} generated by autoconf is not
@@ -30,19 +29,11 @@ code.
If successful, the build system should go through the build process
and you should have a directory generated in the \code{out} directory.

-\section{Building a shared library}
-
-Now, we will need to build a shared library along with the static one,
-called \code{libusb.so}. Use the same \code{config.h} and modify the
-\code{Android.mk} file so that it gets compiled. Then, check that the
-shared object is present in the \code{out} folder.
-
\section{Integrate the library into the Android image}

As you can see, your library has been compiled during the build
process, but if you boot the generated image or look inside the
-\code{out/target/product/training/system/lib} folder, you can see that
-the shared object is not present.
+folder, you can see that the shared object is not present.

-Modify the appropriate files so that in the images, you will have the
-two variants of the library we compiled.
+Modify the appropriate files so that the library gets included in your
+image.