1From b89b8475a5b2f9444c32f7d254b35968da3c8a23 Mon Sep 17 00:00:00 2001
2From: "Yann E. MORIN" <yann.morin.1998@free.fr>
3Date: Fri, 29 Sep 2017 18:03:51 +0200
4Subject: [PATCH] build: make it possible to disable the build of the
5 documentation
6
7When targetting embedded evices, the documentation is not needed.
8
9Building the documentation default to whether the program is built.
10
11Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
12Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
13---
14 Makefile.am  | 8 +++++++-
15 configure.ac | 6 ++++++
16 2 files changed, 13 insertions(+), 1 deletion(-)
17
18diff --git a/Makefile.am b/Makefile.am
19index fce30b2..ee75b64 100644
20--- a/Makefile.am
21+++ b/Makefile.am
22@@ -41,9 +41,15 @@ EXTRA_DIST = \
23 	.indent.pro \
24 	autogen.sh
25
26+MAYBE_SUBDIRS =
27+
28+if ENABLE_DOC
29+MAYBE_SUBDIRS += doc
30+endif
31+
32 SUBDIRS = \
33 	src \
34-	doc \
35+	$(MAYBE_SUBDIRS) \
36 	examples \
37 	po \
38 	tests \
39diff --git a/configure.ac b/configure.ac
40index c54e98f..b3ae450 100644
41--- a/configure.ac
42+++ b/configure.ac
43@@ -80,6 +80,12 @@ AC_ARG_ENABLE([program],
44   [], [enable_program=yes])
45 AM_CONDITIONAL([ENABLE_PROGRAM], [test "x$enable_program" = xyes])
46
47+AC_ARG_ENABLE([doc],
48+  [AS_HELP_STRING([--disable-doc],
49+                  [do not build the documentation])],
50+  [], [enable_doc=${enable_program}])
51+AM_CONDITIONAL([ENABLE_DOC], [test "x$enable_doc" = xyes -a "x$enable_program" = xyes])
52+
53 # --disable-bootstrap is intended only to workaround problems with bootstrap
54 # (e.g. when cross-compiling flex or when bootstrapping has bugs).
55 # Ideally we should be able to bootstrap even when cross-compiling.
56--
572.11.0
58
59