]> git.ipfire.org Git - thirdparty/systemd.git/blob - configure.ac
Merge pull request #5706 from keszybz/make-cleanups
[thirdparty/systemd.git] / configure.ac
1 #
2 # This file is part of systemd.
3 #
4 # Copyright 2010-2012 Lennart Poettering
5 # Copyright 2010-2012 Kay Sievers
6 #
7 # systemd is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as published by
9 # the Free Software Foundation; either version 2.1 of the License, or
10 # (at your option) any later version.
11 #
12 # systemd is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
19
20 AC_PREREQ([2.64])
21
22 AC_INIT([systemd],
23 [233],
24 [https://github.com/systemd/systemd/issues],
25 [systemd],
26 [https://www.freedesktop.org/wiki/Software/systemd])
27
28 AC_CONFIG_SRCDIR([src/core/main.c])
29 AC_CONFIG_MACRO_DIR([m4])
30 AC_CONFIG_HEADERS([config.h])
31 AC_CONFIG_AUX_DIR([build-aux])
32
33 AC_USE_SYSTEM_EXTENSIONS
34 AC_SYS_LARGEFILE
35 AC_PREFIX_DEFAULT([/usr])
36 AM_MAINTAINER_MODE([enable])
37 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests])
38 AM_SILENT_RULES([yes])
39 AC_CANONICAL_HOST
40 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
41
42 AC_PROG_CC_C99
43
44 AX_COMPILER_VENDOR
45 AS_IF([test "x$ax_cv_c_compiler_vendor" = "xgnu"], [
46 AC_CHECK_TOOLS([AR], [gcc-ar ar], [:])
47 AC_CHECK_TOOLS([NM], [gcc-nm nm], [:])
48 AC_CHECK_TOOLS([RANLIB], [gcc-ranlib ranlib], [:])
49 ])
50
51 LT_PREREQ(2.2)
52 LT_INIT([disable-static])
53
54 AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by systemd])])
55 AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by systemd])])
56
57 SET_ARCH(X86_64, x86_64*)
58 SET_ARCH(IA32, i*86*)
59 SET_ARCH(MIPS, mips*)
60 SET_ARCH(AARCH64, aarch64*)
61
62 # i18n stuff for the PolicyKit policy files, heck whether intltool can be found, disable NLS otherwise
63 AC_CHECK_PROG(intltool_found, [intltool-merge], [yes], [no])
64 AS_IF([test x"$intltool_found" != xyes],
65 [AS_IF([test x"$enable_nls" = xyes],
66 [AC_MSG_ERROR([--enable-nls requested but intltool not found])],
67 [AS_IF([test x"$enable_nls" != xno],
68 [AC_MSG_WARN([*** Disabling NLS support because intltool was not found])
69 enable_nls=no])
70 ])
71 ])
72
73 AM_NLS
74 AS_IF([test x"$enable_nls" != xno -o "x$enable_polkit" != xno], [
75 # intltoolize greps for '^(AC|IT)_PROG_INTLTOOL', so it needs to be on its own line
76 IT_PROG_INTLTOOL([0.40.0])
77 ])
78
79 AS_IF([test -z "$INTLTOOL_POLICY_RULE"], [
80 # If intltool is not available, provide a dummy rule to fail generation of %.policy files with a meaningful error message
81 INTLTOOL_POLICY_RULE='%.policy: %.policy.in ; @echo " ITMRG " $@ && echo "*** intltool support required to build target $@" && false'
82 AC_SUBST(INTLTOOL_POLICY_RULE)
83 ])
84
85 GETTEXT_PACKAGE=systemd
86 AC_SUBST(GETTEXT_PACKAGE)
87 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [systemd])
88
89 AC_PROG_MKDIR_P
90 AC_PROG_LN_S
91 AC_PROG_SED
92 AC_PROG_GREP
93 AC_PROG_AWK
94
95 AC_PATH_PROG([M4], [m4])
96
97 AC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon], [$PATH:/usr/sbin:/sbin])
98 AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck], [$PATH:/usr/sbin:/sbin])
99
100 AC_PATH_PROG([KILL], [kill], [/usr/bin/kill], [$PATH:/usr/sbin:/sbin])
101
102 AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin])
103
104 AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
105
106 AC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin])
107
108 AC_PATH_PROG([MOUNT_PATH], [mount], [/usr/bin/mount], [$PATH:/usr/sbin:/sbin])
109 AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin])
110
111 AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
112
113 M4_DEFINES=
114
115 AC_CHECK_TOOL(OBJCOPY, objcopy)
116 AC_CHECK_TOOL(STRINGS, strings)
117 AC_CHECK_TOOL(GPERF, gperf)
118 if test -z "$GPERF" ; then
119 AC_MSG_ERROR([*** gperf not found])
120 fi
121
122 # ------------------------------------------------------------------------------
123 address_sanitizer_cflags=
124 address_sanitizer_cppflags=
125 address_sanitizer_ldflags=
126 AC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
127 AS_IF([test "x$enable_address_sanitizer" = "xyes"], [
128 CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
129 AS_IF([test -z "$with_as_cflags"],
130 [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
131 address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
132 address_sanitizer_cppflags="-DVALGRIND=1"
133 address_sanitizer_ldflags="-Wc,-fsanitize=address"
134 ])
135
136 undefined_sanitizer_cflags=
137 undefined_sanitizer_cppflags=
138 undefined_sanitizer_ldflags=
139 AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
140 AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
141 CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
142 AS_IF([test -z "$with_us_cflags"],
143 [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
144 undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
145 undefined_sanitizer_cppflags="-DVALGRIND=1"
146 undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
147 ])
148
149 sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
150 sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
151 sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
152
153 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
154 -pipe \
155 -Wall \
156 -Wextra \
157 -Wundef \
158 -Wlogical-op \
159 -Wmissing-include-dirs \
160 -Wold-style-definition \
161 -Wpointer-arith \
162 -Winit-self \
163 -Wdeclaration-after-statement \
164 -Wfloat-equal \
165 -Wsuggest-attribute=noreturn \
166 -Werror=missing-prototypes \
167 -Werror=implicit-function-declaration \
168 -Werror=missing-declarations \
169 -Werror=return-type \
170 -Werror=incompatible-pointer-types \
171 -Werror=format=2 \
172 -Wstrict-prototypes \
173 -Wredundant-decls \
174 -Wmissing-noreturn \
175 -Wshadow \
176 -Wendif-labels \
177 -Wstrict-aliasing=2 \
178 -Wwrite-strings \
179 -Wno-unused-parameter \
180 -Wno-missing-field-initializers \
181 -Wno-unused-result \
182 -Wno-format-signedness \
183 -Werror=overflow \
184 -Wdate-time \
185 -Wnested-externs \
186 -ffast-math \
187 -fno-common \
188 -fdiagnostics-show-option \
189 -fno-strict-aliasing \
190 -fvisibility=hidden \
191 -fstack-protector \
192 -fstack-protector-strong \
193 -fPIE \
194 --param=ssp-buffer-size=4])
195
196 CC_CHECK_FLAG_APPEND([with_cflags], [CFLAGS], [-Werror=shadow], [
197 #include <time.h>
198 #include <inttypes.h>
199 typedef uint64_t usec_t;
200 usec_t now(clockid_t clock);
201 int main(void) {
202 struct timespec now;
203 return 0;
204 }
205 ])
206
207 AS_CASE([$CC], [*clang*],
208 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
209 -Wno-typedef-redefinition \
210 -Wno-gnu-variable-sized-type-not-at-end \
211 ])])
212
213 AC_ARG_ENABLE([lto], [AS_HELP_STRING([--disable-lto], [disable -flto])],
214 [], [enable_lto=yes])
215 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
216 [AS_IF([test "x$enable_lto" = "xyes"],
217 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-flto])],
218 [AC_MSG_RESULT([disabling -flto as requested])])],
219 [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
220
221 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
222 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
223 -Wp,-D_FORTIFY_SOURCE=2])],
224 [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
225
226 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
227 [CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
228 -Wl,--gc-sections])],
229 [AC_MSG_RESULT([skipping --gc-sections, optimization not enabled])])
230
231 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
232 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
233 -ffunction-sections -fdata-sections])],
234 [AC_MSG_RESULT([skipping -ffunction/data-section, optimization not enabled])])
235
236 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
237 -Wl,--as-needed \
238 -Wl,--no-undefined \
239 -Wl,-z,relro \
240 -Wl,-z,now \
241 -pie \
242 -Wl,-fuse-ld=gold])
243
244 AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
245 AC_SUBST([OUR_CFLAGS], "-D__SANE_USERSPACE_TYPES__ $with_cflags $sanitizer_cflags")
246 AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
247
248 AC_CHECK_SIZEOF(pid_t)
249 AC_CHECK_SIZEOF(uid_t)
250 AC_CHECK_SIZEOF(gid_t)
251 AC_CHECK_SIZEOF(time_t)
252 AC_CHECK_SIZEOF(dev_t)
253 AC_CHECK_SIZEOF(ino_t)
254 AC_CHECK_SIZEOF(rlim_t,,[
255 #include <sys/time.h>
256 #include <sys/resource.h>
257 ])
258
259 GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
260
261 AC_COMPILE_IFELSE(
262 [AC_LANG_PROGRAM([
263 #include <string.h>
264 const char * in_word_set(const char *, size_t);
265 $GPERF_TEST]
266 )],
267 [GPERF_LEN_TYPE=size_t],
268 [AC_COMPILE_IFELSE(
269 [AC_LANG_PROGRAM([
270 #include <string.h>
271 const char * in_word_set(const char *, unsigned);
272 $GPERF_TEST]
273 )],
274 [GPERF_LEN_TYPE=unsigned],
275 [AC_MSG_ERROR([** unable to determine gperf len type])]
276 )]
277 )
278
279 AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
280
281 # ------------------------------------------------------------------------------
282 # we use python to build the man page index
283 have_python=no
284 AC_ARG_WITH([python],
285 [AS_HELP_STRING([--without-python], [disable building the man page index and systemd-python (default: test)])])
286
287 have_lxml=no
288 AS_IF([test "x$with_python" != "xno"], [
289 AM_PATH_PYTHON([3],, [:])
290 AS_IF([test "x$PYTHON" != "x:"], [
291 AC_MSG_CHECKING([for python lxml module])
292 AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
293 AC_MSG_RESULT([$have_lxml])
294 AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
295 [AC_MSG_WARN([*** python support requires python-lxml module installed])])
296 ])
297 ])
298 AS_IF([test "$have_python" != "yes"], [
299 AS_IF([test "$with_python" = "yes"],
300 [AC_MSG_ERROR([*** python support requested but python support not found])])
301 AS_IF([test "$with_python" != "no"],
302 [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
303 ])
304 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
305
306 # ------------------------------------------------------------------------------
307
308 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
309 AC_CHECK_HEADERS([linux/btrfs.h], [], [])
310 AC_CHECK_HEADERS([linux/memfd.h], [], [])
311 AC_CHECK_HEADERS([linux/vm_sockets.h], [], [], [#include <sys/socket.h>])
312
313 # unconditionally pull-in librt with old glibc versions
314 AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
315
316 save_LIBS="$LIBS"
317 LIBS=
318 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
319 CAP_LIBS="$LIBS"
320 LIBS="$save_LIBS"
321 AC_SUBST(CAP_LIBS)
322
323 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
324 AC_CHECK_DECLS([
325 memfd_create,
326 gettid,
327 pivot_root,
328 name_to_handle_at,
329 setns,
330 getrandom,
331 renameat2,
332 kcmp,
333 keyctl,
334 LO_FLAGS_PARTSCAN,
335 copy_file_range,
336 explicit_bzero],
337 [], [], [[
338 #include <sys/types.h>
339 #include <unistd.h>
340 #include <sys/mount.h>
341 #include <fcntl.h>
342 #include <sched.h>
343 #include <string.h>
344 #include <linux/loop.h>
345 #include <linux/random.h>
346 ]])
347
348 AC_CHECK_TYPES([char16_t, char32_t, key_serial_t, struct ethtool_link_settings],
349 [], [], [[
350 #include <uchar.h>
351 #include <linux/ethtool.h>
352 ]])
353
354 AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
355 IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
356 IFLA_VRF_TABLE,
357 IFLA_MACVLAN_FLAGS,
358 IFLA_IPVLAN_MODE,
359 IFLA_VTI_REMOTE,
360 IFLA_PHYS_PORT_ID,
361 IFLA_BOND_AD_INFO,
362 IFLA_VLAN_PROTOCOL,
363 IFLA_VXLAN_GPE,
364 IFLA_IPTUN_ENCAP_DPORT,
365 IFLA_GRE_ENCAP_DPORT,
366 IFLA_BRIDGE_VLAN_INFO,
367 IFLA_BRPORT_PROXYARP,
368 IFLA_BRPORT_LEARNING_SYNC,
369 IFLA_BR_VLAN_DEFAULT_PVID,
370 NDA_IFINDEX,
371 IFA_FLAGS],
372 [], [], [[
373 #include <inttypes.h>
374 #include <netinet/in.h>
375 #include <netinet/ether.h>
376 #include <linux/rtnetlink.h>
377 #include <net/if.h>
378 #include <linux/ip.h>
379 #include <linux/if_tunnel.h>
380 #include <linux/if_link.h>
381 #include <linux/if_bridge.h>
382 #include <linux/if_addr.h>
383 #include <linux/neighbour.h>
384 ]])
385
386 # This makes sure pkg.m4 is available.
387 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
388
389 # ------------------------------------------------------------------------------
390 have_dbus=no
391 AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
392 AS_IF([test "x$enable_dbus" != "xno"], [
393 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2],
394 [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes],
395 [have_dbus=no])
396 AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"],
397 [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])])
398 AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
399
400 # ------------------------------------------------------------------------------
401 have_utmp=yes
402 AC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log handling]),
403 AS_CASE("x${enableval}",
404 [xyes], [have_utmp=yes],
405 [xno], [have_utmp=no],
406 AC_MSG_ERROR(bad value ${enableval} for --enable-utmp)))
407 AS_IF([test "x$have_utmp" = "xyes"], [AC_DEFINE(HAVE_UTMP, 1, [Define if utmp/wtmp support is enabled])])
408 AM_CONDITIONAL([HAVE_UTMP], [test "x$have_utmp" = "xyes"])
409
410 # ------------------------------------------------------------------------------
411 have_coverage=no
412 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
413 if test "x$enable_coverage" = "xyes" ; then
414 AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
415 if test "x$lcov_found" = xno ; then
416 AC_MSG_ERROR([*** lcov support requested but the program was not found])
417 else
418 lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
419 lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
420 if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
421 AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
422 else
423 have_coverage=yes
424 CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
425 -fprofile-arcs \
426 -ftest-coverage])
427 AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
428 fi
429 fi
430 fi
431 AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
432
433 # ------------------------------------------------------------------------------
434 have_kmod=no
435 AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
436 if test "x$enable_kmod" != "xno"; then
437 PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
438 if test "x$have_kmod" = "xyes"; then
439 PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
440 [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
441 AC_MSG_ERROR([*** kmod version >= 15 not found]))
442 fi
443 if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
444 AC_MSG_ERROR([*** kmod support requested, but libraries not found])
445 fi
446 fi
447 AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
448
449 # ------------------------------------------------------------------------------
450 have_xkbcommon=no
451 AC_ARG_ENABLE(xkbcommon, AS_HELP_STRING([--disable-xkbcommon], [disable xkbcommon keymap support]))
452 if test "x$enable_xkbcommon" != "xno"; then
453 PKG_CHECK_MODULES(XKBCOMMON, [ xkbcommon >= 0.3.0 ],
454 [AC_DEFINE(HAVE_XKBCOMMON, 1, [Define if libxkbcommon is available]) have_xkbcommon=yes], have_xkbcommon=no)
455 if test "x$have_xkbcommon" = xno -a "x$enable_xkbcommon" = xyes; then
456 AC_MSG_ERROR([*** xkbcommon support requested but libraries not found])
457 fi
458 fi
459 AM_CONDITIONAL(HAVE_XKBCOMMON, [test "$have_xkbcommon" = "yes"])
460
461 # ------------------------------------------------------------------------------
462 have_blkid=no
463 AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
464 if test "x$enable_blkid" != "xno"; then
465 PKG_CHECK_MODULES(BLKID, [ blkid >= 2.24 ],
466 [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
467 if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
468 AC_MSG_ERROR([*** blkid support requested but libraries not found])
469 fi
470 fi
471 AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
472
473 # ------------------------------------------------------------------------------
474 have_libmount=no
475 PKG_CHECK_MODULES(MOUNT, [ mount >= 2.27 ],
476 [AC_DEFINE(HAVE_LIBMOUNT, 1, [Define if libmount is available]) have_libmount=yes], have_libmount=no)
477 if test "x$have_libmount" = xno; then
478 AC_MSG_ERROR([*** libmount support required but libraries not found])
479 fi
480 AM_CONDITIONAL(HAVE_LIBMOUNT, [test "$have_libmount" = "yes"])
481
482 # ------------------------------------------------------------------------------
483 have_seccomp=no
484 AC_ARG_ENABLE(seccomp, AS_HELP_STRING([--disable-seccomp], [disable optional SECCOMP support]))
485 if test "x$enable_seccomp" != "xno"; then
486 PKG_CHECK_MODULES(SECCOMP, [libseccomp >= 2.3.1],
487 [AC_DEFINE(HAVE_SECCOMP, 1, [Define if seccomp is available])
488 have_seccomp=yes
489 M4_DEFINES="$M4_DEFINES -DHAVE_SECCOMP"],
490 [have_seccomp=no])
491 if test "x$have_seccomp" = "xno" -a "x$enable_seccomp" = "xyes"; then
492 AC_MSG_ERROR([*** seccomp support requested but libraries not found])
493 fi
494 fi
495 AM_CONDITIONAL(HAVE_SECCOMP, [test "$have_seccomp" = "yes"])
496
497 # ------------------------------------------------------------------------------
498 have_ima=yes
499 AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima], [disable optional IMA support]),
500 [case "${enableval}" in
501 yes) have_ima=yes ;;
502 no) have_ima=no ;;
503 *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
504 esac],
505 [have_ima=yes])
506
507 if test "x${have_ima}" != xno ; then
508 AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
509 fi
510
511 # ------------------------------------------------------------------------------
512 have_selinux=no
513 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [disable optional SELINUX support]))
514 if test "x$enable_selinux" != "xno"; then
515 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
516 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
517 have_selinux=yes
518 M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
519 [have_selinux=no])
520 if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
521 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
522 fi
523 fi
524 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
525
526 have_apparmor=no
527 AC_ARG_ENABLE(apparmor, AS_HELP_STRING([--disable-apparmor], [disable optional AppArmor support]))
528 if test "x$enable_apparmor" != "xno"; then
529 PKG_CHECK_MODULES([APPARMOR], [libapparmor],
530 [AC_DEFINE(HAVE_APPARMOR, 1, [Define if AppArmor is available])
531 have_apparmor=yes
532 M4_DEFINES="$M4_DEFINES -DHAVE_APPARMOR"],
533 [have_apparmor=no])
534 if test "x$have_apparmor" = xno -a "x$enable_apparmor" = xyes; then
535 AC_MSG_ERROR([*** AppArmor support requested but libraries not found])
536 fi
537 fi
538 AM_CONDITIONAL(HAVE_APPARMOR, [test "$have_apparmor" = "yes"])
539
540 have_adm_group=no
541 AC_ARG_ENABLE(adm-group, AS_HELP_STRING([--disable-adm-group], [disable adm group]))
542 AS_IF([test "x$enable_adm_group" != "xno"], [
543 AC_DEFINE(ENABLE_ADM_GROUP, 1, [Define if the ACL for adm group should be enabled])
544 have_adm_group=yes
545 M4_DEFINES="$M4_DEFINES -DENABLE_ADM_GROUP"
546 ])
547
548 have_wheel_group=no
549 AC_ARG_ENABLE(wheel-group, AS_HELP_STRING([--disable-wheel-group], [disable wheel group]))
550 AS_IF([test "x$enable_wheel_group" != "xno"], [
551 AC_DEFINE(ENABLE_WHEEL_GROUP, 1, [Define if the ACL for wheel group should be enabled])
552 have_wheel_group=yes
553 M4_DEFINES="$M4_DEFINES -DENABLE_WHEEL_GROUP"
554 ])
555
556
557 AC_ARG_WITH(debug-shell,
558 AS_HELP_STRING([--with-debug-shell=PATH],
559 [path to debug shell binary]),
560 [SUSHELL="$withval"],
561 [SUSHELL="/bin/sh"])
562
563 AC_SUBST(SUSHELL)
564
565 AC_ARG_WITH([debug-tty],
566 AS_HELP_STRING([--with-debug-tty=PATH],
567 [specify the tty device for debug shell]),
568 [DEBUGTTY="$withval"],
569 [DEBUGTTY=/dev/tty9])
570
571 AC_SUBST(DEBUGTTY)
572
573 AC_ARG_WITH([certificate-root],
574 AS_HELP_STRING([--with-certificate-root=PATH],
575 [specify the prefix for TLS certificates [/etc/ssl]]),
576 [CERTIFICATEROOT="$withval"],
577 [CERTIFICATEROOT="/etc/ssl"])
578
579 AC_SUBST(CERTIFICATEROOT)
580
581 AC_ARG_WITH([support-url],
582 AS_HELP_STRING([--with-support-url=URL],
583 [specify the support URL to show in catalog entries included in systemd]),
584 [SUPPORT_URL="$withval"],
585 [SUPPORT_URL=https://lists.freedesktop.org/mailman/listinfo/systemd-devel])
586
587 AC_SUBST(SUPPORT_URL)
588
589 AC_ARG_WITH([nobody-user],
590 AS_HELP_STRING([--with-nobody-user=NAME],
591 [specify the name of the nobody user (the one with UID 65534)]),
592 [NOBODY_USER_NAME="$withval"],
593 [NOBODY_USER_NAME=nobody])
594
595 AC_SUBST(NOBODY_USER_NAME)
596 AC_DEFINE_UNQUOTED(NOBODY_USER_NAME, ["$NOBODY_USER_NAME"], [The name of the nobody user (the one with UID 65534)])
597
598 AC_ARG_WITH([nobody-group],
599 AS_HELP_STRING([--with-nobody-group=NAME],
600 [specify the name of the nobody group (the one with GID 65534)]),
601 [NOBODY_GROUP_NAME="$withval"],
602 [NOBODY_GROUP_NAME=nobody])
603
604 AC_SUBST(NOBODY_GROUP_NAME)
605 AC_DEFINE_UNQUOTED(NOBODY_GROUP_NAME, ["$NOBODY_GROUP_NAME"], [The name of the nobody group (the one with GID 65534)])
606
607 AC_ARG_WITH([fallback-hostname],
608 AS_HELP_STRING([--with-fallback-hostname=NAME],
609 [specify the hostname used if none configured]),
610 [FALLBACK_HOSTNAME="$withval"],
611 [FALLBACK_HOSTNAME=localhost])
612
613 AC_SUBST(FALLBACK_HOSTNAME)
614 AC_DEFINE_UNQUOTED(FALLBACK_HOSTNAME, ["$FALLBACK_HOSTNAME"], [The hostname used if none configured])
615
616 # ------------------------------------------------------------------------------
617
618 AC_ARG_WITH(default-hierarchy,
619 AS_HELP_STRING([--with-default-hierarchy=MODE],
620 [default cgroup hierarchy, defaults to "hybrid"]),
621 [DEFAULT_HIERARCHY="$withval"],
622 [DEFAULT_HIERARCHY="hybrid"])
623
624 AS_CASE("$DEFAULT_HIERARCHY",
625 [legacy], [mode=CGROUP_UNIFIED_NONE],
626 [hybrid], [mode=CGROUP_UNIFIED_SYSTEMD],
627 [unified], [mode=CGROUP_UNIFIED_ALL],
628 AC_MSG_ERROR(Bad default hierarchy mode ${DEFAULT_HIERARCHY}))
629 AC_DEFINE_UNQUOTED(DEFAULT_HIERARCHY, [$mode], [Default cgroup hierarchy])
630 AC_DEFINE_UNQUOTED(DEFAULT_HIERARCHY_NAME, ["$DEFAULT_HIERARCHY"],
631 [Default cgroup hierarchy as string])
632
633 # ------------------------------------------------------------------------------
634 have_xz=no
635 AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [disable optional XZ support]))
636 AS_IF([test "x$enable_xz" != "xno"], [
637 PKG_CHECK_MODULES(XZ, [ liblzma ],
638 [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available])
639 have_xz=yes],
640 have_xz=no)
641 AS_IF([test "x$have_xz" = xno -a "x$enable_xz" = xyes],
642 [AC_MSG_ERROR([*** XZ support requested but libraries not found])])
643 ])
644 AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
645
646 # ------------------------------------------------------------------------------
647 have_zlib=no
648 AC_ARG_ENABLE(zlib, AS_HELP_STRING([--disable-zlib], [disable optional ZLIB support]))
649 AS_IF([test "x$enable_zlib" != "xno"], [
650 PKG_CHECK_MODULES(ZLIB, [ zlib ],
651 [AC_DEFINE(HAVE_ZLIB, 1, [Define if ZLIB is available])
652 have_zlib=yes],
653 have_zlib=no)
654 AS_IF([test "x$have_zlib" = xno -a "x$enable_zlib" = xyes],
655 [AC_MSG_ERROR([*** ZLIB support requested but libraries not found])])
656 ])
657 AM_CONDITIONAL(HAVE_ZLIB, [test "$have_zlib" = "yes"])
658
659 # ------------------------------------------------------------------------------
660 have_bzip2=no
661 AC_ARG_ENABLE(bzip2, AS_HELP_STRING([--disable-bzip2], [disable optional BZIP2 support]))
662 AS_IF([test "x$enable_bzip2" != "xno"], [
663 AC_CHECK_HEADERS(bzlib.h,
664 [AC_DEFINE(HAVE_BZIP2, 1, [Define if BZIP2 is available])
665 have_bzip2=yes],
666 [AS_IF([test "x$enable_bzip2" = xyes],
667 [AC_MSG_ERROR([*** BZIP2 support requested but headers not found])])]
668 )
669 ])
670 AM_CONDITIONAL(HAVE_BZIP2, [test "$have_bzip2" = "yes"])
671
672 # ------------------------------------------------------------------------------
673 have_lz4=no
674 AC_ARG_ENABLE(lz4, AS_HELP_STRING([--disable-lz4], [disable optional LZ4 support]))
675 AS_IF([test "x$enable_lz4" != "xno"], [
676 PKG_CHECK_MODULES(LZ4, [ liblz4 < 10 ],
677 [AC_DEFINE(HAVE_LZ4, 1, [Define if LZ4 is available])
678 have_lz4=yes],
679 [PKG_CHECK_MODULES(LZ4, [ liblz4 >= 125 ],
680 [AC_DEFINE(HAVE_LZ4, 1, [Define if LZ4 is available])
681 have_lz4=yes],
682 have_lz4=no)])
683 AS_IF([test "x$have_lz4" = xno -a "x$enable_lz4" = xyes],
684 [AC_MSG_ERROR([*** LZ4 support requested but libraries not found])])
685 ])
686 AM_CONDITIONAL(HAVE_LZ4, [test "$have_lz4" = "yes"])
687
688 AM_CONDITIONAL(HAVE_COMPRESSION, [test "$have_xz" = "yes" -o "$have_lz4" = "yes"])
689
690 # ------------------------------------------------------------------------------
691 AC_ARG_ENABLE([pam],
692 AS_HELP_STRING([--disable-pam], [disable optional PAM support]),
693 [case "${enableval}" in
694 yes) have_pam=yes ;;
695 no) have_pam=no ;;
696 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
697 esac],
698 [have_pam=auto])
699
700 if test "x${have_pam}" != xno ; then
701 AC_CHECK_HEADERS(
702 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
703 [have_pam=yes],
704 [if test "x$have_pam" = xyes ; then
705 AC_MSG_ERROR([*** PAM headers not found.])
706 fi])
707
708 AC_CHECK_LIB(
709 [pam],
710 [pam_syslog],
711 [have_pam=yes],
712 [if test "x$have_pam" = xyes ; then
713 AC_MSG_ERROR([*** libpam not found.])
714 fi])
715
716 if test "x$have_pam" = xyes ; then
717 PAM_LIBS="-lpam -lpam_misc"
718 AC_DEFINE(HAVE_PAM, 1, [PAM available])
719 M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
720 else
721 have_pam=no
722 fi
723 else
724 PAM_LIBS=
725 fi
726 AC_SUBST(PAM_LIBS)
727 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
728
729 # ------------------------------------------------------------------------------
730 AC_ARG_ENABLE([acl],
731 AS_HELP_STRING([--disable-acl], [disable optional ACL support]),
732 [case "${enableval}" in
733 yes) have_acl=yes ;;
734 no) have_acl=no ;;
735 *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
736 esac],
737 [have_acl=auto])
738
739 if test "x${have_acl}" != xno ; then
740 AC_CHECK_HEADERS(
741 [sys/acl.h acl/libacl.h],
742 [have_acl=yes],
743 [if test "x$have_acl" = xyes ; then
744 AC_MSG_ERROR([*** ACL headers not found.])
745 fi])
746
747 AC_CHECK_LIB(
748 [acl],
749 [acl_get_file],
750 [have_acl=yes],
751 [if test "x$have_acl" = xyes ; then
752 AC_MSG_ERROR([*** libacl not found.])
753 fi])
754
755 if test "x$have_acl" = xyes ; then
756 ACL_LIBS="-lacl"
757 AC_DEFINE(HAVE_ACL, 1, [ACL available])
758 M4_DEFINES="$M4_DEFINES -DHAVE_ACL"
759 else
760 have_acl=no
761 fi
762 else
763 ACL_LIBS=
764 fi
765 AC_SUBST(ACL_LIBS)
766 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
767
768 # ------------------------------------------------------------------------------
769 AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack], [disable optional SMACK support]),
770 [case "${enableval}" in
771 yes) have_smack=yes ;;
772 no) have_smack=no ;;
773 *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
774 esac],
775 [have_smack=auto])
776
777 if test "x${have_smack}" != xno; then
778 AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
779 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
780 have_smack=yes
781 fi
782
783 AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
784
785 have_smack_run_label=no
786 AC_ARG_WITH(smack-run-label,
787 AS_HELP_STRING([--with-smack-run-label=STRING],
788 [run systemd --system itself with a specific SMACK label]),
789 [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run systemd itself with SMACK label]) have_smack_run_label=yes],
790 [])
791
792 if test "x${have_smack_run_label}" = xyes; then
793 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK_RUN_LABEL"
794 fi
795
796 AC_ARG_WITH(smack-default-process-label,
797 AS_HELP_STRING([--with-smack-default-process-label=STRING],
798 [default SMACK label for executed processes]),
799 [AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
800 [])
801
802 # ------------------------------------------------------------------------------
803 AC_ARG_ENABLE([gcrypt],
804 AS_HELP_STRING([--disable-gcrypt], [disable optional GCRYPT support]),
805 [case "${enableval}" in
806 yes) have_gcrypt=yes ;;
807 no) have_gcrypt=no ;;
808 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
809 esac],
810 [have_gcrypt=auto])
811
812 if test "x${have_gcrypt}" != xno ; then
813 m4_define([AM_PATH_LIBGCRYPT_FAIL],
814 [{ test "x$have_gcrypt" != xyes || AC_MSG_ERROR([*** GCRYPT/GPG-ERROR headers not found.]); }]
815 )
816 m4_ifdef([AM_PATH_LIBGCRYPT], [AM_PATH_LIBGCRYPT(
817 [1.4.5],
818 [have_gcrypt=yes],
819 dnl If we have the gcrypt m4 macros, but don't have
820 dnl gcrypt, throw an error if gcrypt is explicitly
821 dnl requested.
822 [AM_PATH_LIBGCRYPT_FAIL]
823 )],
824 dnl If we don't have the gcrypt m4 macros, but build with
825 dnl gcrypt explicitly requested, throw an error.
826 [AM_PATH_LIBGCRYPT_FAIL]
827 )
828
829 have_gpg_error=no
830 m4_ifdef([AM_PATH_GPG_ERROR], [AM_PATH_GPG_ERROR(
831 [1.12],
832 [have_gpg_error=yes],
833 [AM_PATH_LIBGCRYPT_FAIL]
834 )],
835 [AM_PATH_LIBGCRYPT_FAIL]
836 )
837
838 if test "x$have_gcrypt" = xyes -a "x$have_gpg_error" = xyes ; then
839 GCRYPT_LIBS="$LIBGCRYPT_LIBS $GPG_ERROR_LIBS"
840 GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS $GPG_ERROR_CFLAGS"
841 AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
842 else
843 have_gcrypt=no
844 have_gpg_error=no
845 fi
846 else
847 GCRYPT_LIBS=
848 GCRYPT_CFLAGS=
849 fi
850 AC_SUBST(GCRYPT_LIBS)
851 AC_SUBST(GCRYPT_CFLAGS)
852 AM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
853
854 # ------------------------------------------------------------------------------
855 AC_ARG_ENABLE([audit],
856 AS_HELP_STRING([--disable-audit], [disable optional AUDIT support]),
857 [case "${enableval}" in
858 yes) have_audit=yes ;;
859 no) have_audit=no ;;
860 *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
861 esac],
862 [have_audit=auto])
863
864 if test "x${have_audit}" != xno ; then
865 AC_CHECK_HEADERS(
866 [libaudit.h],
867 [have_audit=yes],
868 [if test "x$have_audit" = xyes ; then
869 AC_MSG_ERROR([*** AUDIT headers not found.])
870 fi])
871
872 AC_CHECK_LIB(
873 [audit],
874 [audit_open],
875 [have_audit=yes],
876 [if test "x$have_audit" = xyes ; then
877 AC_MSG_ERROR([*** libaudit not found.])
878 fi])
879
880 if test "x$have_audit" = xyes ; then
881 AUDIT_LIBS="-laudit"
882 AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
883 else
884 have_audit=no
885 fi
886 else
887 AUDIT_LIBS=
888 fi
889 AC_SUBST(AUDIT_LIBS)
890 AM_CONDITIONAL([HAVE_AUDIT], [test "x$have_audit" != xno])
891
892 # ------------------------------------------------------------------------------
893 AC_ARG_ENABLE([elfutils],
894 AS_HELP_STRING([--disable-elfutils], [disable optional ELFUTILS support]),
895 [case "${enableval}" in
896 yes) have_elfutils=yes ;;
897 no) have_elfutils=no ;;
898 *) AC_MSG_ERROR(bad value ${enableval} for --disable-elfutils) ;;
899 esac],
900 [have_elfutils=auto])
901
902 if test "x${have_elfutils}" != xno ; then
903 AC_CHECK_HEADERS(
904 [elfutils/libdwfl.h],
905 [],
906 [if test "x$have_elfutils" = xyes ; then
907 AC_MSG_ERROR([*** ELFUTILS headers not found.])
908 fi])
909
910 AC_CHECK_LIB(
911 [dw],
912 [dwfl_core_file_attach],
913 [have_elfutils=yes],
914 [if test "x$have_elfutils" = xyes ; then
915 AC_MSG_ERROR([*** ELFUTILS >= 158 is required.])
916 fi])
917
918 if test "x$have_elfutils" = xyes ; then
919 ELFUTILS_LIBS="-lelf -ldw"
920 AC_DEFINE(HAVE_ELFUTILS, 1, [ELFUTILS available])
921 else
922 have_elfutils=no
923 fi
924 else
925 ELFUTILS_LIBS=
926 fi
927 AC_SUBST(ELFUTILS_LIBS)
928 AM_CONDITIONAL(HAVE_ELFUTILS, [test "$have_elfutils" = "yes"])
929
930 # ------------------------------------------------------------------------------
931 have_libcryptsetup=no
932 AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
933 if test "x$enable_libcryptsetup" != "xno"; then
934 PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.6.0 ],
935 [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
936 if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
937 AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
938 fi
939 fi
940 AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
941
942 # ------------------------------------------------------------------------------
943 have_qrencode=no
944 AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
945 if test "x$enable_qrencode" != "xno"; then
946 PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
947 [AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
948 if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
949 AC_MSG_ERROR([*** qrencode support requested but libraries not found])
950 fi
951 fi
952 AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
953
954 # ------------------------------------------------------------------------------
955 have_gnutls=no
956 AC_ARG_ENABLE(gnutls, AS_HELP_STRING([--disable-gnutls], [disable gnutls support]))
957 if test "x$enable_gnutls" != "xno"; then
958 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.1.4],
959 [AC_DEFINE(HAVE_GNUTLS, 1, [Define if gnutls is available]) have_gnutls=yes], have_gnutls=no)
960 if test "x$have_gnutls" = xno -a "x$enable_gnutls" = xyes; then
961 AC_MSG_ERROR([*** gnutls support requested but libraries not found])
962 fi
963 fi
964 AM_CONDITIONAL(HAVE_GNUTLS, [test "$have_gnutls" = "yes"])
965
966 # ------------------------------------------------------------------------------
967 have_microhttpd=no
968 AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
969 if test "x$enable_microhttpd" != "xno"; then
970 PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.33],
971 [AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available])
972 have_microhttpd=yes
973 M4_DEFINES="$M4_DEFINES -DHAVE_MICROHTTPD"],
974 [have_microhttpd=no])
975 if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
976 AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
977 fi
978 fi
979 AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
980
981 # ------------------------------------------------------------------------------
982 have_libcurl=no
983 AC_ARG_ENABLE(libcurl, AS_HELP_STRING([--disable-libcurl], [disable libcurl support]))
984 if test "x$enable_libcurl" != "xno"; then
985 PKG_CHECK_MODULES(LIBCURL, [libcurl >= 7.32.0],
986 [AC_DEFINE(HAVE_LIBCURL, 1, [Define if libcurl is available])
987 have_libcurl=yes
988 M4_DEFINES="$M4_DEFINES -DHAVE_LIBCURL"],
989 [have_libcurl=no])
990 if test "x$have_libcurl" = xno -a "x$enable_libcurl" = xyes; then
991 AC_MSG_ERROR([*** libcurl support requested but libraries not found])
992 fi
993 fi
994 AM_CONDITIONAL(HAVE_LIBCURL, [test "$have_libcurl" = "yes"])
995
996 # ------------------------------------------------------------------------------
997 AM_CONDITIONAL(HAVE_REMOTE, [test "$have_microhttpd" = "yes" -o "$have_libcurl" = "yes"])
998
999 # ------------------------------------------------------------------------------
1000 have_libidn=no
1001 AC_ARG_ENABLE(libidn, AS_HELP_STRING([--disable-libidn], [disable optional LIBIDN support]))
1002 if test "x$enable_libidn" != "xno"; then
1003 PKG_CHECK_MODULES(LIBIDN, [libidn],
1004 [AC_DEFINE(HAVE_LIBIDN, 1, [Define if libidn is available])
1005 have_libidn=yes
1006 M4_DEFINES="$M4_DEFINES -DHAVE_LIBIDN"],
1007 [have_libidn=no])
1008 if test "x$have_libidn" = "xno" -a "x$enable_libidn" = "xyes"; then
1009 AC_MSG_ERROR([*** libidn support requested but libraries not found])
1010 fi
1011 fi
1012 AM_CONDITIONAL(HAVE_LIBIDN, [test "$have_libidn" = "yes"])
1013
1014 # ------------------------------------------------------------------------------
1015 have_libiptc=no
1016 AC_ARG_ENABLE(libiptc, AS_HELP_STRING([--disable-libiptc], [disable optional LIBIPTC support]))
1017 if test "x$enable_libiptc" != "xno"; then
1018 PKG_CHECK_MODULES(LIBIPTC, [libiptc],
1019 [AC_DEFINE(HAVE_LIBIPTC, 1, [Define if libiptc is available])
1020 have_libiptc=yes
1021 M4_DEFINES="$M4_DEFINES -DHAVE_LIBIPTC"],
1022 [have_libiptc=no])
1023 if test "x$have_libiptc" = "xno" -a "x$enable_libiptc" = "xyes"; then
1024 AC_MSG_ERROR([*** libiptc support requested but libraries not found])
1025 fi
1026 fi
1027 AM_CONDITIONAL(HAVE_LIBIPTC, [test "$have_libiptc" = "yes"])
1028
1029 # ------------------------------------------------------------------------------
1030 have_binfmt=no
1031 AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
1032 if test "x$enable_binfmt" != "xno"; then
1033 have_binfmt=yes
1034 fi
1035 AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
1036
1037 # ------------------------------------------------------------------------------
1038 have_vconsole=no
1039 AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
1040 if test "x$enable_vconsole" != "xno"; then
1041 have_vconsole=yes
1042 fi
1043 AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
1044
1045 # ------------------------------------------------------------------------------
1046 have_quotacheck=no
1047 AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
1048 if test "x$enable_quotacheck" != "xno"; then
1049 have_quotacheck=yes
1050 fi
1051 AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
1052
1053 # ------------------------------------------------------------------------------
1054 have_tmpfiles=no
1055 AC_ARG_ENABLE(tmpfiles, AS_HELP_STRING([--disable-tmpfiles], [disable tmpfiles support]))
1056 if test "x$enable_tmpfiles" != "xno"; then
1057 have_tmpfiles=yes
1058 fi
1059 AM_CONDITIONAL(ENABLE_TMPFILES, [test "$have_tmpfiles" = "yes"])
1060
1061 # ------------------------------------------------------------------------------
1062 have_environment_d=no
1063 AC_ARG_ENABLE(environment-d, AS_HELP_STRING([--disable-environment-d], [disable environment.d support]))
1064 if test "x$enable_environment_d" != "xno"; then
1065 have_environment_d=yes
1066 fi
1067 AM_CONDITIONAL(ENABLE_ENVIRONMENT_D, [test "$have_environment_d" = "yes"])
1068
1069 # ------------------------------------------------------------------------------
1070 have_sysusers=no
1071 AC_ARG_ENABLE(sysusers, AS_HELP_STRING([--disable-sysusers], [disable sysusers support]))
1072 if test "x$enable_sysusers" != "xno"; then
1073 have_sysusers=yes
1074 fi
1075 AM_CONDITIONAL(ENABLE_SYSUSERS, [test "$have_sysusers" = "yes"])
1076
1077 # ------------------------------------------------------------------------------
1078 have_firstboot=no
1079 AC_ARG_ENABLE(firstboot, AS_HELP_STRING([--disable-firstboot], [disable firstboot support]))
1080 if test "x$enable_firstboot" != "xno"; then
1081 have_firstboot=yes
1082 fi
1083 AM_CONDITIONAL(ENABLE_FIRSTBOOT, [test "$have_firstboot" = "yes"])
1084
1085 # ------------------------------------------------------------------------------
1086 have_randomseed=no
1087 AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
1088 if test "x$enable_randomseed" != "xno"; then
1089 have_randomseed=yes
1090 fi
1091 AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
1092
1093 # ------------------------------------------------------------------------------
1094 have_backlight=no
1095 AC_ARG_ENABLE(backlight, AS_HELP_STRING([--disable-backlight], [disable backlight tools]))
1096 if test "x$enable_backlight" != "xno"; then
1097 have_backlight=yes
1098 fi
1099 AM_CONDITIONAL(ENABLE_BACKLIGHT, [test "$have_backlight" = "yes"])
1100
1101 # ------------------------------------------------------------------------------
1102 have_rfkill=no
1103 AC_ARG_ENABLE(rfkill, AS_HELP_STRING([--disable-rfkill], [disable rfkill tools]))
1104 if test "x$enable_rfkill" != "xno"; then
1105 have_rfkill=yes
1106 fi
1107 AM_CONDITIONAL(ENABLE_RFKILL, [test "$have_rfkill" = "yes"])
1108
1109 # ------------------------------------------------------------------------------
1110 have_logind=no
1111 AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
1112 if test "x$enable_logind" != "xno"; then
1113 have_logind=yes
1114 fi
1115 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
1116 AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(ENABLE_LOGIND, [1], [Logind support available]) ])
1117
1118 AC_ARG_WITH([kill-user-processes],
1119 [AS_HELP_STRING([--without-kill-user-processes], [set logind's KillUserProcesses=no by default])])
1120 AS_IF([test "$with_kill_user_processes" != "no"],
1121 [kill_user_processes=true
1122 KILL_USER_PROCESSES=yes],
1123 [kill_user_processes=false
1124 KILL_USER_PROCESSES=no])
1125 AC_DEFINE_UNQUOTED(KILL_USER_PROCESSES, [$kill_user_processes], [Default KillUserProcesses setting])
1126 AC_SUBST(KILL_USER_PROCESSES)
1127
1128 # ------------------------------------------------------------------------------
1129 have_machined=no
1130 AC_ARG_ENABLE(machined, AS_HELP_STRING([--disable-machined], [disable machine daemon]))
1131 if test "x$enable_machined" != "xno"; then
1132 have_machined=yes
1133 AC_DEFINE(HAVE_MACHINED, [1], [systemd-machined is enabled])
1134 fi
1135 AM_CONDITIONAL(ENABLE_MACHINED, [test "$have_machined" = "yes"])
1136
1137 # ------------------------------------------------------------------------------
1138 have_importd=no
1139 AC_ARG_ENABLE(importd, AS_HELP_STRING([--disable-importd], [disable import daemon]))
1140 if test "x$enable_importd" != "xno"; then
1141 have_importd=yes
1142 fi
1143 AM_CONDITIONAL(ENABLE_IMPORTD, [test "$have_importd" = "yes"])
1144 AS_IF([test "$have_importd" = "yes"], [ AC_DEFINE(HAVE_IMPORTD, [1], [Importd support available]) ])
1145
1146 # ------------------------------------------------------------------------------
1147 have_hostnamed=no
1148 AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
1149 if test "x$enable_hostnamed" != "xno"; then
1150 have_hostnamed=yes
1151 fi
1152 AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
1153
1154 # ------------------------------------------------------------------------------
1155 have_timedated=no
1156 AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
1157 if test "x$enable_timedated" != "xno"; then
1158 have_timedated=yes
1159 fi
1160 AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
1161
1162 # ------------------------------------------------------------------------------
1163 have_timesyncd=no
1164 AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon]))
1165 if test "x$enable_timesyncd" != "xno"; then
1166 have_timesyncd=yes
1167 M4_DEFINES="$M4_DEFINES -DENABLE_TIMESYNCD"
1168 fi
1169 AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"])
1170
1171 AC_ARG_WITH(ntp-servers,
1172 AS_HELP_STRING([--with-ntp-servers=NTPSERVERS],
1173 [space-separated list of default NTP servers]),
1174 [NTP_SERVERS="$withval"],
1175 [NTP_SERVERS="time1.google.com time2.google.com time3.google.com time4.google.com"])
1176
1177 AC_DEFINE_UNQUOTED(NTP_SERVERS, ["$NTP_SERVERS"], [Default NTP Servers])
1178 AC_SUBST(NTP_SERVERS)
1179
1180 AC_ARG_WITH(time-epoch,
1181 AS_HELP_STRING([--with-time-epoch=SECONDS],
1182 [time epoch for time clients]),
1183 [TIME_EPOCH="$withval"],
1184 [TIME_EPOCH="`stat -c %Y ${srcdir}/NEWS 2>/dev/null || echo 0`"])
1185
1186 AC_DEFINE_UNQUOTED(TIME_EPOCH, [$TIME_EPOCH], [Time Epoch])
1187
1188 # ------------------------------------------------------------------------------
1189 AC_ARG_WITH(system-uid-max,
1190 AS_HELP_STRING([--with-system-uid-max=UID]
1191 [maximum UID for system users]),
1192 [SYSTEM_UID_MAX="$withval"],
1193 [SYSTEM_UID_MAX="`awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' /etc/login.defs 2>/dev/null || echo 999`"])
1194
1195 AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
1196 AC_SUBST(SYSTEM_UID_MAX)
1197
1198 # ------------------------------------------------------------------------------
1199 AC_ARG_WITH(system-gid-max,
1200 AS_HELP_STRING([--with-system-gid-max=GID]
1201 [maximum GID for system groups]),
1202 [SYSTEM_GID_MAX="$withval"],
1203 [SYSTEM_GID_MAX="`awk 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }' /etc/login.defs 2>/dev/null || echo 999`"])
1204
1205 AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
1206 AC_SUBST(SYSTEM_GID_MAX)
1207
1208 # ------------------------------------------------------------------------------
1209
1210 AC_ARG_WITH(dev-kvm-mode,
1211 AS_HELP_STRING([--with-dev-kvm-mode=MODE],
1212 [/dev/kvm access mode, defaults to "0660"]),
1213 [DEV_KVM_MODE="$withval"],
1214 [DEV_KVM_MODE="0660"])
1215
1216 AC_SUBST(DEV_KVM_MODE, [$DEV_KVM_MODE], [/dev/kvm access mode])
1217
1218 # ------------------------------------------------------------------------------
1219 have_localed=no
1220 AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
1221 if test "x$enable_localed" != "xno"; then
1222 have_localed=yes
1223 fi
1224 AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
1225
1226 # ------------------------------------------------------------------------------
1227 have_coredump=no
1228 AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
1229 if test "x$enable_coredump" != "xno"; then
1230 have_coredump=yes
1231 M4_DEFINES="$M4_DEFINES -DENABLE_COREDUMP"
1232 fi
1233 AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
1234
1235 # ------------------------------------------------------------------------------
1236 have_polkit=no
1237 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
1238 if test "x$enable_polkit" != "xno"; then
1239 AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
1240 have_polkit=yes
1241
1242 # also enable support for *.pkla files on old polkit
1243 PKG_CHECK_MODULES(POLKIT, [ polkit-gobject-1 < 0.106 ],
1244 [polkit_pkla=yes],
1245 [polkit_pkla=no])
1246 fi
1247 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
1248 AM_CONDITIONAL(ENABLE_POLKIT_PKLA, [test "x$polkit_pkla" = "xyes"])
1249
1250 # ------------------------------------------------------------------------------
1251 have_resolved=no
1252 AC_ARG_ENABLE(resolved, AS_HELP_STRING([--disable-resolved], [disable resolve daemon]))
1253 AS_IF([test "x$enable_resolved" != "xno"], [
1254 AC_CHECK_LIB([dl], [dlsym], [true], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
1255
1256 have_resolved=yes
1257 M4_DEFINES="$M4_DEFINES -DENABLE_RESOLVED"
1258 AC_DEFINE(HAVE_RESOLVED, [1], [systemd-resolved is enabled])
1259 ])
1260 AM_CONDITIONAL(ENABLE_RESOLVED, [test "$have_resolved" = "yes"])
1261
1262 AC_ARG_WITH(dns-servers,
1263 AS_HELP_STRING([--with-dns-servers=DNSSERVERS],
1264 [space-separated list of default DNS servers]),
1265 [DNS_SERVERS="$withval"],
1266 [DNS_SERVERS="8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844"])
1267
1268 AC_DEFINE_UNQUOTED(DNS_SERVERS, ["$DNS_SERVERS"], [Default DNS Servers])
1269 AC_SUBST(DNS_SERVERS)
1270
1271 AC_ARG_WITH(default-dnssec,
1272 AS_HELP_STRING([--with-default-dnssec=MODE],
1273 [default DNSSEC mode, defaults to "allow-downgrade"]),
1274 [DEFAULT_DNSSEC_MODE="$withval"],
1275 [DEFAULT_DNSSEC_MODE="allow-downgrade"])
1276
1277 AS_CASE("x${DEFAULT_DNSSEC_MODE}",
1278 [xno], [mode=DNSSEC_NO],
1279 [xyes], [mode=DNSSEC_YES],
1280 [xallow-downgrade], [mode=DNSSEC_ALLOW_DOWNGRADE],
1281 AC_MSG_ERROR(Bad DNSSEC mode ${DEFAULT_DNSSEC_MODE}))
1282 AC_DEFINE_UNQUOTED(DEFAULT_DNSSEC_MODE, [$mode], [Default DNSSEC mode])
1283 AC_SUBST(DEFAULT_DNSSEC_MODE)
1284
1285 # ------------------------------------------------------------------------------
1286 have_networkd=no
1287 AC_ARG_ENABLE(networkd, AS_HELP_STRING([--disable-networkd], [disable networkd]))
1288 AS_IF([test "x$enable_networkd" != "xno"], [
1289 AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled])
1290 have_networkd=yes
1291 M4_DEFINES="$M4_DEFINES -DENABLE_NETWORKD"
1292 ])
1293 AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"])
1294
1295 # ------------------------------------------------------------------------------
1296 have_efi=no
1297 AC_ARG_ENABLE(efi, AS_HELP_STRING([--disable-efi], [disable systemd-boot and bootctl (EFI support)]))
1298 if test "x$enable_efi" != "xno"; then
1299 AC_DEFINE(ENABLE_EFI, 1, [Define if systemd-boot and bootctl are to be enabled])
1300 have_efi=yes
1301 fi
1302 AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
1303
1304 # ------------------------------------------------------------------------------
1305 AC_CHECK_TOOL(EFI_CC, gcc)
1306
1307 EFI_ARCH=`echo $host | sed "s/\(-\).*$//"`
1308
1309 AM_COND_IF(ARCH_IA32, [
1310 EFI_ARCH=ia32
1311 EFI_MACHINE_TYPE_NAME=ia32])
1312
1313 AM_COND_IF(ARCH_X86_64, [
1314 EFI_MACHINE_TYPE_NAME=x64])
1315
1316 AM_COND_IF(ARCH_AARCH64, [
1317 EFI_MACHINE_TYPE_NAME=aa64])
1318
1319 AC_SUBST([EFI_ARCH])
1320 AC_SUBST([EFI_MACHINE_TYPE_NAME])
1321
1322 have_gnuefi=no
1323 AC_ARG_ENABLE(gnuefi, AS_HELP_STRING([--enable-gnuefi], [enable optional gnuefi support]))
1324 AS_IF([test "x$enable_gnuefi" != "xno"], [
1325 AC_CHECK_HEADERS(efi/${EFI_ARCH}/efibind.h,
1326 [AC_DEFINE(HAVE_GNUEFI, 1, [Define if gnuefi is available])
1327 have_gnuefi=yes],
1328 [AS_IF([test "x$enable_gnuefi" = xyes],
1329 [AC_MSG_ERROR([*** gnuefi support requested but headers not found])])
1330 ])
1331
1332 efiroot=$(echo $(cd /usr/lib/$(${EFI_CC} -print-multi-os-directory); pwd))
1333
1334 EFI_LIB_DIR="$efiroot"
1335 AC_ARG_WITH(efi-libdir,
1336 AS_HELP_STRING([--with-efi-libdir=PATH], [path to EFI lib directory]),
1337 [EFI_LIB_DIR="$withval"], [EFI_LIB_DIR="$efiroot"]
1338 )
1339 AC_SUBST([EFI_LIB_DIR])
1340
1341 have_efi_lds=no
1342 AC_ARG_WITH(efi-ldsdir,
1343 AS_HELP_STRING([--with-efi-ldsdir=PATH], [path to EFI lds directory]),
1344 [EFI_LDS_DIR="$withval" && AS_IF([test -f "${EFI_LDS_DIR}/elf_${EFI_ARCH}_efi.lds"],
1345 [have_efi_lds=yes])],
1346 [AS_FOR([DIR], [EFI_LDS_DIR], ["${EFI_LIB_DIR}/gnuefi" "${EFI_LIB_DIR}"],
1347 [AS_IF([test -f "${EFI_LDS_DIR}/elf_${EFI_ARCH}_efi.lds"],
1348 [have_efi_lds=yes && break])])])
1349 AS_IF([test "x$have_efi_lds" = xyes],
1350 [AC_SUBST([EFI_LDS_DIR])],
1351 [AS_IF([test "x$enable_gnuefi" = xyes],
1352 [AC_MSG_ERROR([*** gnuefi support requested but files not found])],
1353 [have_gnuefi=no])])
1354
1355 AC_ARG_WITH(efi-includedir,
1356 AS_HELP_STRING([--with-efi-includedir=PATH], [path to EFI include directory]),
1357 [EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"]
1358 )
1359 AC_SUBST([EFI_INC_DIR])
1360 ])
1361 AM_CONDITIONAL(HAVE_GNUEFI, [test "x$have_gnuefi" = xyes])
1362
1363 # ------------------------------------------------------------------------------
1364 have_tpm=no
1365 AC_ARG_ENABLE([tpm], AS_HELP_STRING([--enable-tpm], [enable optional TPM support]),
1366 [case "${enableval}" in
1367 yes) have_tpm=yes ;;
1368 no) have_tpm=no ;;
1369 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tpm) ;;
1370 esac],
1371 [have_tpm=no])
1372
1373 if test "x${have_tpm}" != xno ; then
1374 AC_DEFINE(SD_BOOT_LOG_TPM, 1, [Define if TPM should be used to log events and extend the registers])
1375 fi
1376
1377 AC_ARG_WITH(tpm-pcrindex,
1378 AS_HELP_STRING([--with-tpm-pcrindex=<NUM>],
1379 [TPM PCR register number to use]),
1380 [SD_TPM_PCR="$withval"],
1381 [SD_TPM_PCR="8"])
1382
1383 AC_DEFINE_UNQUOTED(SD_TPM_PCR, [$SD_TPM_PCR], [TPM PCR register number to use])
1384
1385 # ------------------------------------------------------------------------------
1386 AC_ARG_WITH(rc-local-script-path-start,
1387 AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
1388 [path to /etc/rc.local]),
1389 [RC_LOCAL_SCRIPT_PATH_START="$withval"],
1390 [RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
1391
1392 AC_ARG_WITH(rc-local-script-path-stop,
1393 AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
1394 [path to /usr/sbin/halt.local]),
1395 [RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
1396 [RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
1397
1398 AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
1399 AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
1400
1401 AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
1402 AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
1403
1404 # ------------------------------------------------------------------------------
1405 AC_ARG_WITH(kbd-loadkeys,
1406 AS_HELP_STRING([--with-kbd-loadkeys=PATH],
1407 [path to loadkeys]),
1408 [KBD_LOADKEYS="$withval"],
1409 [KBD_LOADKEYS="/usr/bin/loadkeys"])
1410
1411 AC_ARG_WITH(kbd-setfont,
1412 AS_HELP_STRING([--with-kbd-setfont=PATH],
1413 [path to setfont]),
1414 [KBD_SETFONT="$withval"],
1415 [KBD_SETFONT="/usr/bin/setfont"])
1416
1417 AC_DEFINE_UNQUOTED(KBD_LOADKEYS, ["$KBD_LOADKEYS"], [Path of loadkeys])
1418 AC_DEFINE_UNQUOTED(KBD_SETFONT, ["$KBD_SETFONT"], [Path of setfont])
1419
1420 AC_SUBST(KBD_LOADKEYS)
1421 AC_SUBST(KBD_SETFONT)
1422
1423 AC_ARG_WITH(telinit,
1424 AS_HELP_STRING([--with-telinit=PATH],
1425 [path to telinit]),
1426 [TELINIT="$withval"],
1427 [TELINIT="/lib/sysvinit/telinit"])
1428
1429 AC_DEFINE_UNQUOTED(TELINIT, ["$TELINIT"], [Path to telinit])
1430
1431 AC_SUBST(TELINIT)
1432
1433 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
1434
1435 # ------------------------------------------------------------------------------
1436 have_myhostname=no
1437 AC_ARG_ENABLE(myhostname, AS_HELP_STRING([--disable-myhostname], [disable nss-myhostname support]))
1438 if test "x$enable_myhostname" != "xno"; then
1439 AC_HEADER_STDC
1440 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h nss.h sys/ioctl.h sys/auxv.h])
1441
1442 AC_C_CONST
1443 AC_TYPE_SIZE_T
1444 AC_HEADER_TIME
1445
1446 AC_FUNC_SELECT_ARGTYPES
1447 AC_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
1448
1449 have_myhostname=yes
1450 AC_DEFINE(HAVE_MYHOSTNAME, [1], [nss-myhostname is enabled])
1451 fi
1452 AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
1453
1454 # ------------------------------------------------------------------------------
1455 AC_ARG_ENABLE(hwdb, [AS_HELP_STRING([--disable-hwdb], [disable hardware database support])],
1456 enable_hwdb=$enableval, enable_hwdb=yes)
1457 AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes])
1458
1459 # ------------------------------------------------------------------------------
1460 have_manpages=no
1461 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
1462 AC_PATH_PROG([XSLTPROC], [xsltproc])
1463 AS_IF([test "x$enable_manpages" != xno], [
1464 have_manpages=yes
1465 AS_IF([test -z "$XSLTPROC"],
1466 AC_MSG_ERROR([*** xsltproc is required for man pages]))
1467 ])
1468 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
1469
1470 # ------------------------------------------------------------------------------
1471 AC_ARG_ENABLE(hibernate,
1472 [AS_HELP_STRING([--disable-hibernate], [disable hibernation support])],
1473 enable_hibernate=$enableval, enable_hibernate=yes)
1474 AM_CONDITIONAL(ENABLE_HIBERNATE, [test x$enable_hibernate = xyes])
1475
1476 # ------------------------------------------------------------------------------
1477 AC_ARG_ENABLE(ldconfig,
1478 [AS_HELP_STRING([--disable-ldconfig], [disable ldconfig])],
1479 enable_ldconfig=$enableval, enable_ldconfig=yes)
1480 AM_CONDITIONAL(ENABLE_LDCONFIG, [test x$enable_ldconfig = xyes])
1481
1482 # ------------------------------------------------------------------------------
1483 # Location of the init scripts as mandated by LSB
1484 SYSTEM_SYSVINIT_PATH=/etc/init.d
1485 SYSTEM_SYSVRCND_PATH=/etc/rc.d
1486
1487 AC_ARG_WITH([sysvinit-path],
1488 [AS_HELP_STRING([--with-sysvinit-path=PATH],
1489 [specify the path to where the SysV init scripts are located])],
1490 [SYSTEM_SYSVINIT_PATH="$withval"],
1491 [])
1492
1493 AC_ARG_WITH([sysvrcnd-path],
1494 [AS_HELP_STRING([--with-sysvrcnd-path=PATH],
1495 [specify the path to the base directory for the SysV rcN.d directories])],
1496 [SYSTEM_SYSVRCND_PATH="$withval"],
1497 [])
1498
1499 if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
1500 AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
1501 SYSTEM_SYSV_COMPAT="yes"
1502 M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
1503 elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
1504 AC_MSG_ERROR([*** You need both --with-sysvinit-path=PATH and --with-sysvrcnd-path=PATH to enable SysV compatibility support, or both empty to disable it.])
1505 else
1506 SYSTEM_SYSV_COMPAT="no"
1507 fi
1508
1509 AC_SUBST(SYSTEM_SYSVINIT_PATH)
1510 AC_SUBST(SYSTEM_SYSVRCND_PATH)
1511 AC_SUBST(M4_DEFINES)
1512
1513 AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
1514
1515 AC_ARG_WITH([tty-gid],
1516 [AS_HELP_STRING([--with-tty-gid=GID],
1517 [specify the numeric GID of the 'tty' group])],
1518 [TTY_GID="$withval"],
1519 [TTY_GID="5"])
1520
1521 AC_DEFINE_UNQUOTED(TTY_GID, [$TTY_GID], [GID of the 'tty' group])
1522 AC_SUBST(TTY_GID)
1523
1524 AC_ARG_WITH([dbuspolicydir],
1525 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
1526 [],
1527 [with_dbuspolicydir=${datadir}/dbus-1/system.d])
1528 AX_NORMALIZE_PATH([with_dbuspolicydir])
1529
1530 AC_ARG_WITH([dbussessionservicedir],
1531 AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
1532 [],
1533 [with_dbussessionservicedir=${datadir}/dbus-1/services])
1534 AX_NORMALIZE_PATH([with_dbussessionservicedir])
1535
1536 AC_ARG_WITH([dbussystemservicedir],
1537 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
1538 [],
1539 [with_dbussystemservicedir=${datadir}/dbus-1/system-services])
1540 AX_NORMALIZE_PATH([with_dbussystemservicedir])
1541
1542 AC_ARG_WITH([bashcompletiondir],
1543 AS_HELP_STRING([--with-bashcompletiondir=DIR], [bash completions directory]),
1544 [],
1545 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
1546 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
1547 ] , [
1548 with_bashcompletiondir=${datadir}/bash-completion/completions
1549 ])])
1550 AM_CONDITIONAL(ENABLE_BASH_COMPLETION, [test "$with_bashcompletiondir" != "no"])
1551 AX_NORMALIZE_PATH([with_bashcompletiondir])
1552
1553 AC_ARG_WITH([zshcompletiondir],
1554 AS_HELP_STRING([--with-zshcompletiondir=DIR], [zsh completions directory]),
1555 [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
1556 AM_CONDITIONAL(ENABLE_ZSH_COMPLETION, [test "$with_zshcompletiondir" != "no"])
1557 AX_NORMALIZE_PATH([with_zshcompletiondir])
1558
1559 AC_ARG_WITH([rootprefix],
1560 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
1561 [], [with_rootprefix=${ac_default_prefix}])
1562 # --with-rootprefix= (empty) should default to "/" but AX_NORMALIZE_PATH
1563 # defaults those to ".", solve that here for now until we can find a suitable
1564 # fix for AX_NORMALIZE_PATH upstream at autoconf-archive.
1565 # See: https://github.com/systemd/systemd/issues/54
1566 if test "x${with_rootprefix}" = "x"; then
1567 with_rootprefix="/"
1568 fi
1569 AX_NORMALIZE_PATH([with_rootprefix])
1570
1571 AC_ARG_WITH([rootlibdir],
1572 AS_HELP_STRING([--with-rootlibdir=DIR], [root directory for libraries necessary for boot]),
1573 [],
1574 [with_rootlibdir=${libdir}])
1575 AX_NORMALIZE_PATH([with_rootlibdir])
1576
1577 AC_ARG_WITH([pamlibdir],
1578 AS_HELP_STRING([--with-pamlibdir=DIR], [directory for PAM modules]),
1579 [],
1580 [with_pamlibdir=${with_rootlibdir}/security])
1581 AX_NORMALIZE_PATH([with_pamlibdir])
1582
1583 AC_ARG_WITH([pamconfdir],
1584 AS_HELP_STRING([--with-pamconfdir=DIR], [directory for PAM configuration (pass no to disable installing)]),
1585 [],
1586 [with_pamconfdir=${sysconfdir}/pam.d])
1587 AM_CONDITIONAL(ENABLE_PAM_CONFIG, [test "$with_pamconfdir" != "no"])
1588 AX_NORMALIZE_PATH([with_pamconfdir])
1589
1590 AC_ARG_WITH([rpmmacrosdir],
1591 AS_HELP_STRING([--with-rpmmacrosdir=DIR], [directory to store macros for RPM]),
1592 [], [with_rpmmacrosdir=\${prefix}/lib/rpm/macros.d])
1593 AM_CONDITIONAL(ENABLE_RPM_MACROS, [test "$with_rpmmacrosdir" != "no"])
1594 AX_NORMALIZE_PATH([with_rpmmacrosdir])
1595
1596 AC_ARG_ENABLE([split-usr],
1597 AS_HELP_STRING([--enable-split-usr], [assume that /bin, /sbin aren't symlinks into /usr]),
1598 [],
1599 [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
1600 enable_split_usr=yes
1601 ], [
1602 enable_split_usr=no
1603 ])])
1604
1605 AS_IF([test "x${enable_split_usr}" = "xyes"], [
1606 AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
1607 ])
1608 AM_CONDITIONAL(ENABLE_SPLIT_USR, [test "x${enable_split_usr}" = "xyes"])
1609
1610 # work around intltool-update issues during 'make distcheck'
1611 AS_IF([test "x$0" != "x./configure"], [
1612 AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
1613 ])
1614
1615 # QEMU and OVMF UEFI firmware
1616 AS_IF([test x"$cross_compiling" = "xyes"], [], [
1617 AC_PATH_PROG([QEMU], [qemu-system-x86_64])
1618 AC_CHECK_FILE([/usr/share/qemu/bios-ovmf.bin], [QEMU_BIOS=/usr/share/qemu/bios-ovmf.bin],
1619 [AC_CHECK_FILE([/usr/share/qemu-ovmf/bios.bin], [QEMU_BIOS=/usr/share/qemu-ovmf/bios.bin])])
1620 AC_SUBST([QEMU_BIOS])
1621 ])
1622
1623 AC_ARG_ENABLE(tests,
1624 [AS_HELP_STRING([--disable-tests], [disable tests, or enable extra tests with =unsafe])],
1625 enable_tests=$enableval, enable_tests=yes)
1626 AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes -o x$enable_tests = xunsafe])
1627 AM_CONDITIONAL(ENABLE_UNSAFE_TESTS, [test x$enable_tests = xunsafe])
1628
1629 AC_ARG_ENABLE(debug,
1630 [AS_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap,mmap-cache)])],
1631 [if test "x$enableval" = "xyes"; then
1632 enableval="hashmap,mmap-cache"
1633 fi
1634 saved_ifs="$IFS"
1635 IFS="$IFS$PATH_SEPARATOR,"
1636 for name in $enableval; do
1637 case $name in
1638 hashmap)
1639 enable_debug_hashmap=yes
1640 ;;
1641 mmap-cache)
1642 enable_debug_mmap_cache=yes
1643 ;;
1644 esac
1645 done
1646 IFS="$saved_ifs"],[])
1647
1648 enable_debug=""
1649 AS_IF([test x$enable_debug_hashmap = xyes], [
1650 AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
1651 enable_debug="hashmap $enable_debug"
1652 ])
1653 AS_IF([test x$enable_debug_mmap_cache = xyes], [
1654 AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled])
1655 enable_debug="mmap-cache $enable_debug"
1656 ])
1657 test -z "$enable_debug" && enable_debug="none"
1658
1659 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
1660 AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
1661 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
1662 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
1663 AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
1664 AC_SUBST([pamlibdir], [$with_pamlibdir])
1665 AC_SUBST([pamconfdir], [$with_pamconfdir])
1666 AC_SUBST([rpmmacrosdir], [$with_rpmmacrosdir])
1667 AC_SUBST([rootprefix], [$with_rootprefix])
1668 AC_SUBST([rootlibdir], [$with_rootlibdir])
1669
1670 AC_CONFIG_FILES([
1671 Makefile
1672 po/Makefile.in
1673 ])
1674
1675 AC_OUTPUT
1676 AC_MSG_RESULT([
1677 $PACKAGE_NAME $PACKAGE_VERSION
1678
1679 libcryptsetup: ${have_libcryptsetup}
1680 PAM: ${have_pam}
1681 AUDIT: ${have_audit}
1682 IMA: ${have_ima}
1683 AppArmor: ${have_apparmor}
1684 SELinux: ${have_selinux}
1685 SECCOMP: ${have_seccomp}
1686 SMACK: ${have_smack}
1687 ZLIB: ${have_zlib}
1688 XZ: ${have_xz}
1689 LZ4: ${have_lz4}
1690 BZIP2: ${have_bzip2}
1691 ACL: ${have_acl}
1692 GCRYPT: ${have_gcrypt}
1693 QRENCODE: ${have_qrencode}
1694 MICROHTTPD: ${have_microhttpd}
1695 GNUTLS: ${have_gnutls}
1696 libcurl: ${have_libcurl}
1697 libidn: ${have_libidn}
1698 libiptc: ${have_libiptc}
1699 ELFUTILS: ${have_elfutils}
1700 binfmt: ${have_binfmt}
1701 vconsole: ${have_vconsole}
1702 quotacheck: ${have_quotacheck}
1703 tmpfiles: ${have_tmpfiles}
1704 environment.d: ${have_environment_d}
1705 sysusers: ${have_sysusers}
1706 firstboot: ${have_firstboot}
1707 randomseed: ${have_randomseed}
1708 backlight: ${have_backlight}
1709 rfkill: ${have_rfkill}
1710 logind: ${have_logind}
1711 default cgroup hierarchy: ${DEFAULT_HIERARCHY}
1712 default KillUserProcesses setting: ${KILL_USER_PROCESSES}
1713 machined: ${have_machined}
1714 importd: ${have_importd}
1715 hostnamed: ${have_hostnamed}
1716 timedated: ${have_timedated}
1717 timesyncd: ${have_timesyncd}
1718 default NTP servers: ${NTP_SERVERS}
1719 time epoch: ${TIME_EPOCH}
1720 localed: ${have_localed}
1721 networkd: ${have_networkd}
1722 resolved: ${have_resolved}
1723 default DNS servers: ${DNS_SERVERS}
1724 default DNSSEC mode: ${DEFAULT_DNSSEC_MODE}
1725 coredump: ${have_coredump}
1726 polkit: ${have_polkit} (legacy pkla support: ${polkit_pkla})
1727 efi: ${have_efi}
1728 gnuefi: ${have_gnuefi}
1729 efi arch: ${EFI_ARCH}
1730 EFI machine type: ${EFI_MACHINE_TYPE_NAME}
1731 EFI CC ${EFI_CC}
1732 EFI libdir: ${EFI_LIB_DIR}
1733 EFI ldsdir: ${EFI_LDS_DIR}
1734 EFI includedir: ${EFI_INC_DIR}
1735 kmod: ${have_kmod}
1736 xkbcommon: ${have_xkbcommon}
1737 blkid: ${have_blkid}
1738 libmount: ${have_libmount}
1739 dbus: ${have_dbus}
1740 nss-myhostname: ${have_myhostname}
1741 hwdb: ${enable_hwdb}
1742 tpm: ${have_tpm}
1743 Python: ${have_python}
1744 man pages: ${have_manpages}
1745 test coverage: ${have_coverage}
1746 Split /usr: ${enable_split_usr}
1747 SysV compatibility: ${SYSTEM_SYSV_COMPAT}
1748 utmp/wtmp support: ${have_utmp}
1749 ldconfig support: ${enable_ldconfig}
1750 hibernate support: ${enable_hibernate}
1751 extra debugging: ${enable_debug}
1752 tests: ${enable_tests}
1753
1754 prefix: ${prefix}
1755 rootprefix: ${with_rootprefix}
1756 sysconf dir: ${sysconfdir}
1757 datarootdir: ${datarootdir}
1758 includedir: ${includedir}
1759 lib dir: ${libdir}
1760 rootlib dir: ${with_rootlibdir}
1761 SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
1762 SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
1763 build Python: ${PYTHON}
1764 PAM modules dir: ${with_pamlibdir}
1765 PAM configuration dir: ${with_pamconfdir}
1766 RPM macros dir: ${with_rpmmacrosdir}
1767 D-Bus policy dir: ${with_dbuspolicydir}
1768 D-Bus session dir: ${with_dbussessionservicedir}
1769 D-Bus system dir: ${with_dbussystemservicedir}
1770 bash completions dir: ${with_bashcompletiondir}
1771 zsh completions dir: ${with_zshcompletiondir}
1772 extra start script: ${RC_LOCAL_SCRIPT_PATH_START}
1773 extra stop script: ${RC_LOCAL_SCRIPT_PATH_STOP}
1774 adm group: ${have_adm_group}
1775 wheel group: ${have_wheel_group}
1776 debug shell: ${SUSHELL} @ ${DEBUGTTY}
1777 TTY GID: ${TTY_GID}
1778 maximum system UID: ${SYSTEM_UID_MAX}
1779 maximum system GID: ${SYSTEM_GID_MAX}
1780 /dev/kvm access mode: ${DEV_KVM_MODE}
1781 certificate root: ${CERTIFICATEROOT}
1782 support URL: ${SUPPORT_URL}
1783 nobody user name: ${NOBODY_USER_NAME}
1784 nobody group name: ${NOBODY_GROUP_NAME}
1785 fallback hostname: ${FALLBACK_HOSTNAME}
1786
1787 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
1788 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
1789 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
1790 ])