summaryrefslogtreecommitdiff
blob: bb1e000460a5192109a59f14e8b1ce79d0bbed6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
From cfc56fa6a5809c2dbc7276df3579836e586d9193 Mon Sep 17 00:00:00 2001
From: William Breathitt Gray <vilhelm.gray@gmail.com>
Date: Tue, 23 Jun 2020 12:56:01 -0400
Subject: [PATCH] Introduce configure options for bash-completion, doc, fonts,
 and icons

This patch introduces the --enable-bash-completion, --enable-doc,
--enable-fonts, and --enable-icons configuration options to control the
build of bash-completion, documentation, fonts, and icons respectively.
This is useful for users of systems such as Gentoo which allow custom
configuration of packages, or for package maintainers in general who
would like finer control over the components built when compiling
Chocolate Doom.
---
 Makefile.am                     |  2 +-
 configure.ac                    | 49 ++++++++++++++++++++++++++++++++-
 man/Makefile.am                 |  2 +-
 man/bash-completion/Makefile.am |  2 +-
 src/Makefile.am                 |  2 +-
 src/setup/Makefile.am           |  2 +-
 textscreen/fonts/Makefile.am    |  2 +-
 7 files changed, 54 insertions(+), 7 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1bd91a43..70f2e5b9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,7 +50,7 @@ SUBDIRS=textscreen midiproc opl pcsound data src man
 
 DIST_SUBDIRS=pkg $(SUBDIRS)
 
-if HAVE_PYTHON
+if HAVE_DOC
 
 INSTALL : man/INSTALL.template man/simplecpp
 	./man/simplecpp -DDOOM -DHERETIC -DHEXEN -DSTRIFE \
diff --git a/configure.ac b/configure.ac
index 8e18a0e9..9bef517a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,50 @@ PKG_CHECK_MODULES(SDL, [sdl2 >= 2.0.1])
 PKG_CHECK_MODULES(SDLMIXER, [SDL2_mixer >= 2.0.0])
 PKG_CHECK_MODULES(SDLNET, [SDL2_net >= 2.0.0])
 
+# Check for bash-completion.
+AC_ARG_ENABLE([bash-completion],
+AS_HELP_STRING([--disable-bash-completion], [Disable bash-completion])
+)
+AS_IF([test "x$enable_bash_completion" != xno], [
+    AS_IF([test HAVE_PYTHON = false], [
+        AC_MSG_WARN([Building bash-completion requires Python, but Python not found])
+        enable_bash_completion=no
+    ])
+])
+
+# Check for doc.
+AC_ARG_ENABLE([doc],
+AS_HELP_STRING([--disable-doc], [Disable documentation])
+)
+AS_IF([test "x$enable_doc" != xno], [
+    AS_IF([test HAVE_PYTHON = false], [
+        AC_MSG_WARN([Building documentation requires Python, but Python not found])
+        enable_doc=no
+    ])
+])
+
+# Check for fonts.
+AC_ARG_ENABLE([fonts],
+AS_HELP_STRING([--disable-fonts], [Disable fonts])
+)
+AS_IF([test "x$enable_fonts" != xno], [
+    AS_IF([test HAVE_PYTHON = false], [
+        AC_MSG_WARN([Building fonts require Python, but Python not found])
+        enable_fonts=no
+    ])
+])
+
+# Check for icons.
+AC_ARG_ENABLE([icons],
+AS_HELP_STRING([--disable-icons], [Disable icons])
+)
+AS_IF([test "x$enable_icons" != xno], [
+    AS_IF([test HAVE_PYTHON = false], [
+        AC_MSG_WARN([Building icons require Python, but Python not found])
+        enable_icons=no
+    ])
+])
+
 # Check for libsamplerate.
 AC_ARG_WITH([libsamplerate],
 AS_HELP_STRING([--without-libsamplerate],
@@ -106,7 +150,10 @@ AS_IF([test "x$enable_werror" = "xyes"], [
 ])
 
 AM_CONDITIONAL(HAVE_WINDRES, test "$WINDRES" != "")
-AM_CONDITIONAL(HAVE_PYTHON, $HAVE_PYTHON)
+AM_CONDITIONAL(HAVE_BASH_COMPLETION, [test "x$enable_bash_completion" != xno])
+AM_CONDITIONAL(HAVE_DOC, [test "x$enable_doc" != xno])
+AM_CONDITIONAL(HAVE_FONTS, [test "x$enable_fonts" != xno])
+AM_CONDITIONAL(HAVE_ICONS, [test "x$enable_icons" != xno])
 
 dnl Automake v1.8.0 is required, please upgrade!
 
diff --git a/man/Makefile.am b/man/Makefile.am
index 915cb206..5a886fc9 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -15,7 +15,7 @@ hereticdocsdir = ${docdir}/../${PROGRAM_PREFIX}heretic
 hexendocsdir = ${docdir}/../${PROGRAM_PREFIX}hexen
 strifedocsdir = ${docdir}/../${PROGRAM_PREFIX}strife
 
-if HAVE_PYTHON
+if HAVE_DOC
 
 GENERATED_MAN_PAGES =               \
            @PROGRAM_PREFIX@doom.6         \
diff --git a/man/bash-completion/Makefile.am b/man/bash-completion/Makefile.am
index 9c1400f1..a79fe623 100644
--- a/man/bash-completion/Makefile.am
+++ b/man/bash-completion/Makefile.am
@@ -6,7 +6,7 @@ BASH_COMPLETION_TEMPLATES = \
     hexen.template \
     strife.template
 
-if HAVE_PYTHON
+if HAVE_BASH_COMPLETION
 
 BASH_COMPLETION_SCRIPTLETS = \
     @PROGRAM_PREFIX@doom \
diff --git a/src/Makefile.am b/src/Makefile.am
index 19a42598..698d2ce0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -271,7 +271,7 @@ CLEANFILES = $(execgames_SCRIPTS) $(app_DATA) $(screensaver_DATA)
 %.o : %.rc
 	$(WINDRES) $< -o $@
 
-if HAVE_PYTHON
+if HAVE_ICONS
 
 icon.c : $(top_builddir)/data/doom.png
 	$(top_builddir)/data/convert-icon $(top_builddir)/data/doom.png $@
diff --git a/src/setup/Makefile.am b/src/setup/Makefile.am
index a9dd240c..493b0b47 100644
--- a/src/setup/Makefile.am
+++ b/src/setup/Makefile.am
@@ -33,7 +33,7 @@ CLEANFILES = $(app_DATA)
 @PACKAGE_RDNS@.Setup.desktop : Setup.desktop
 	cp Setup.desktop $@
 
-if HAVE_PYTHON
+if HAVE_ICONS
 
 setup_icon.c : $(top_builddir)/data/setup.png
 	$(top_builddir)/data/convert-icon $(top_builddir)/data/setup.png $@
diff --git a/textscreen/fonts/Makefile.am b/textscreen/fonts/Makefile.am
index 67ae8a21..5f6ad066 100644
--- a/textscreen/fonts/Makefile.am
+++ b/textscreen/fonts/Makefile.am
@@ -3,7 +3,7 @@ EXTRA_DIST = small.png normal.png large.png convert-font $(FONT_HDRS)
 
 noinst_DATA = $(FONT_HDRS)
 
-if HAVE_PYTHON
+if HAVE_FONTS
 
 small.h: small.png convert-font
 	./convert-font small small.png small.h
-- 
2.26.2