[FE training-materials-updates] Explain how to define values and macros in gcc with -D

Maxime Ripard maxime.ripard at free-electrons.com
Fri Mar 22 15:55:19 CET 2013

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

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=7b8e6c9045bd9c962724493036dca4b890191144


commit 7b8e6c9045bd9c962724493036dca4b890191144
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date:   Fri Mar 22 15:17:40 2013 +0100

    Explain how to define values and macros in gcc with -D
    Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>


 .../android-native-library.tex                     |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/labs/android-native-library/android-native-library.tex b/labs/android-native-library/android-native-library.tex
index 1368515..a7b1203 100644
--- a/labs/android-native-library/android-native-library.tex
+++ b/labs/android-native-library/android-native-library.tex
@@ -31,6 +31,13 @@ systems. You will have to generate it by yourself, by running the
   \code{configure}} that you can find in the \code{libusb} source
+Along the building process, you might need to define values in the
+source code. We prefer to avoid modifying directly the source code,
+since it will end up in merging problems in the future if we ever want
+to upgrade that component. \code{gcc} accepts on its command line the
+\code{-D} argument, that you can use either to define a value
+(\code{-DFOOBAR=42}) or a macro (\code{-D'FOO(bar)=(bar * 42)'}).
 If successful, the build system should go through the build process
 and you should have a directory generated in the \code{out} directory.

More information about the training-materials-updates mailing list