diff options
author | 2021-11-16 09:49:49 -0300 | |
---|---|---|
committer | 2021-11-25 11:32:07 -0300 | |
commit | 36058bc54a059cd63bd4ce94b680f5f8c1441c92 (patch) | |
tree | 00dec7d656b03bf455e827b2468cb4e252354f49 /configure.ac | |
parent | configure*: Add missing quotes to arguments (diff) | |
download | firejail-36058bc54a059cd63bd4ce94b680f5f8c1441c92.tar.gz firejail-36058bc54a059cd63bd4ce94b680f5f8c1441c92.tar.zst firejail-36058bc54a059cd63bd4ce94b680f5f8c1441c92.zip |
configure*: Move AC_SUBST calls to more obvious places
These macros should always be called regardless of the intended value of
each variable, as even if e.g.: no --enable-apparmor flag is given, the
configure script still has to substitute `@HAVE_APPARMOR@` with blank in
the relevant files.
Something similar is already being done for HAVE_OVERLAYFS since commit
fb9f2a5fb ("disabled overlayfs, fixes pending; added video channels to
README* files", 2021-02-06).
Note that each AC_SUBST is not immediately converted into search/replace
code when generating the configure script. It appears that the
variables are handled only after parsing all of configure.ac (or until a
specific command is found), as all arguments passed to every AC_SUBST
call are defined at once on the `ac_subst_vars` list. The actual
substitutions are also done all at once (while iterating through the
list) and that happens much later in the script (see both occurrences of
`ac_subs_vars` on the current script).
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac index 3f3d41bb9..20b60b522 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -57,22 +57,22 @@ AS_IF([test "x$enable_sanitizer" != "xno" ], | |||
57 | )]) | 57 | )]) |
58 | 58 | ||
59 | HAVE_APPARMOR="" | 59 | HAVE_APPARMOR="" |
60 | AC_SUBST([HAVE_APPARMOR]) | ||
60 | AC_ARG_ENABLE([apparmor], | 61 | AC_ARG_ENABLE([apparmor], |
61 | [AS_HELP_STRING([--enable-apparmor], [enable apparmor])]) | 62 | [AS_HELP_STRING([--enable-apparmor], [enable apparmor])]) |
62 | AS_IF([test "x$enable_apparmor" = "xyes"], [ | 63 | AS_IF([test "x$enable_apparmor" = "xyes"], [ |
63 | HAVE_APPARMOR="-DHAVE_APPARMOR" | 64 | HAVE_APPARMOR="-DHAVE_APPARMOR" |
64 | PKG_CHECK_MODULES([AA], [libapparmor], | 65 | PKG_CHECK_MODULES([AA], [libapparmor], |
65 | [EXTRA_CFLAGS="$EXTRA_CFLAGS $AA_CFLAGS" && EXTRA_LDFLAGS="$EXTRA_LDFLAGS $AA_LIBS"]) | 66 | [EXTRA_CFLAGS="$EXTRA_CFLAGS $AA_CFLAGS" && EXTRA_LDFLAGS="$EXTRA_LDFLAGS $AA_LIBS"]) |
66 | AC_SUBST([HAVE_APPARMOR]) | ||
67 | ]) | 67 | ]) |
68 | 68 | ||
69 | HAVE_SELINUX="" | 69 | HAVE_SELINUX="" |
70 | AC_SUBST([HAVE_SELINUX]) | ||
70 | AC_ARG_ENABLE([selinux], | 71 | AC_ARG_ENABLE([selinux], |
71 | [AS_HELP_STRING([--enable-selinux], [SELinux labeling support])]) | 72 | [AS_HELP_STRING([--enable-selinux], [SELinux labeling support])]) |
72 | AS_IF([test "x$enable_selinux" = "xyes"], [ | 73 | AS_IF([test "x$enable_selinux" = "xyes"], [ |
73 | HAVE_SELINUX="-DHAVE_SELINUX" | 74 | HAVE_SELINUX="-DHAVE_SELINUX" |
74 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lselinux" | 75 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lselinux" |
75 | AC_SUBST([HAVE_SELINUX]) | ||
76 | ]) | 76 | ]) |
77 | 77 | ||
78 | AC_SUBST([EXTRA_CFLAGS]) | 78 | AC_SUBST([EXTRA_CFLAGS]) |
@@ -80,173 +80,171 @@ AC_SUBST([EXTRA_LDFLAGS]) | |||
80 | 80 | ||
81 | 81 | ||
82 | HAVE_DBUSPROXY="" | 82 | HAVE_DBUSPROXY="" |
83 | AC_SUBST([HAVE_DBUSPROXY]) | ||
83 | AC_ARG_ENABLE([dbusproxy], | 84 | AC_ARG_ENABLE([dbusproxy], |
84 | [AS_HELP_STRING([--disable-dbusproxy], [disable dbus proxy])]) | 85 | [AS_HELP_STRING([--disable-dbusproxy], [disable dbus proxy])]) |
85 | AS_IF([test "x$enable_dbusproxy" != "xno"], [ | 86 | AS_IF([test "x$enable_dbusproxy" != "xno"], [ |
86 | HAVE_DBUSPROXY="-DHAVE_DBUSPROXY" | 87 | HAVE_DBUSPROXY="-DHAVE_DBUSPROXY" |
87 | AC_SUBST([HAVE_DBUSPROXY]) | ||
88 | ]) | 88 | ]) |
89 | 89 | ||
90 | # overlayfs features temporarily disabled pending fixes | 90 | # overlayfs features temporarily disabled pending fixes |
91 | HAVE_OVERLAYFS="" | 91 | HAVE_OVERLAYFS="" |
92 | AC_SUBST([HAVE_OVERLAYFS]) | 92 | AC_SUBST([HAVE_OVERLAYFS]) |
93 | # | ||
94 | #AC_ARG_ENABLE([overlayfs], | 93 | #AC_ARG_ENABLE([overlayfs], |
95 | # [AS_HELP_STRING([--disable-overlayfs], [disable overlayfs])]) | 94 | # [AS_HELP_STRING([--disable-overlayfs], [disable overlayfs])]) |
96 | #AS_IF([test "x$enable_overlayfs" != "xno"], [ | 95 | #AS_IF([test "x$enable_overlayfs" != "xno"], [ |
97 | # HAVE_OVERLAYFS="-DHAVE_OVERLAYFS" | 96 | # HAVE_OVERLAYFS="-DHAVE_OVERLAYFS" |
98 | # AC_SUBST([HAVE_OVERLAYFS]) | ||
99 | #]) | 97 | #]) |
100 | 98 | ||
101 | HAVE_OUTPUT="" | 99 | HAVE_OUTPUT="" |
100 | AC_SUBST([HAVE_OUTPUT]) | ||
102 | AC_ARG_ENABLE([output], | 101 | AC_ARG_ENABLE([output], |
103 | [AS_HELP_STRING([--disable-output], [disable --output logging])]) | 102 | [AS_HELP_STRING([--disable-output], [disable --output logging])]) |
104 | AS_IF([test "x$enable_output" != "xno"], [ | 103 | AS_IF([test "x$enable_output" != "xno"], [ |
105 | HAVE_OUTPUT="-DHAVE_OUTPUT" | 104 | HAVE_OUTPUT="-DHAVE_OUTPUT" |
106 | AC_SUBST([HAVE_OUTPUT]) | ||
107 | ]) | 105 | ]) |
108 | 106 | ||
109 | HAVE_USERTMPFS="" | 107 | HAVE_USERTMPFS="" |
108 | AC_SUBST([HAVE_USERTMPFS]) | ||
110 | AC_ARG_ENABLE([usertmpfs], | 109 | AC_ARG_ENABLE([usertmpfs], |
111 | [AS_HELP_STRING([--disable-usertmpfs], [disable tmpfs as regular user])]) | 110 | [AS_HELP_STRING([--disable-usertmpfs], [disable tmpfs as regular user])]) |
112 | AS_IF([test "x$enable_usertmpfs" != "xno"], [ | 111 | AS_IF([test "x$enable_usertmpfs" != "xno"], [ |
113 | HAVE_USERTMPFS="-DHAVE_USERTMPFS" | 112 | HAVE_USERTMPFS="-DHAVE_USERTMPFS" |
114 | AC_SUBST([HAVE_USERTMPFS]) | ||
115 | ]) | 113 | ]) |
116 | 114 | ||
117 | HAVE_MAN="no" | 115 | HAVE_MAN="no" |
116 | AC_SUBST([HAVE_MAN]) | ||
118 | AC_ARG_ENABLE([man], | 117 | AC_ARG_ENABLE([man], |
119 | [AS_HELP_STRING([--disable-man], [disable man pages])]) | 118 | [AS_HELP_STRING([--disable-man], [disable man pages])]) |
120 | AS_IF([test "x$enable_man" != "xno"], [ | 119 | AS_IF([test "x$enable_man" != "xno"], [ |
121 | HAVE_MAN="-DHAVE_MAN" | 120 | HAVE_MAN="-DHAVE_MAN" |
122 | AC_SUBST([HAVE_MAN]) | ||
123 | AC_CHECK_PROG([HAVE_GAWK], [gawk], [yes], [no]) | 121 | AC_CHECK_PROG([HAVE_GAWK], [gawk], [yes], [no]) |
124 | AS_IF([test "x$HAVE_GAWK" != "xyes"], [AC_MSG_ERROR([*** gawk not found ***])]) | 122 | AS_IF([test "x$HAVE_GAWK" != "xyes"], [AC_MSG_ERROR([*** gawk not found ***])]) |
125 | ]) | 123 | ]) |
126 | 124 | ||
127 | HAVE_FIRETUNNEL="" | 125 | HAVE_FIRETUNNEL="" |
126 | AC_SUBST([HAVE_FIRETUNNEL]) | ||
128 | AC_ARG_ENABLE([firetunnel], | 127 | AC_ARG_ENABLE([firetunnel], |
129 | [AS_HELP_STRING([--disable-firetunnel], [disable firetunnel])]) | 128 | [AS_HELP_STRING([--disable-firetunnel], [disable firetunnel])]) |
130 | AS_IF([test "x$enable_firetunnel" != "xno"], [ | 129 | AS_IF([test "x$enable_firetunnel" != "xno"], [ |
131 | HAVE_FIRETUNNEL="-DHAVE_FIRETUNNEL" | 130 | HAVE_FIRETUNNEL="-DHAVE_FIRETUNNEL" |
132 | AC_SUBST([HAVE_FIRETUNNEL]) | ||
133 | ]) | 131 | ]) |
134 | 132 | ||
135 | HAVE_PRIVATEHOME="" | 133 | HAVE_PRIVATEHOME="" |
134 | AC_SUBST([HAVE_PRIVATE_HOME]) | ||
136 | AC_ARG_ENABLE([private-home], | 135 | AC_ARG_ENABLE([private-home], |
137 | [AS_HELP_STRING([--disable-private-home], [disable private home feature])]) | 136 | [AS_HELP_STRING([--disable-private-home], [disable private home feature])]) |
138 | AS_IF([test "x$enable_private_home" != "xno"], [ | 137 | AS_IF([test "x$enable_private_home" != "xno"], [ |
139 | HAVE_PRIVATE_HOME="-DHAVE_PRIVATE_HOME" | 138 | HAVE_PRIVATE_HOME="-DHAVE_PRIVATE_HOME" |
140 | AC_SUBST([HAVE_PRIVATE_HOME]) | ||
141 | ]) | 139 | ]) |
142 | 140 | ||
143 | HAVE_CHROOT="" | 141 | HAVE_CHROOT="" |
142 | AC_SUBST([HAVE_CHROOT]) | ||
144 | AC_ARG_ENABLE([chroot], | 143 | AC_ARG_ENABLE([chroot], |
145 | [AS_HELP_STRING([--disable-chroot], [disable chroot])]) | 144 | [AS_HELP_STRING([--disable-chroot], [disable chroot])]) |
146 | AS_IF([test "x$enable_chroot" != "xno"], [ | 145 | AS_IF([test "x$enable_chroot" != "xno"], [ |
147 | HAVE_CHROOT="-DHAVE_CHROOT" | 146 | HAVE_CHROOT="-DHAVE_CHROOT" |
148 | AC_SUBST([HAVE_CHROOT]) | ||
149 | ]) | 147 | ]) |
150 | 148 | ||
151 | HAVE_GLOBALCFG="" | 149 | HAVE_GLOBALCFG="" |
150 | AC_SUBST([HAVE_GLOBALCFG]) | ||
152 | AC_ARG_ENABLE([globalcfg], | 151 | AC_ARG_ENABLE([globalcfg], |
153 | [AS_HELP_STRING([--disable-globalcfg], | 152 | [AS_HELP_STRING([--disable-globalcfg], |
154 | [if the global config file firejail.cfg is not present, continue the program using defaults])]) | 153 | [if the global config file firejail.cfg is not present, continue the program using defaults])]) |
155 | AS_IF([test "x$enable_globalcfg" != "xno"], [ | 154 | AS_IF([test "x$enable_globalcfg" != "xno"], [ |
156 | HAVE_GLOBALCFG="-DHAVE_GLOBALCFG" | 155 | HAVE_GLOBALCFG="-DHAVE_GLOBALCFG" |
157 | AC_SUBST([HAVE_GLOBALCFG]) | ||
158 | ]) | 156 | ]) |
159 | 157 | ||
160 | HAVE_NETWORK="" | 158 | HAVE_NETWORK="" |
159 | AC_SUBST([HAVE_NETWORK]) | ||
161 | AC_ARG_ENABLE([network], | 160 | AC_ARG_ENABLE([network], |
162 | [AS_HELP_STRING([--disable-network], [disable network])]) | 161 | [AS_HELP_STRING([--disable-network], [disable network])]) |
163 | AS_IF([test "x$enable_network" != "xno"], [ | 162 | AS_IF([test "x$enable_network" != "xno"], [ |
164 | HAVE_NETWORK="-DHAVE_NETWORK" | 163 | HAVE_NETWORK="-DHAVE_NETWORK" |
165 | AC_SUBST([HAVE_NETWORK]) | ||
166 | ]) | 164 | ]) |
167 | 165 | ||
168 | HAVE_USERNS="" | 166 | HAVE_USERNS="" |
167 | AC_SUBST([HAVE_USERNS]) | ||
169 | AC_ARG_ENABLE([userns], | 168 | AC_ARG_ENABLE([userns], |
170 | [AS_HELP_STRING([--disable-userns], [disable user namespace])]) | 169 | [AS_HELP_STRING([--disable-userns], [disable user namespace])]) |
171 | AS_IF([test "x$enable_userns" != "xno"], [ | 170 | AS_IF([test "x$enable_userns" != "xno"], [ |
172 | HAVE_USERNS="-DHAVE_USERNS" | 171 | HAVE_USERNS="-DHAVE_USERNS" |
173 | AC_SUBST([HAVE_USERNS]) | ||
174 | ]) | 172 | ]) |
175 | 173 | ||
176 | HAVE_X11="" | 174 | HAVE_X11="" |
175 | AC_SUBST([HAVE_X11]) | ||
177 | AC_ARG_ENABLE([x11], | 176 | AC_ARG_ENABLE([x11], |
178 | [AS_HELP_STRING([--disable-x11], [disable X11 sandboxing support])]) | 177 | [AS_HELP_STRING([--disable-x11], [disable X11 sandboxing support])]) |
179 | AS_IF([test "x$enable_x11" != "xno"], [ | 178 | AS_IF([test "x$enable_x11" != "xno"], [ |
180 | HAVE_X11="-DHAVE_X11" | 179 | HAVE_X11="-DHAVE_X11" |
181 | AC_SUBST([HAVE_X11]) | ||
182 | ]) | 180 | ]) |
183 | 181 | ||
184 | HAVE_FILE_TRANSFER="" | 182 | HAVE_FILE_TRANSFER="" |
183 | AC_SUBST([HAVE_FILE_TRANSFER]) | ||
185 | AC_ARG_ENABLE([file-transfer], | 184 | AC_ARG_ENABLE([file-transfer], |
186 | [AS_HELP_STRING([--disable-file-transfer], [disable file transfer])]) | 185 | [AS_HELP_STRING([--disable-file-transfer], [disable file transfer])]) |
187 | AS_IF([test "x$enable_file_transfer" != "xno"], [ | 186 | AS_IF([test "x$enable_file_transfer" != "xno"], [ |
188 | HAVE_FILE_TRANSFER="-DHAVE_FILE_TRANSFER" | 187 | HAVE_FILE_TRANSFER="-DHAVE_FILE_TRANSFER" |
189 | AC_SUBST([HAVE_FILE_TRANSFER]) | ||
190 | ]) | 188 | ]) |
191 | 189 | ||
192 | HAVE_SUID="" | 190 | HAVE_SUID="" |
191 | AC_SUBST([HAVE_SUID]) | ||
193 | AC_ARG_ENABLE([suid], | 192 | AC_ARG_ENABLE([suid], |
194 | [AS_HELP_STRING([--disable-suid], [install as a non-SUID executable])]) | 193 | [AS_HELP_STRING([--disable-suid], [install as a non-SUID executable])]) |
195 | AS_IF([test "x$enable_suid" = "xno"], | 194 | AS_IF([test "x$enable_suid" = "xno"], |
196 | [HAVE_SUID="no"], | 195 | [HAVE_SUID="no"], |
197 | [HAVE_SUID="yes"] | 196 | [HAVE_SUID="yes"] |
198 | ) | 197 | ) |
199 | AC_SUBST([HAVE_SUID]) | ||
200 | 198 | ||
201 | HAVE_FATAL_WARNINGS="" | 199 | HAVE_FATAL_WARNINGS="" |
200 | AC_SUBST([HAVE_FATAL_WARNINGS]) | ||
202 | AC_ARG_ENABLE([fatal_warnings], | 201 | AC_ARG_ENABLE([fatal_warnings], |
203 | [AS_HELP_STRING([--enable-fatal-warnings], [-W -Wall -Werror])]) | 202 | [AS_HELP_STRING([--enable-fatal-warnings], [-W -Wall -Werror])]) |
204 | AS_IF([test "x$enable_fatal_warnings" = "xyes"], [ | 203 | AS_IF([test "x$enable_fatal_warnings" = "xyes"], [ |
205 | HAVE_FATAL_WARNINGS="-W -Wall -Werror" | 204 | HAVE_FATAL_WARNINGS="-W -Wall -Werror" |
206 | AC_SUBST([HAVE_FATAL_WARNINGS]) | ||
207 | ]) | 205 | ]) |
208 | 206 | ||
209 | BUSYBOX_WORKAROUND="no" | 207 | BUSYBOX_WORKAROUND="no" |
208 | AC_SUBST([BUSYBOX_WORKAROUND]) | ||
210 | AC_ARG_ENABLE([busybox-workaround], | 209 | AC_ARG_ENABLE([busybox-workaround], |
211 | [AS_HELP_STRING([--enable-busybox-workaround], [enable busybox workaround])]) | 210 | [AS_HELP_STRING([--enable-busybox-workaround], [enable busybox workaround])]) |
212 | AS_IF([test "x$enable_busybox_workaround" = "xyes"], [ | 211 | AS_IF([test "x$enable_busybox_workaround" = "xyes"], [ |
213 | BUSYBOX_WORKAROUND="yes" | 212 | BUSYBOX_WORKAROUND="yes" |
214 | AC_SUBST([BUSYBOX_WORKAROUND]) | ||
215 | ]) | 213 | ]) |
216 | 214 | ||
217 | 215 | ||
218 | HAVE_GCOV="" | 216 | HAVE_GCOV="" |
217 | AC_SUBST([HAVE_GCOV]) | ||
219 | AC_ARG_ENABLE([gcov], | 218 | AC_ARG_ENABLE([gcov], |
220 | [AS_HELP_STRING([--enable-gcov], [Gcov instrumentation])]) | 219 | [AS_HELP_STRING([--enable-gcov], [Gcov instrumentation])]) |
221 | AS_IF([test "x$enable_gcov" = "xyes"], [ | 220 | AS_IF([test "x$enable_gcov" = "xyes"], [ |
222 | HAVE_GCOV="--coverage -DHAVE_GCOV" | 221 | HAVE_GCOV="--coverage -DHAVE_GCOV" |
223 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lgcov --coverage" | 222 | EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lgcov --coverage" |
224 | AC_SUBST([HAVE_GCOV]) | ||
225 | ]) | 223 | ]) |
226 | 224 | ||
227 | HAVE_CONTRIB_INSTALL="yes" | 225 | HAVE_CONTRIB_INSTALL="yes" |
226 | AC_SUBST([HAVE_CONTRIB_INSTALL]) | ||
228 | AC_ARG_ENABLE([contrib-install], | 227 | AC_ARG_ENABLE([contrib-install], |
229 | [AS_HELP_STRING([--enable-contrib-install], [install contrib scripts])]) | 228 | [AS_HELP_STRING([--enable-contrib-install], [install contrib scripts])]) |
230 | AS_IF([test "x$enable_contrib_install" = "xno"], | 229 | AS_IF([test "x$enable_contrib_install" = "xno"], |
231 | [HAVE_CONTRIB_INSTALL="no"], | 230 | [HAVE_CONTRIB_INSTALL="no"], |
232 | [HAVE_CONTRIB_INSTALL="yes"] | 231 | [HAVE_CONTRIB_INSTALL="yes"] |
233 | ) | 232 | ) |
234 | AC_SUBST([HAVE_CONTRIB_INSTALL]) | ||
235 | 233 | ||
236 | HAVE_FORCE_NONEWPRIVS="" | 234 | HAVE_FORCE_NONEWPRIVS="" |
235 | AC_SUBST([HAVE_FORCE_NONEWPRIVS]) | ||
237 | AC_ARG_ENABLE([force-nonewprivs], | 236 | AC_ARG_ENABLE([force-nonewprivs], |
238 | [AS_HELP_STRING([--enable-force-nonewprivs], [enable force nonewprivs])]) | 237 | [AS_HELP_STRING([--enable-force-nonewprivs], [enable force nonewprivs])]) |
239 | AS_IF([test "x$enable_force_nonewprivs" = "xyes"], [ | 238 | AS_IF([test "x$enable_force_nonewprivs" = "xyes"], [ |
240 | HAVE_FORCE_NONEWPRIVS="-DHAVE_FORCE_NONEWPRIVS" | 239 | HAVE_FORCE_NONEWPRIVS="-DHAVE_FORCE_NONEWPRIVS" |
241 | AC_SUBST([HAVE_FORCE_NONEWPRIVS]) | ||
242 | ]) | 240 | ]) |
243 | 241 | ||
244 | HAVE_LTS="" | 242 | HAVE_LTS="" |
243 | AC_SUBST([HAVE_LTS]) | ||
245 | AC_ARG_ENABLE([lts], | 244 | AC_ARG_ENABLE([lts], |
246 | [AS_HELP_STRING([--enable-lts], [enable long-term support software version (LTS)])]) | 245 | [AS_HELP_STRING([--enable-lts], [enable long-term support software version (LTS)])]) |
247 | AS_IF([test "x$enable_lts" = "xyes"], [ | 246 | AS_IF([test "x$enable_lts" = "xyes"], [ |
248 | HAVE_LTS="-DHAVE_LTS" | 247 | HAVE_LTS="-DHAVE_LTS" |
249 | AC_SUBST([HAVE_LTS]) | ||
250 | 248 | ||
251 | HAVE_DBUSPROXY="" | 249 | HAVE_DBUSPROXY="" |
252 | AC_SUBST([HAVE_DBUSPROXY]) | 250 | AC_SUBST([HAVE_DBUSPROXY]) |