1Add options to enable/disable docs and demos
2
3Originally written by Anthony Viallard
4<viallard@syscom-instruments.com>.
5
6Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7[Vincent: adapt patch to 5.0.5 version]
8Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
9[Michael: adapt patch to 5.4.0 version]
10Signed-off-by: Michael Fischer <mf@go-sys.de>
11[Michael: adapt patch to 6.0.0 version]
12Signed-off-by: Michael Fischer <mf@go-sys.de>
13
14--- a/configure.ac	2023-12-19 00:28:58.000000000 +0100
15+++ b/configure.ac	2024-05-13 15:41:18.313920528 +0200
16@@ -715,6 +715,32 @@
17
18 dnl Process rest of with and enable options
19
20+dnl Whether we want to build the doc files
21+dnl Does nothing here, is passed on to the doc subdir
22+AC_ARG_ENABLE(doc,dnl
23+[  --disable-doc    do not build doc files])
24+dnl build doc files
25+if test "$enable_doc" != no; then
26+  AC_CONFIG_SUBDIRS(docs)
27+  DOCSUBDIR=docs
28+else
29+  DOCSUBDIR=
30+fi
31+AC_SUBST(DOCSUBDIR)
32+
33+dnl Whether we want to build the demo files
34+dnl Does nothing here, is passed on to the demo subdir
35+AC_ARG_ENABLE(demo,dnl
36+[  --disable-demo    do not build demo files])
37+dnl build demo files
38+if test "$enable_demo" != no; then
39+  AC_CONFIG_SUBDIRS(demo)
40+  DEMOSUBDIR=demo
41+else
42+  DEMOSUBDIR=
43+fi
44+AC_SUBST(DEMOSUBDIR)
45+
46 dnl without-extra-coordinate may leave a hole in "struct coordinate"
47 AC_ARG_WITH(extra-coordinate,dnl
48 [  --without-extra-coordinate    leave possible hole in struct coordinate],,)
49--- a/Makefile.am	2023-12-19 00:28:58.000000000 +0100
50+++ b/Makefile.am	2024-05-13 15:54:21.189906680 +0200
51@@ -1,7 +1,7 @@
52 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
53 AUTOMAKE_OPTIONS = foreign
54
55-SUBDIRS = config m4 term src docs man demo share
56+SUBDIRS = config m4 term src $(DOCSUBDIR) man $(DEMOSUBDIR) share
57
58 EXTRA_DIST = BUGS Copyright FAQ.pdf INSTALL INSTALL.gnu \
59 PATCHLEVEL PGPKEYS README RELEASE_NOTES \
60