]> git.ipfire.org Git - thirdparty/systemd.git/blame - configure.ac
resolved: rr - print DNSKEY and RRSIG in base64
[thirdparty/systemd.git] / configure.ac
CommitLineData
fb0951b0 1#
47be870b
LP
2# This file is part of systemd.
3#
3e214785
KS
4# Copyright 2010-2012 Lennart Poettering
5# Copyright 2010-2012 Kay Sievers
47be870b
LP
6#
7# systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
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
47be870b
LP
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
5430f7f2 15# Lesser General Public License for more details.
47be870b 16#
5430f7f2 17# You should have received a copy of the GNU Lesser General Public License
47be870b
LP
18# along with systemd; If not, see <http://www.gnu.org/licenses/>.
19
4e949c11
JJ
20AC_PREREQ([2.64])
21
22AC_INIT([systemd],
2d1ca112 23 [222],
1a435084 24 [http://github.com/systemd/systemd/issues],
4e949c11
JJ
25 [systemd],
26 [http://www.freedesktop.org/wiki/Software/systemd])
47be870b 27
78a825f2 28AC_CONFIG_SRCDIR([src/core/main.c])
47be870b
LP
29AC_CONFIG_MACRO_DIR([m4])
30AC_CONFIG_HEADERS([config.h])
a80db8bd
JJ
31AC_CONFIG_AUX_DIR([build-aux])
32
4db6d587 33AC_USE_SYSTEM_EXTENSIONS
907dd195 34AC_SYS_LARGEFILE
eb7bbee6 35AC_PREFIX_DEFAULT([/usr])
6aad7f2c 36AM_MAINTAINER_MODE([enable])
91ca5bf0 37AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests])
3e214785 38AM_SILENT_RULES([yes])
47be870b 39AC_CANONICAL_HOST
22be093f 40AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
3e214785 41LT_PREREQ(2.2)
8666abb4 42LT_INIT([disable-static])
47be870b 43
5e63ce78 44AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by systemd])])
3d585edb 45AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by systemd])])
5e63ce78 46
0fa2cac4
KS
47SET_ARCH(X86_64, x86_64*)
48SET_ARCH(IA32, i*86*)
49SET_ARCH(MIPS, mips*)
4c6abc93 50SET_ARCH(AARCH64, aarch64*)
f15515b5 51
0fa2cac4 52# i18n stuff for the PolicyKit policy files, heck whether intltool can be found, disable NLS otherwise
f15515b5
FB
53AC_CHECK_PROG(intltool_found, [intltool-merge], [yes], [no])
54AS_IF([test x"$intltool_found" != xyes],
55 [AS_IF([test x"$enable_nls" = xyes],
56 [AC_MSG_ERROR([--enable-nls requested but intltool not found])],
57 [AS_IF([test x"$enable_nls" != xno],
58 [AC_MSG_WARN([*** Disabling NLS support because intltool was not found])
59 enable_nls=no])
60 ])
61 ])
62
2f96919b 63AM_NLS
a59f16ce 64AS_IF([test x"$enable_nls" != xno -o "x$enable_polkit" != xno], [
2f96919b 65 # intltoolize greps for '^(AC|IT)_PROG_INTLTOOL', so it needs to be on its own line
1c7dde3e 66IT_PROG_INTLTOOL([0.40.0])
2f96919b
FB
67])
68
69AS_IF([test -z "$INTLTOOL_POLICY_RULE"], [
70 # If intltool is not available, provide a dummy rule to fail generation of %.policy files with a meaningful error message
71 INTLTOOL_POLICY_RULE='%.policy: %.policy.in ; @echo " ITMRG " $@ && echo "*** intltool support required to build target $@" && false'
72 AC_SUBST(INTLTOOL_POLICY_RULE)
73])
1c7dde3e
BN
74
75GETTEXT_PACKAGE=systemd
76AC_SUBST(GETTEXT_PACKAGE)
20f56fdd 77AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [systemd])
1c7dde3e 78
e9da3678
LP
79AC_PROG_MKDIR_P
80AC_PROG_LN_S
81AC_PROG_SED
3ce4fad8 82AC_PROG_GREP
f975e971 83AC_PROG_AWK
e9da3678 84
47be870b 85AC_PROG_CC_C99
47be870b 86
3e214785 87AC_PATH_PROG([M4], [m4])
fe1fed02 88AC_PATH_PROG([XSLTPROC], [xsltproc])
92ec4495 89
2d0efdf1
SS
90AC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon], [$PATH:/usr/sbin:/sbin])
91AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck], [$PATH:/usr/sbin:/sbin])
b51fc639 92
dd5ae4c3
PK
93AC_PATH_PROG([SETCAP], [setcap], [/usr/sbin/setcap], [$PATH:/usr/sbin:/sbin])
94
2d0efdf1 95AC_PATH_PROG([KILL], [kill], [/usr/bin/kill], [$PATH:/usr/sbin:/sbin])
96ede260 96
2d0efdf1 97AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin])
edeb68c5 98
2d0efdf1 99AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
78013564 100
66b0e0e0
CR
101AC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin])
102
f00929ad
DJL
103AC_PATH_PROG([MOUNT_PATH], [mount], [/usr/bin/mount], [$PATH:/usr/sbin:/sbin])
104AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin])
105
44688352
LP
106AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
107
4acbce79
ZJS
108M4_DEFINES=
109
c4a77bcb 110AC_CHECK_TOOL(OBJCOPY, objcopy)
ac714a78
MJ
111AC_CHECK_TOOL(STRINGS, strings)
112AC_CHECK_TOOL(GPERF, gperf)
b62cfcea
MB
113if test -z "$GPERF" ; then
114 AC_MSG_ERROR([*** gperf not found])
115fi
9a60da28 116
732bfe09
ZJS
117# ------------------------------------------------------------------------------
118address_sanitizer_cflags=
119address_sanitizer_cppflags=
120address_sanitizer_ldflags=
121AC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
122AS_IF([test "x$enable_address_sanitizer" = "xyes"], [
123 CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
124 AS_IF([test -z "$with_as_cflags"],
125 [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
126 address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
127 address_sanitizer_cppflags="-DVALGRIND=1"
128 address_sanitizer_ldflags="-Wc,-fsanitize=address"
129 ])
130
ae0ceefc
ZJS
131undefined_sanitizer_cflags=
132undefined_sanitizer_cppflags=
133undefined_sanitizer_ldflags=
134AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
135AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
136 CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
137 AS_IF([test -z "$with_us_cflags"],
138 [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
139 undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
140 undefined_sanitizer_cppflags="-DVALGRIND=1"
141 undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
142 ])
143
144sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
145sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
146sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
147
eb2e280f 148CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
be1a67d9 149 -pipe \
d1ab0ca0 150 -Wall \
d1ab0ca0 151 -Wextra \
d1ab0ca0 152 -Wundef \
780040dc 153 "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
d1ab0ca0 154 -Wlogical-op \
d1ab0ca0 155 -Wmissing-include-dirs \
d1ab0ca0
LP
156 -Wold-style-definition \
157 -Wpointer-arith \
158 -Winit-self \
03930e48 159 -Wdeclaration-after-statement \
d1ab0ca0 160 -Wfloat-equal \
693eb9a2 161 -Wsuggest-attribute=noreturn \
8dc31a63
DM
162 -Werror=missing-prototypes \
163 -Werror=implicit-function-declaration \
164 -Werror=missing-declarations \
165 -Werror=return-type \
d9cea815 166 -Werror=shadow \
d1ab0ca0
LP
167 -Wstrict-prototypes \
168 -Wredundant-decls \
d1ab0ca0
LP
169 -Wmissing-noreturn \
170 -Wshadow \
171 -Wendif-labels \
d1ab0ca0
LP
172 -Wstrict-aliasing=2 \
173 -Wwrite-strings \
174 -Wno-unused-parameter \
be1a67d9 175 -Wno-missing-field-initializers \
f73fb7b7 176 -Wno-unused-result \
0a98d661 177 -Wno-format-signedness \
d200735e 178 -Werror=overflow \
213298fb 179 -Wdate-time \
693eb9a2 180 -Wnested-externs \
be1a67d9 181 -ffast-math \
d1ab0ca0
LP
182 -fno-common \
183 -fdiagnostics-show-option \
9b85fc6a
GSB
184 -fno-strict-aliasing \
185 -fvisibility=hidden \
c1663b9d 186 -fstack-protector \
aca33b07 187 -fstack-protector-strong \
2a4d1ec1 188 -fPIE \
c1663b9d 189 --param=ssp-buffer-size=4])
4f47bb8c
ZJS
190
191AS_CASE([$CC], [*clang*],
192 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
65e3a2cf
ZJS
193 -Wno-typedef-redefinition \
194 -Wno-gnu-variable-sized-type-not-at-end \
195 ])])
4f47bb8c 196
0289f2fb 197AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
b850b06e 198 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
235c6e62 199 -flto -ffat-lto-objects])],
b850b06e 200 [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
ae0ceefc 201AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
5a45a936 202
0289f2fb 203AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
a6c0b31d
ZJS
204 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
205 -Wp,-D_FORTIFY_SOURCE=2])],
206 [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
ae0ceefc 207AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
9e7adc3a 208
2b4919a6
KS
209AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
210 [CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
211 -Wl,--gc-sections])],
212 [AC_MSG_RESULT([skipping --gc-sections, optimization not enabled])])
213AC_SUBST([OUR_CFLAGS], "$with_ldflags $sanitizer_cflags")
214
215AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
216 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
217 -ffunction-sections -fdata-sections])],
218 [AC_MSG_RESULT([skipping -ffunction/data-section, optimization not enabled])])
219AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
220
9e7adc3a 221CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
9b85fc6a 222 -Wl,--as-needed \
9d2d0fe1 223 -Wl,--no-undefined \
5a45a936 224 -Wl,-z,relro \
39c4ead2 225 -Wl,-z,now \
2a4d1ec1 226 -pie \
39c4ead2 227 -Wl,-fuse-ld=gold])
ae0ceefc 228AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
47be870b 229
ccd06097
ZJS
230AC_CHECK_SIZEOF(pid_t)
231AC_CHECK_SIZEOF(uid_t)
1c231f56 232AC_CHECK_SIZEOF(gid_t)
de0671ee 233AC_CHECK_SIZEOF(time_t)
de99c9dc 234AC_CHECK_SIZEOF(dev_t)
de0671ee
ZJS
235AC_CHECK_SIZEOF(rlim_t,,[
236 #include <sys/time.h>
237 #include <sys/resource.h>
238])
ccd06097 239
c937e0d5 240# ------------------------------------------------------------------------------
2799e519 241# we use python to build the man page index
c937e0d5 242have_python=no
c937e0d5
ZJS
243AC_ARG_WITH([python],
244 [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
245
32dcef3a 246have_lxml=no
c937e0d5
ZJS
247AS_IF([test "x$with_python" != "xno"], [
248 AM_PATH_PYTHON(,, [:])
be8737ae
FB
249 AS_IF([test "x$PYTHON" != "x:"], [
250 AC_MSG_CHECKING([for python lxml module])
251 AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
252 AC_MSG_RESULT([$have_lxml])
253 AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
254 [AC_MSG_WARN([*** python support requires python-lxml module installed])])
255 ])
c937e0d5 256])
747cf8cd
ZJS
257AS_IF([test "$have_python" != "yes"], [
258 AS_IF([test "$with_python" = "yes"],
259 [AC_MSG_ERROR([*** python support requested but python support not found])])
260 AS_IF([test "$with_python" != "no"],
261 [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
262])
c937e0d5 263AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
c937e0d5
ZJS
264
265# ------------------------------------------------------------------------------
266
afea26ad 267AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
7959ff99 268AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
4b357e15 269AC_CHECK_HEADERS([linux/btrfs.h], [], [])
27c64db6 270AC_CHECK_HEADERS([linux/memfd.h], [], [])
7959ff99
KS
271
272# unconditionally pull-in librt with old glibc versions
273AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
85f19d82
MB
274
275save_LIBS="$LIBS"
276LIBS=
47be870b 277AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
85f19d82 278CAP_LIBS="$LIBS"
7959ff99
KS
279AC_SUBST(CAP_LIBS)
280
27c64db6 281AC_CHECK_FUNCS([memfd_create])
4db17f29 282AC_CHECK_FUNCS([__secure_getenv secure_getenv])
f7ad54a3 283AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, renameat2, kcmp, LO_FLAGS_PARTSCAN],
81577dc2
ZJS
284 [], [], [[
285#include <sys/types.h>
a8348796 286#include <unistd.h>
9388e99e 287#include <sys/mount.h>
3b794314 288#include <fcntl.h>
5f381b35 289#include <sched.h>
81577dc2 290#include <linux/loop.h>
539618a0 291#include <linux/random.h>
81577dc2
ZJS
292]])
293
84dd59b5
DH
294AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
295 IFLA_MACVLAN_FLAGS,
c4a5ddc9 296 IFLA_IPVLAN_MODE,
6589d0db 297 IFLA_VTI_REMOTE,
75616a13 298 IFLA_PHYS_PORT_ID,
81577dc2
ZJS
299 IFLA_BOND_AD_INFO,
300 IFLA_VLAN_PROTOCOL,
583c14fc 301 IFLA_VXLAN_REMCSUM_NOPARTIAL,
81577dc2 302 IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
8ecec322 303 IFLA_BRIDGE_VLAN_INFO,
cf1755ba 304 IFLA_BRPORT_UNICAST_FLOOD,
34f7b9f9
LP
305 NDA_IFINDEX,
306 IFA_FLAGS],
81577dc2
ZJS
307[], [], [[
308#include <inttypes.h>
309#include <netinet/in.h>
310#include <netinet/ether.h>
311#include <linux/rtnetlink.h>
312#include <net/if.h>
313#include <linux/ip.h>
314#include <linux/if_tunnel.h>
315#include <linux/if_link.h>
316#include <linux/if_bridge.h>
34f7b9f9 317#include <linux/if_addr.h>
cf1755ba 318#include <linux/neighbour.h>
81577dc2 319]])
a8348796 320
b237ef2c 321# This makes sure pkg.m4 is available.
a9b5b032 322m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
d1ab0ca0 323
22703094 324# ------------------------------------------------------------------------------
ac6b760c
ZJS
325have_dbus=no
326AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
8114dedc 327AS_IF([test "x$enable_dbus" != "xno"], [
ac6b760c
ZJS
328 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2],
329 [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes],
330 [have_dbus=no])
331 AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"],
332 [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])])
22703094 333AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
4b357e15 334
37161c51
ERB
335# ------------------------------------------------------------------------------
336have_utmp=yes
337AC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log handling]),
338 AS_CASE("x${enableval}",
339 [xyes], [have_utmp=yes],
340 [xno], [have_utmp=no],
341 AC_MSG_ERROR(bad value ${enableval} for --enable-utmp)))
342AS_IF([test "x$have_utmp" = "xyes"], [AC_DEFINE(HAVE_UTMP, 1, [Define if utmp/wtmp support is enabled])])
343AM_CONDITIONAL([HAVE_UTMP], [test "x$have_utmp" = "xyes"])
344
53e856e1
ZJS
345# ------------------------------------------------------------------------------
346have_compat_libs=no
347AC_ARG_ENABLE([compat_libs], AS_HELP_STRING([--enable-compat-libs],[Enable creation of compatibility libraries]),
348 [case "${enableval}" in
349 yes) have_compat_libs=yes ;;
350 no) have_compat_libs=no ;;
351 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libs) ;;
352 esac],
353 [have_compat_libs=no])
354AM_CONDITIONAL([ENABLE_COMPAT_LIBS], [test "$have_compat_libs" = "yes"])
355
6aea6d10
TA
356# ------------------------------------------------------------------------------
357have_coverage=no
358AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
359if test "x$enable_coverage" = "xyes" ; then
360 AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
361 if test "x$lcov_found" = xno ; then
362 AC_MSG_ERROR([*** lcov support requested but the program was not found])
363 else
364 lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
365 lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
366 if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
367 AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
368 else
369 have_coverage=yes
370 CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
371 -fprofile-arcs \
372 -ftest-coverage])
373 AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
374 fi
375 fi
376fi
377AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
378
e3043162
TG
379# ------------------------------------------------------------------------------
380have_kmod=no
381AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
382if test "x$enable_kmod" != "xno"; then
e2ca86cf
DR
383 PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
384 if test "x$have_kmod" = "xyes"; then
a18535d9 385 PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
e2ca86cf 386 [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
70d83209 387 AC_MSG_ERROR([*** kmod version >= 15 not found]))
e2ca86cf 388 fi
e3043162 389 if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
c4955740 390 AC_MSG_ERROR([*** kmod support requested, but libraries not found])
e3043162
TG
391 fi
392fi
393AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
f553b3b1 394
d4f5a1f4
DH
395# ------------------------------------------------------------------------------
396have_xkbcommon=no
397AC_ARG_ENABLE(xkbcommon, AS_HELP_STRING([--disable-xkbcommon], [disable xkbcommon keymap support]))
398if test "x$enable_xkbcommon" != "xno"; then
399 PKG_CHECK_MODULES(XKBCOMMON, [ xkbcommon >= 0.3.0 ],
400 [AC_DEFINE(HAVE_XKBCOMMON, 1, [Define if libxkbcommon is available]) have_xkbcommon=yes], have_xkbcommon=no)
401 if test "x$have_xkbcommon" = xno -a "x$enable_xkbcommon" = xyes; then
402 AC_MSG_ERROR([*** xkbcommon support requested but libraries not found])
403 fi
404fi
405AM_CONDITIONAL(HAVE_XKBCOMMON, [test "$have_xkbcommon" = "yes"])
406
f553b3b1
AO
407# ------------------------------------------------------------------------------
408have_blkid=no
409AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
410if test "x$enable_blkid" != "xno"; then
d47f6ca5 411 PKG_CHECK_MODULES(BLKID, [ blkid >= 2.24 ],
f553b3b1
AO
412 [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
413 if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
414 AC_MSG_ERROR([*** blkid support requested but libraries not found])
415 fi
416fi
417AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
728beb28 418
8d3ae2bd
CL
419# ------------------------------------------------------------------------------
420have_libmount=no
421PKG_CHECK_MODULES(MOUNT, [ mount >= 2.20 ],
422 [AC_DEFINE(HAVE_LIBMOUNT, 1, [Define if libmount is available]) have_libmount=yes], have_libmount=no)
423if test "x$have_libmount" = xno; then
424 AC_MSG_ERROR([*** libmount support required but libraries not found])
425fi
426AM_CONDITIONAL(HAVE_LIBMOUNT, [test "$have_libmount" = "yes"])
427
c0467cf3
RC
428# ------------------------------------------------------------------------------
429have_seccomp=no
430AC_ARG_ENABLE(seccomp, AS_HELP_STRING([--disable-seccomp], [Disable optional SECCOMP support]))
431if test "x$enable_seccomp" != "xno"; then
432 PKG_CHECK_MODULES(SECCOMP, [libseccomp >= 1.0.0],
17df7223
LP
433 [AC_DEFINE(HAVE_SECCOMP, 1, [Define if seccomp is available])
434 have_seccomp=yes
435 M4_DEFINES="$M4_DEFINES -DHAVE_SECCOMP"],
c0467cf3
RC
436 [have_seccomp=no])
437 if test "x$have_seccomp" = "xno" -a "x$enable_seccomp" = "xyes"; then
438 AC_MSG_ERROR([*** seccomp support requested but libraries not found])
439 fi
440fi
441AM_CONDITIONAL(HAVE_SECCOMP, [test "$have_seccomp" = "yes"])
442
3e214785 443# ------------------------------------------------------------------------------
81611586
RS
444have_ima=yes
445AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]),
446 [case "${enableval}" in
447 yes) have_ima=yes ;;
448 no) have_ima=no ;;
449 *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
450 esac],
451 [have_ima=yes])
452
453if test "x${have_ima}" != xno ; then
454 AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
455fi
456
3e214785 457# ------------------------------------------------------------------------------
591622d7
LP
458have_selinux=no
459AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
460if test "x$enable_selinux" != "xno"; then
3f8cc098 461 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
6a6751fe
LP
462 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
463 have_selinux=yes
464 M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
465 [have_selinux=no])
591622d7
LP
466 if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
467 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
468 fi
56cf987f 469fi
591622d7 470AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
45df1f2c 471
eef65bf3
MS
472have_apparmor=no
473AC_ARG_ENABLE(apparmor, AS_HELP_STRING([--disable-apparmor], [Disable optional AppArmor support]))
474if test "x$enable_apparmor" != "xno"; then
475 PKG_CHECK_MODULES([APPARMOR], [libapparmor],
476 [AC_DEFINE(HAVE_APPARMOR, 1, [Define if AppArmor is available])
477 have_apparmor=yes
478 M4_DEFINES="$M4_DEFINES -DHAVE_APPARMOR"],
479 [have_apparmor=no])
480 if test "x$have_apparmor" = xno -a "x$enable_apparmor" = xyes; then
481 AC_MSG_ERROR([*** AppArmor support requested but libraries not found])
482 fi
483fi
484AM_CONDITIONAL(HAVE_APPARMOR, [test "$have_apparmor" = "yes"])
485
486
45df1f2c
CR
487AC_ARG_WITH(debug-shell,
488 AS_HELP_STRING([--with-debug-shell=PATH],
489 [Path to debug shell binary]),
490 [SUSHELL="$withval"],[
491 AS_IF([test "x${have_selinux}" != "xno"], [SUSHELL="/sbin/sushell"] , [SUSHELL="/bin/sh"])])
492
5ec6b15b 493AC_SUBST(SUSHELL)
56cf987f 494
45df1f2c
CR
495AC_ARG_WITH([debug-tty],
496 AS_HELP_STRING([--with-debug-tty=PATH],
497 [Specify the tty device for debug shell]),
498 [DEBUGTTY="$withval"],
499 [DEBUGTTY=/dev/tty9])
500
501AC_SUBST(DEBUGTTY)
502
ad95fd1d
ZJS
503AC_ARG_WITH([certificate-root],
504 AS_HELP_STRING([--with-certificate-root=PATH],
505 [Specify the prefix for TLS certificates [/etc/ssl]]),
506 [CERTIFICATEROOT="$withval"],
507 [CERTIFICATEROOT="/etc/ssl"])
508
509AC_SUBST(CERTIFICATEROOT)
510
3e214785 511# ------------------------------------------------------------------------------
807e17f0
LP
512have_xz=no
513AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
514if test "x$enable_xz" != "xno"; then
515 PKG_CHECK_MODULES(XZ, [ liblzma ],
6bf12f55 516 [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no)
807e17f0 517 if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then
d89c8fdf 518 AC_MSG_ERROR([*** XZ support requested but libraries not found])
807e17f0
LP
519 fi
520fi
521AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
522
edce2aed
LP
523# ------------------------------------------------------------------------------
524have_zlib=no
525AC_ARG_ENABLE(zlib, AS_HELP_STRING([--disable-zlib], [Disable optional ZLIB support]))
526if test "x$enable_zlib" != "xno"; then
527 PKG_CHECK_MODULES(ZLIB, [ zlib ],
6bf12f55 528 [AC_DEFINE(HAVE_ZLIB, 1, [Define if ZLIB is available]) have_zlib=yes], have_zlib=no)
edce2aed
LP
529 if test "x$have_zlib" = xno -a "x$enable_zlib" = xyes; then
530 AC_MSG_ERROR([*** ZLIB support requested but libraries not found])
531 fi
532fi
533AM_CONDITIONAL(HAVE_ZLIB, [test "$have_zlib" = "yes"])
534
8af3cf74
LP
535# ------------------------------------------------------------------------------
536have_bzip2=no
831f18cb 537AC_ARG_ENABLE(bzip2, AS_HELP_STRING([--enable-bzip2], [Disable optional BZIP2 support]))
8af3cf74
LP
538AS_IF([test "x$enable_bzip2" != "xno"], [
539 AC_CHECK_HEADERS(bzlib.h,
831f18cb
LP
540 [AC_DEFINE(HAVE_BZIP2, 1, [Define in BZIP2 is available])
541 have_bzip2=yes],
542 [AS_IF([test "x$have_bzip2" = xyes], [AC_MSG_ERROR([*** BZIP2 support requested but headers not found])])
543 ])
8af3cf74
LP
544])
545AM_CONDITIONAL(HAVE_BZIP2, [test "$have_bzip2" = "yes"])
546
d89c8fdf
ZJS
547# ------------------------------------------------------------------------------
548have_lz4=no
549AC_ARG_ENABLE(lz4, AS_HELP_STRING([--enable-lz4], [Enable optional LZ4 support]))
0a7f0fcc 550AS_IF([test "x$enable_lz4" = "xyes"], [
d89c8fdf
ZJS
551 AC_CHECK_HEADERS(lz4.h,
552 [AC_DEFINE(HAVE_LZ4, 1, [Define in LZ4 is available]) have_lz4=yes],
553 [AC_MSG_ERROR([*** LZ4 support requested but headers not found])])
554])
555AM_CONDITIONAL(HAVE_LZ4, [test "$have_lz4" = "yes"])
556
3b1a55e1
ZJS
557AM_CONDITIONAL(HAVE_COMPRESSION, [test "$have_xz" = "yes" -o "$have_lz4" = "yes"])
558
3e214785 559# ------------------------------------------------------------------------------
5b6319dc
LP
560AC_ARG_ENABLE([pam],
561 AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
562 [case "${enableval}" in
563 yes) have_pam=yes ;;
564 no) have_pam=no ;;
565 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
566 esac],
567 [have_pam=auto])
568
569if test "x${have_pam}" != xno ; then
570 AC_CHECK_HEADERS(
571 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
572 [have_pam=yes],
573 [if test "x$have_pam" = xyes ; then
574 AC_MSG_ERROR([*** PAM headers not found.])
575 fi])
576
577 AC_CHECK_LIB(
578 [pam],
579 [pam_syslog],
580 [have_pam=yes],
581 [if test "x$have_pam" = xyes ; then
582 AC_MSG_ERROR([*** libpam not found.])
583 fi])
584
585 if test "x$have_pam" = xyes ; then
586 PAM_LIBS="-lpam -lpam_misc"
587 AC_DEFINE(HAVE_PAM, 1, [PAM available])
6a6751fe 588 M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
812cce32
LP
589 else
590 have_pam=no
5b6319dc
LP
591 fi
592else
593 PAM_LIBS=
594fi
595AC_SUBST(PAM_LIBS)
596AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
597
3e214785 598# ------------------------------------------------------------------------------
5eda94dd
LP
599AC_ARG_ENABLE([acl],
600 AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
601 [case "${enableval}" in
602 yes) have_acl=yes ;;
603 no) have_acl=no ;;
604 *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
605 esac],
606 [have_acl=auto])
607
608if test "x${have_acl}" != xno ; then
609 AC_CHECK_HEADERS(
610 [sys/acl.h acl/libacl.h],
611 [have_acl=yes],
612 [if test "x$have_acl" = xyes ; then
613 AC_MSG_ERROR([*** ACL headers not found.])
614 fi])
615
616 AC_CHECK_LIB(
617 [acl],
618 [acl_get_file],
619 [have_acl=yes],
620 [if test "x$have_acl" = xyes ; then
621 AC_MSG_ERROR([*** libacl not found.])
622 fi])
623
624 if test "x$have_acl" = xyes ; then
625 ACL_LIBS="-lacl"
626 AC_DEFINE(HAVE_ACL, 1, [ACL available])
a48a62a1 627 M4_DEFINES="$M4_DEFINES -DHAVE_ACL"
5eda94dd
LP
628 else
629 have_acl=no
630 fi
631else
632 ACL_LIBS=
633fi
634AC_SUBST(ACL_LIBS)
635AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
636
2b3e18de
KL
637# ------------------------------------------------------------------------------
638AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK support]),
639 [case "${enableval}" in
640 yes) have_smack=yes ;;
641 no) have_smack=no ;;
642 *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
643 esac],
644 [have_smack=auto])
645
d2edfae0
KS
646if test "x${have_smack}" = xauto; then
647 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
648 have_smack=yes
2b3e18de
KL
649fi
650
8b197c3a
AK
651AC_ARG_WITH(smack-run-label,
652AS_HELP_STRING([--with-smack-run-label=STRING],
e174dce2
WC
653 [run systemd --system itself with a specific SMACK label]),
654 [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run systemd itself with SMACK label])],
655 [])
656
657AC_ARG_WITH(smack-default-process-label,
658AS_HELP_STRING([--with-smack-default-process-label=STRING],
659 [default SMACK label for executed processes]),
660 [AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
8b197c3a
AK
661 [])
662
2b3e18de
KL
663if test "x${have_smack}" = xyes ; then
664 AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
665fi
666
dd5ae4c3
PK
667AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
668
7560fffc 669# ------------------------------------------------------------------------------
feb12d3e 670AC_ARG_ENABLE([gcrypt],
7560fffc
LP
671 AS_HELP_STRING([--disable-gcrypt],[Disable optional GCRYPT support]),
672 [case "${enableval}" in
673 yes) have_gcrypt=yes ;;
674 no) have_gcrypt=no ;;
675 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
676 esac],
677 [have_gcrypt=auto])
678
679if test "x${have_gcrypt}" != xno ; then
680 AM_PATH_LIBGCRYPT(
681 [1.4.5],
682 [have_gcrypt=yes],
683 [if test "x$have_gcrypt" = xyes ; then
684 AC_MSG_ERROR([*** GCRYPT headers not found.])
685 fi])
686
687 if test "x$have_gcrypt" = xyes ; then
688 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
689 GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS"
690 AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
691 else
692 have_gcrypt=no
693 fi
694else
695 GCRYPT_LIBS=
696 GCRYPT_CFLAGS=
697fi
698AC_SUBST(GCRYPT_LIBS)
699AC_SUBST(GCRYPT_CFLAGS)
700AM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
701
3e214785 702# ------------------------------------------------------------------------------
4927fcae
LP
703AC_ARG_ENABLE([audit],
704 AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
705 [case "${enableval}" in
706 yes) have_audit=yes ;;
707 no) have_audit=no ;;
708 *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
709 esac],
710 [have_audit=auto])
711
712if test "x${have_audit}" != xno ; then
713 AC_CHECK_HEADERS(
714 [libaudit.h],
715 [have_audit=yes],
716 [if test "x$have_audit" = xyes ; then
717 AC_MSG_ERROR([*** AUDIT headers not found.])
718 fi])
719
720 AC_CHECK_LIB(
721 [audit],
722 [audit_open],
723 [have_audit=yes],
724 [if test "x$have_audit" = xyes ; then
725 AC_MSG_ERROR([*** libaudit not found.])
726 fi])
727
728 if test "x$have_audit" = xyes ; then
729 AUDIT_LIBS="-laudit"
730 AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
731 else
732 have_audit=no
733 fi
734else
735 AUDIT_LIBS=
736fi
737AC_SUBST(AUDIT_LIBS)
4733607e 738AM_CONDITIONAL([HAVE_AUDIT], [test "x$have_audit" != xno])
4927fcae 739
8d4e028f
LP
740# ------------------------------------------------------------------------------
741AC_ARG_ENABLE([elfutils],
742 AS_HELP_STRING([--disable-elfutils],[Disable optional ELFUTILS support]),
743 [case "${enableval}" in
744 yes) have_elfutils=yes ;;
745 no) have_elfutils=no ;;
746 *) AC_MSG_ERROR(bad value ${enableval} for --disable-elfutils) ;;
747 esac],
748 [have_elfutils=auto])
749
750if test "x${have_elfutils}" != xno ; then
751 AC_CHECK_HEADERS(
752 [elfutils/libdwfl.h],
972bded0 753 [],
8d4e028f
LP
754 [if test "x$have_elfutils" = xyes ; then
755 AC_MSG_ERROR([*** ELFUTILS headers not found.])
756 fi])
757
758 AC_CHECK_LIB(
759 [dw],
760 [dwfl_begin],
972bded0 761 [],
8d4e028f
LP
762 [if test "x$have_elfutils" = xyes ; then
763 AC_MSG_ERROR([*** ELFUTILS libs not found.])
764 fi])
765
972bded0
MM
766 AC_CHECK_LIB(
767 [dw],
768 [dwfl_core_file_attach],
769 [have_elfutils=yes],
770 [if test "x$have_elfutils" = xyes ; then
771 AC_MSG_ERROR([*** ELFUTILS >= 158 is required.])
772 fi])
773
8d4e028f
LP
774 if test "x$have_elfutils" = xyes ; then
775 ELFUTILS_LIBS="-lelf -ldw"
776 AC_DEFINE(HAVE_ELFUTILS, 1, [ELFUTILS available])
777 else
778 have_elfutils=no
779 fi
780else
781 ELFUTILS_LIBS=
782fi
783AC_SUBST(ELFUTILS_LIBS)
784AM_CONDITIONAL(HAVE_ELFUTILS, [test "$have_elfutils" = "yes"])
785
3e214785 786# ------------------------------------------------------------------------------
7f4e0805
LP
787have_libcryptsetup=no
788AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
789if test "x$enable_libcryptsetup" != "xno"; then
8cf3ca80 790 PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.6.0 ],
7f4e0805 791 [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
7f4e0805 792 if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
591622d7 793 AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
7f4e0805
LP
794 fi
795fi
796AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
797
f6a971bc
LP
798# ------------------------------------------------------------------------------
799have_qrencode=no
800AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
801if test "x$enable_qrencode" != "xno"; then
802 PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
803 [AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
804 if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
805 AC_MSG_ERROR([*** qrencode support requested but libraries not found])
806 fi
807fi
808AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
809
7b17a7d7
LP
810# ------------------------------------------------------------------------------
811have_microhttpd=no
812AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
813if test "x$enable_microhttpd" != "xno"; then
3f573096 814 PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.33],
7b17a7d7
LP
815 [AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available]) have_microhttpd=yes], have_microhttpd=no)
816 if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
817 AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
818 fi
819fi
820AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
821
60313199
ZJS
822# ------------------------------------------------------------------------------
823have_gnutls=no
824AC_ARG_ENABLE(gnutls, AS_HELP_STRING([--disable-gnutls], [disable gnutls support]))
825if test "x$enable_gnutls" != "xno"; then
f12be7e8 826 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.1.4],
60313199
ZJS
827 [AC_DEFINE(HAVE_GNUTLS, 1, [Define if gnutls is available]) have_gnutls=yes], have_gnutls=no)
828 if test "x$have_gnutls" = xno -a "x$enable_gnutls" = xyes; then
829 AC_MSG_ERROR([*** gnutls support requested but libraries not found])
830 fi
831fi
832AM_CONDITIONAL(HAVE_GNUTLS, [test "$have_gnutls" = "yes"])
833
36ef43ed
ZJS
834# ------------------------------------------------------------------------------
835have_libcurl=no
836AC_ARG_ENABLE(libcurl, AS_HELP_STRING([--disable-libcurl], [disable libcurl support]))
837if test "x$enable_libcurl" != "xno"; then
838 PKG_CHECK_MODULES(LIBCURL, [libcurl],
839 [AC_DEFINE(HAVE_LIBCURL, 1, [Define if libcurl is available]) have_libcurl=yes], have_libcurl=no)
840 if test "x$have_libcurl" = xno -a "x$enable_libcurl" = xyes; then
841 AC_MSG_ERROR([*** libcurl support requested but libraries not found])
842 fi
843fi
844AM_CONDITIONAL(HAVE_LIBCURL, [test "$have_libcurl" = "yes"])
845
bdf10b5b
LP
846# ------------------------------------------------------------------------------
847have_libidn=no
848AC_ARG_ENABLE(libidn, AS_HELP_STRING([--disable-libidn], [Disable optional LIBIDN support]))
849if test "x$enable_libidn" != "xno"; then
850 PKG_CHECK_MODULES(LIBIDN, [libidn],
851 [AC_DEFINE(HAVE_LIBIDN, 1, [Define if libidn is available])
852 have_libidn=yes
853 M4_DEFINES="$M4_DEFINES -DHAVE_LIBIDN"],
854 [have_libidn=no])
855 if test "x$have_libidn" = "xno" -a "x$enable_libidn" = "xyes"; then
856 AC_MSG_ERROR([*** libidn support requested but libraries not found])
857 fi
858fi
859AM_CONDITIONAL(HAVE_LIBIDN, [test "$have_libidn" = "yes"])
860
76917807
LP
861# ------------------------------------------------------------------------------
862have_libiptc=no
863AC_ARG_ENABLE(libiptc, AS_HELP_STRING([--disable-libiptc], [Disable optional LIBIPTC support]))
864if test "x$enable_libiptc" != "xno"; then
865 PKG_CHECK_MODULES(LIBIPTC, [libiptc],
866 [AC_DEFINE(HAVE_LIBIPTC, 1, [Define if libiptc is available])
867 have_libiptc=yes
868 M4_DEFINES="$M4_DEFINES -DHAVE_LIBIPTC"],
869 [have_libiptc=no])
870 if test "x$have_libiptc" = "xno" -a "x$enable_libiptc" = "xyes"; then
871 AC_MSG_ERROR([*** libiptc support requested but libraries not found])
872 fi
873fi
874AM_CONDITIONAL(HAVE_LIBIPTC, [test "$have_libiptc" = "yes"])
875
3e214785 876# ------------------------------------------------------------------------------
27669061
MV
877have_binfmt=no
878AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
879if test "x$enable_binfmt" != "xno"; then
be31376e 880 have_binfmt=yes
27669061
MV
881fi
882AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
883
3e214785 884# ------------------------------------------------------------------------------
e5e83e83
LP
885have_vconsole=no
886AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
887if test "x$enable_vconsole" != "xno"; then
be31376e 888 have_vconsole=yes
e5e83e83
LP
889fi
890AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
891
83fdc450
AK
892# ------------------------------------------------------------------------------
893have_bootchart=no
894AC_ARG_ENABLE(bootchart, AS_HELP_STRING([--disable-bootchart], [disable bootchart tool]))
895if test "x$enable_bootchart" != "xno"; then
896 have_bootchart=yes
897fi
898AM_CONDITIONAL(ENABLE_BOOTCHART, [test "$have_bootchart" = "yes"])
899
3e214785 900# ------------------------------------------------------------------------------
4de85612
LP
901have_quotacheck=no
902AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
903if test "x$enable_quotacheck" != "xno"; then
be31376e 904 have_quotacheck=yes
4de85612
LP
905fi
906AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
907
6351163b
UTL
908# ------------------------------------------------------------------------------
909have_tmpfiles=no
910AC_ARG_ENABLE(tmpfiles, AS_HELP_STRING([--disable-tmpfiles], [disable tmpfiles support]))
911if test "x$enable_tmpfiles" != "xno"; then
912 have_tmpfiles=yes
913fi
914AM_CONDITIONAL(ENABLE_TMPFILES, [test "$have_tmpfiles" = "yes"])
915
1b992147
LP
916# ------------------------------------------------------------------------------
917have_sysusers=no
918AC_ARG_ENABLE(sysusers, AS_HELP_STRING([--disable-sysusers], [disable sysusers support]))
919if test "x$enable_sysusers" != "xno"; then
920 have_sysusers=yes
921fi
922AM_CONDITIONAL(ENABLE_SYSUSERS, [test "$have_sysusers" = "yes"])
923
418b9be5
LP
924# ------------------------------------------------------------------------------
925have_firstboot=no
926AC_ARG_ENABLE(firstboot, AS_HELP_STRING([--disable-firstboot], [disable firstboot support]))
927if test "x$enable_firstboot" != "xno"; then
928 have_firstboot=yes
929fi
930AM_CONDITIONAL(ENABLE_FIRSTBOOT, [test "$have_firstboot" = "yes"])
931
3e214785 932# ------------------------------------------------------------------------------
4de85612
LP
933have_randomseed=no
934AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
935if test "x$enable_randomseed" != "xno"; then
be31376e 936 have_randomseed=yes
4de85612
LP
937fi
938AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
939
3731acf1
LP
940# ------------------------------------------------------------------------------
941have_backlight=no
942AC_ARG_ENABLE(backlight, AS_HELP_STRING([--disable-backlight], [disable backlight tools]))
943if test "x$enable_backlight" != "xno"; then
944 have_backlight=yes
945fi
946AM_CONDITIONAL(ENABLE_BACKLIGHT, [test "$have_backlight" = "yes"])
947
3990f247
LP
948# ------------------------------------------------------------------------------
949have_rfkill=no
950AC_ARG_ENABLE(rfkill, AS_HELP_STRING([--disable-rfkill], [disable rfkill tools]))
951if test "x$enable_rfkill" != "xno"; then
952 have_rfkill=yes
953fi
954AM_CONDITIONAL(ENABLE_RFKILL, [test "$have_rfkill" = "yes"])
955
3e214785 956# ------------------------------------------------------------------------------
2a018e83
KS
957have_logind=no
958AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
959if test "x$enable_logind" != "xno"; then
be31376e 960 have_logind=yes
2a018e83
KS
961fi
962AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
4c80c73c 963AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
2a018e83 964
1ee306e1
LP
965# ------------------------------------------------------------------------------
966have_machined=no
967AC_ARG_ENABLE(machined, AS_HELP_STRING([--disable-machined], [disable machine daemon]))
968if test "x$enable_machined" != "xno"; then
969 have_machined=yes
970fi
971AM_CONDITIONAL(ENABLE_MACHINED, [test "$have_machined" = "yes"])
972AS_IF([test "$have_machined" = "yes"], [ AC_DEFINE(HAVE_MACHINED, [1], [Machined support available]) ])
973
3d7415f4
LP
974# ------------------------------------------------------------------------------
975have_importd=no
976AC_ARG_ENABLE(importd, AS_HELP_STRING([--disable-importd], [disable import daemon]))
977if test "x$enable_importd" != "xno"; then
978 have_importd=yes
979fi
980AM_CONDITIONAL(ENABLE_IMPORTD, [test "$have_importd" = "yes"])
981AS_IF([test "$have_importd" = "yes"], [ AC_DEFINE(HAVE_IMPORTD, [1], [Importd support available]) ])
982
3e214785 983# ------------------------------------------------------------------------------
b2e9fb99
MV
984have_hostnamed=no
985AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
986if test "x$enable_hostnamed" != "xno"; then
be31376e 987 have_hostnamed=yes
b2e9fb99
MV
988fi
989AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
990
3e214785 991# ------------------------------------------------------------------------------
f47cd184
MV
992have_timedated=no
993AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
994if test "x$enable_timedated" != "xno"; then
be31376e 995 have_timedated=yes
f47cd184
MV
996fi
997AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
998
3e214785 999# ------------------------------------------------------------------------------
687ed123
KS
1000have_timesyncd=no
1001AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon]))
43ba1b3e 1002if test "x$enable_timesyncd" != "xno"; then
687ed123 1003 have_timesyncd=yes
5a16bc26 1004 M4_DEFINES="$M4_DEFINES -DENABLE_TIMESYNCD"
687ed123
KS
1005fi
1006AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"])
1007
e8af6973
LP
1008AC_ARG_WITH(ntp-servers,
1009 AS_HELP_STRING([--with-ntp-servers=NTPSERVERS],
1010 [Space-separated list of default NTP servers]),
1011 [NTP_SERVERS="$withval"],
2ed3de9c
LP
1012 [NTP_SERVERS="time1.google.com time2.google.com time3.google.com time4.google.com"
1013 AC_MSG_WARN([*** Using Google NTP servers. Please do not ship OSes or devices with these default settings. See DISTRO_PORTING for details!])])
e8af6973
LP
1014
1015AC_DEFINE_UNQUOTED(NTP_SERVERS, ["$NTP_SERVERS"], [Default NTP Servers])
1016AC_SUBST(NTP_SERVERS)
1017
661278ee
LP
1018AC_ARG_WITH(time-epoch,
1019 AS_HELP_STRING([--with-time-epoch=SECONDS],
5ea846cc 1020 [Time epoch for time clients]),
661278ee
LP
1021 [TIME_EPOCH="$withval"],
1022 [TIME_EPOCH="`stat -c %Y ${srcdir}/NEWS 2>/dev/null || echo 0`"])
1023
1024AC_DEFINE_UNQUOTED(TIME_EPOCH, [$TIME_EPOCH], [Time Epoch])
1025
f7dc3ab9
LP
1026# ------------------------------------------------------------------------------
1027AC_ARG_WITH(system-uid-max,
1028 AS_HELP_STRING([--with-system-uid-max=UID]
1029 [Maximum UID for system users]),
1030 [SYSTEM_UID_MAX="$withval"],
1031 [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`"])
1032
1033AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
1034AC_SUBST(SYSTEM_UID_MAX)
1035
1036# ------------------------------------------------------------------------------
1037AC_ARG_WITH(system-gid-max,
1038 AS_HELP_STRING([--with-system-gid-max=GID]
1039 [Maximum GID for system groups]),
1040 [SYSTEM_GID_MAX="$withval"],
1041 [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`"])
1042
1043AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
1044AC_SUBST(SYSTEM_GID_MAX)
1045
687ed123 1046# ------------------------------------------------------------------------------
4cd1eaa5
MV
1047have_localed=no
1048AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
1049if test "x$enable_localed" != "xno"; then
be31376e 1050 have_localed=yes
4cd1eaa5
MV
1051fi
1052AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
1053
3e214785 1054# ------------------------------------------------------------------------------
f5e04665
LP
1055have_coredump=no
1056AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
1057if test "x$enable_coredump" != "xno"; then
be31376e 1058 have_coredump=yes
f5e04665
LP
1059fi
1060AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
1061
46ba8aae
LP
1062# ------------------------------------------------------------------------------
1063have_polkit=no
1064AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
1065if test "x$enable_polkit" != "xno"; then
1066 AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
1067 have_polkit=yes
1068fi
1069AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
1070
3c9317d2 1071# ------------------------------------------------------------------------------
091a364c
TG
1072have_resolved=no
1073AC_ARG_ENABLE(resolved, AS_HELP_STRING([--disable-resolved], [disable resolve daemon]))
1074if test "x$enable_resolved" != "xno"; then
1075 have_resolved=yes
aeb50ff0 1076 M4_DEFINES="$M4_DEFINES -DENABLE_RESOLVED"
3c9317d2 1077fi
091a364c 1078AM_CONDITIONAL(ENABLE_RESOLVED, [test "$have_resolved" = "yes"])
3c9317d2 1079
e16cb2e4
TG
1080AC_ARG_WITH(dns-servers,
1081 AS_HELP_STRING([--with-dns-servers=DNSSERVERS],
1082 [Space-separated list of default DNS servers]),
49e5c2b2 1083 [DNS_SERVERS="$withval"],
7b4d7968 1084 [DNS_SERVERS="8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844"])
e16cb2e4
TG
1085
1086AC_DEFINE_UNQUOTED(DNS_SERVERS, ["$DNS_SERVERS"], [Default DNS Servers])
1087AC_SUBST(DNS_SERVERS)
1088
091a364c
TG
1089# ------------------------------------------------------------------------------
1090have_networkd=no
1091AC_ARG_ENABLE(networkd, AS_HELP_STRING([--disable-networkd], [disable networkd]))
81577dc2 1092AS_IF([test "x$enable_networkd" != "xno"], [
091a364c
TG
1093 AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled])
1094 have_networkd=yes
5a16bc26 1095 M4_DEFINES="$M4_DEFINES -DENABLE_NETWORKD"
81577dc2 1096])
091a364c
TG
1097AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"])
1098
b872e9a0
LP
1099# ------------------------------------------------------------------------------
1100have_efi=no
1101AC_ARG_ENABLE(efi, AS_HELP_STRING([--disable-efi], [disable EFI support]))
1102if test "x$enable_efi" != "xno"; then
1103 AC_DEFINE(ENABLE_EFI, 1, [Define if EFI support is to be enabled])
1104 have_efi=yes
1105fi
1106AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
1107
0fa2cac4 1108# ------------------------------------------------------------------------------
63e69fb4 1109AC_CHECK_TOOL(EFI_CC, gcc)
0fa2cac4
KS
1110
1111EFI_ARCH=`echo $host | sed "s/\(-\).*$//"`
1112
1113AM_COND_IF(ARCH_IA32, [
1114 EFI_ARCH=ia32
1115 EFI_MACHINE_TYPE_NAME=ia32])
1116
1117AM_COND_IF(ARCH_X86_64, [
1118 EFI_MACHINE_TYPE_NAME=x64])
1119
4c6abc93
KK
1120AM_COND_IF(ARCH_AARCH64, [
1121 EFI_MACHINE_TYPE_NAME=aa64])
1122
0fa2cac4
KS
1123AC_SUBST([EFI_ARCH])
1124AC_SUBST([EFI_MACHINE_TYPE_NAME])
1125
1126have_gnuefi=no
1127AC_ARG_ENABLE(gnuefi, AS_HELP_STRING([--enable-gnuefi], [Disable optional gnuefi support]))
1128AS_IF([test "x$enable_gnuefi" != "xno"], [
1129 AC_CHECK_HEADERS(efi/${EFI_ARCH}/efibind.h,
1130 [AC_DEFINE(HAVE_GNUEFI, 1, [Define if gnuefi is available])
1131 have_gnuefi=yes],
1d64e14c
ZJS
1132 [AS_IF([test "x$enable_gnuefi" = xyes],
1133 [AC_MSG_ERROR([*** gnuefi support requested but headers not found])])
0fa2cac4 1134 ])
0fa2cac4 1135
531ddb91 1136 efiroot=$(echo $(cd /usr/lib/$(${EFI_CC} -print-multi-os-directory); pwd))
0fa2cac4
KS
1137
1138 EFI_LIB_DIR="$efiroot"
1139 AC_ARG_WITH(efi-libdir,
1d64e14c 1140 AS_HELP_STRING([--with-efi-libdir=PATH], [Path to EFI lib directory]),
0fa2cac4
KS
1141 [EFI_LIB_DIR="$withval"], [EFI_LIB_DIR="$efiroot"]
1142 )
1143 AC_SUBST([EFI_LIB_DIR])
1144
1d64e14c 1145 have_efi_lds=no
0fa2cac4 1146 AC_ARG_WITH(efi-ldsdir,
1d64e14c 1147 AS_HELP_STRING([--with-efi-ldsdir=PATH], [Path to EFI lds directory]),
efbef003
MT
1148 [EFI_LDS_DIR="$withval" && AC_CHECK_FILE([${EFI_LDS_DIR}/elf_${EFI_ARCH}_efi.lds],
1149 [have_efi_lds=yes])],
297f24a9 1150 [AS_FOR([DIR], [EFI_LDS_DIR], ["${EFI_LIB_DIR}/gnuefi" "${EFI_LIB_DIR}"],
efbef003 1151 [AC_CHECK_FILE([${EFI_LDS_DIR}/elf_${EFI_ARCH}_efi.lds],
1d64e14c
ZJS
1152 [have_efi_lds=yes && break])])])
1153 AS_IF([test "x$have_efi_lds" = xyes],
1154 [AC_SUBST([EFI_LDS_DIR])],
1155 [AS_IF([test "x$enable_gnuefi" = xyes],
1156 [AC_MSG_ERROR([*** gnuefi support requested but files not found])],
1157 [have_gnuefi=no])])
0fa2cac4
KS
1158
1159 AC_ARG_WITH(efi-includedir,
1d64e14c 1160 AS_HELP_STRING([--with-efi-includedir=PATH], [Path to EFI include directory]),
0fa2cac4
KS
1161 [EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"]
1162 )
1163 AC_SUBST([EFI_INC_DIR])
1d64e14c
ZJS
1164])
1165AM_CONDITIONAL(HAVE_GNUEFI, [test "x$have_gnuefi" = xyes])
0fa2cac4 1166
84da4a30 1167# ------------------------------------------------------------------------------
10bc4cd4
ZJS
1168AC_ARG_WITH(unifont,
1169 AS_HELP_STRING([--with-unifont=PATH],
1170 [Path to unifont.hex]),
1171 [UNIFONT="$withval"],
1172 [UNIFONT="/usr/share/unifont/unifont.hex"])
1173AC_SUBST(UNIFONT)
1174
84da4a30 1175have_terminal=no
10bc4cd4 1176have_unifont=no
84da4a30
DH
1177AC_ARG_ENABLE(terminal, AS_HELP_STRING([--enable-terminal], [enable terminal support]))
1178if test "x$enable_terminal" = "xyes"; then
cdcd0ccd 1179 PKG_CHECK_MODULES([TERMINAL], [ libevdev >= 1.2 xkbcommon >= 0.5 libdrm >= 2.4], [have_terminal=yes])
10bc4cd4
ZJS
1180 AC_CHECK_FILE($UNIFONT, [have_unifont=yes])
1181 AS_IF([test "x$have_terminal" != xyes -o "x$have_unifont" != "xyes" -a "x$enable_terminal" = xyes],
c93e5a62 1182 [AC_MSG_ERROR([*** terminal support requested but required dependencies not available])],
10bc4cd4 1183 [test "x$have_terminal" = xyes -a "x$have_unifont" = "xyes"],
c93e5a62 1184 [AC_DEFINE(ENABLE_TERMINAL, 1, [Define if terminal support is to be enabled])])
84da4a30 1185fi
10bc4cd4 1186AM_CONDITIONAL(ENABLE_TERMINAL, [test "x$have_terminal" = "xyes" -a "x$have_unifont" = "xyes"])
84da4a30 1187
626851be
LP
1188# ------------------------------------------------------------------------------
1189have_kdbus=no
1b09f548
KS
1190AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--disable-kdbus], [do not connect to kdbus by default]))
1191if test "x$enable_kdbus" != "xno"; then
1192 AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus is to be connected to by default])
626851be 1193 have_kdbus=yes
4acbce79 1194 M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
626851be
LP
1195fi
1196AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
1197
b1c4ca25
LP
1198# ------------------------------------------------------------------------------
1199AC_ARG_WITH(rc-local-script-path-start,
1200 AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
1201 [Path to /etc/rc.local]),
1202 [RC_LOCAL_SCRIPT_PATH_START="$withval"],
1203 [RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
1204
1205AC_ARG_WITH(rc-local-script-path-stop,
1206 AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
bc270841 1207 [Path to /usr/sbin/halt.local]),
b1c4ca25 1208 [RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
bc270841 1209 [RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
b1c4ca25
LP
1210
1211AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
bc270841 1212AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
b1c4ca25
LP
1213
1214AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
1215AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
1216
a382332e
LP
1217# ------------------------------------------------------------------------------
1218AC_ARG_WITH(kbd-loadkeys,
1219 AS_HELP_STRING([--with-kbd-loadkeys=PATH],
1220 [Path to loadkeys]),
1221 [KBD_LOADKEYS="$withval"],
1222 [KBD_LOADKEYS="/usr/bin/loadkeys"])
1223
1224AC_ARG_WITH(kbd-setfont,
1225 AS_HELP_STRING([--with-kbd-setfont=PATH],
1226 [Path to setfont]),
1227 [KBD_SETFONT="$withval"],
1228 [KBD_SETFONT="/usr/bin/setfont"])
1229
1230AC_DEFINE_UNQUOTED(KBD_LOADKEYS, ["$KBD_LOADKEYS"], [Path of loadkeys])
1231AC_DEFINE_UNQUOTED(KBD_SETFONT, ["$KBD_SETFONT"], [Path of setfont])
1232
1233AC_SUBST(KBD_LOADKEYS)
1234AC_SUBST(KBD_SETFONT)
1235
4ad61fd1
CR
1236AC_ARG_WITH(telinit,
1237 AS_HELP_STRING([--with-telinit=PATH],
1238 [Path to telinit]),
1239 [TELINIT="$withval"],
abaaabf4 1240 [TELINIT="/lib/sysvinit/telinit"])
4ad61fd1
CR
1241
1242AC_DEFINE_UNQUOTED(TELINIT, ["$TELINIT"], [Path to telinit])
1243
1244AC_SUBST(TELINIT)
1245
54b434b1 1246AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
7211f918 1247
d562955e
TG
1248# ------------------------------------------------------------------------------
1249have_myhostname=no
f8c5a581 1250AC_ARG_ENABLE(myhostname, AS_HELP_STRING([--disable-myhostname], [disable nss-myhostname support]))
d562955e
TG
1251if test "x$enable_myhostname" != "xno"; then
1252 AC_HEADER_STDC
a3b6fafe 1253 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])
d562955e
TG
1254
1255 AC_C_CONST
1256 AC_TYPE_SIZE_T
1257 AC_HEADER_TIME
1258
1259 AC_FUNC_MALLOC
1260 AC_FUNC_SELECT_ARGTYPES
1261 AC_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
1262
1263 have_myhostname=yes
1264fi
1265AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
1266
fe659612
UTL
1267# ------------------------------------------------------------------------------
1268AC_ARG_ENABLE(hwdb, [AC_HELP_STRING([--disable-hwdb], [disable hardware database support])],
1269 enable_hwdb=$enableval, enable_hwdb=yes)
1270AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes])
1271
3e214785 1272# ------------------------------------------------------------------------------
75db9a77 1273have_manpages=no
4c2b0e4e 1274AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
4ca39b28 1275AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
fe1fed02 1276AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
75db9a77 1277
4df5c00b
UTL
1278# ------------------------------------------------------------------------------
1279AC_ARG_ENABLE(hibernate,
1280 [AC_HELP_STRING([--disable-hibernate], [disable hibernation support])],
1281 enable_hibernate=$enableval, enable_hibernate=yes)
1282AM_CONDITIONAL(ENABLE_HIBERNATE, [test x$enable_hibernate = xyes])
1283
3e214785 1284# ------------------------------------------------------------------------------
12e34d9d
UTL
1285AC_ARG_ENABLE(ldconfig,
1286 [AC_HELP_STRING([--disable-ldconfig], [disable ldconfig])],
1287 enable_ldconfig=$enableval, enable_ldconfig=yes)
1288AM_CONDITIONAL(ENABLE_LDCONFIG, [test x$enable_ldconfig = xyes])
d1ab0ca0 1289
12e34d9d 1290# ------------------------------------------------------------------------------
34eff652
LP
1291# Location of the init scripts as mandated by LSB
1292SYSTEM_SYSVINIT_PATH=/etc/init.d
f1dd0c3f 1293SYSTEM_SYSVRCND_PATH=/etc/rc.d
12e84679 1294
136337ff 1295AC_ARG_WITH([sysvinit-path],
be31376e 1296 [AS_HELP_STRING([--with-sysvinit-path=PATH],
bc270841 1297 [Specify the path to where the SysV init scripts are located])],
be31376e
KS
1298 [SYSTEM_SYSVINIT_PATH="$withval"],
1299 [])
136337ff 1300
dee4c244
LP
1301AC_ARG_WITH([sysvrcnd-path],
1302 [AS_HELP_STRING([--with-sysvrcnd-path=PATH],
bc270841 1303 [Specify the path to the base directory for the SysV rcN.d directories])],
136337ff
TFH
1304 [SYSTEM_SYSVRCND_PATH="$withval"],
1305 [])
1306
07459bb6
FF
1307if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
1308 AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
1309 SYSTEM_SYSV_COMPAT="yes"
f975e971 1310 M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
07459bb6 1311elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
dee4c244 1312 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.])
07459bb6
FF
1313else
1314 SYSTEM_SYSV_COMPAT="no"
1315fi
1316
bc270841
LP
1317AC_SUBST(SYSTEM_SYSVINIT_PATH)
1318AC_SUBST(SYSTEM_SYSVRCND_PATH)
1319AC_SUBST(M4_DEFINES)
1320
1321AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
1322
bef2733f 1323AC_ARG_WITH([tty-gid],
a05ea46d 1324 [AS_HELP_STRING([--with-tty-gid=GID],
bef2733f 1325 [Specify the numeric GID of the 'tty' group])],
f8b5d994
LP
1326 [TTY_GID="$withval"],
1327 [TTY_GID="5"])
1328
1329AC_DEFINE_UNQUOTED(TTY_GID, [$TTY_GID], [GID of the 'tty' group])
1330AC_SUBST(TTY_GID)
bef2733f 1331
d2d12cd1
LP
1332AC_ARG_WITH([dbuspolicydir],
1333 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
1334 [],
977db91c 1335 [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d])
dd334850 1336AX_NORMALIZE_PATH([with_dbuspolicydir])
d122948d 1337
d2d12cd1
LP
1338AC_ARG_WITH([dbussessionservicedir],
1339 AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
1340 [],
977db91c 1341 [with_dbussessionservicedir=${datadir}/dbus-1/services])
dd334850 1342AX_NORMALIZE_PATH([with_dbussessionservicedir])
d122948d 1343
d2d12cd1
LP
1344AC_ARG_WITH([dbussystemservicedir],
1345 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
1346 [],
977db91c 1347 [with_dbussystemservicedir=${datadir}/dbus-1/system-services])
dd334850 1348AX_NORMALIZE_PATH([with_dbussystemservicedir])
d122948d 1349
db059f1b
MB
1350AC_ARG_WITH([bashcompletiondir],
1351 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
1352 [],
25ee45f9
MB
1353 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
1354 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
db059f1b
MB
1355 ] , [
1356 with_bashcompletiondir=${datadir}/bash-completion/completions
1357 ])])
dd334850 1358AX_NORMALIZE_PATH([with_bashcompletiondir])
db059f1b 1359
4f87c47b
WG
1360AC_ARG_WITH([zshcompletiondir],
1361 AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
1362 [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
dd334850 1363AX_NORMALIZE_PATH([with_zshcompletiondir])
4f87c47b 1364
b8079ae1
KS
1365AC_ARG_WITH([rootprefix],
1366 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
39ad55a9 1367 [], [with_rootprefix=${ac_default_prefix}])
e013d21b
FB
1368# --with-rootprefix= (empty) should default to "/" but AX_NORMALIZE_PATH
1369# defaults those to ".", solve that here for now until we can find a suitable
1370# fix for AX_NORMALIZE_PATH upstream at autoconf-archive.
1371# See: https://github.com/systemd/systemd/issues/54
1372if test "x${with_rootprefix}" = "x"; then
1373 with_rootprefix="/"
1374fi
dd334850 1375AX_NORMALIZE_PATH([with_rootprefix])
d2d12cd1 1376
ae446765
KS
1377AC_ARG_WITH([rootlibdir],
1378 AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
1379 [],
1380 [with_rootlibdir=${libdir}])
dd334850 1381AX_NORMALIZE_PATH([with_rootlibdir])
ae446765 1382
9d3203b4 1383AC_ARG_WITH([pamlibdir],
b0cca7d8 1384 AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
9d3203b4
KS
1385 [],
1386 [with_pamlibdir=${with_rootlibdir}/security])
dd334850 1387AX_NORMALIZE_PATH([with_pamlibdir])
9d3203b4 1388
5c390a4a
ZJS
1389AC_ARG_WITH([pamconfdir],
1390 AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
1391 [],
1392 [with_pamconfdir=${sysconfdir}/pam.d])
dd334850 1393AX_NORMALIZE_PATH([with_pamconfdir])
5c390a4a 1394
bc9bdbba
MG
1395AC_ARG_ENABLE([split-usr],
1396 AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
1397 [],
1398 [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
1399 enable_split_usr=yes
1400 ], [
1401 enable_split_usr=no
1402 ])])
1403
91f4347e
LP
1404AC_ARG_WITH([dkr-index-url],
1405 [AS_HELP_STRING([--dkr-index-url=URL], [Specify the default index URL to use for image downloads])],
1406 [DEFAULT_DKR_INDEX_URL="\"$withval\""],
1407 [DEFAULT_DKR_INDEX_URL="NULL"])
1408
1409AC_DEFINE_UNQUOTED(DEFAULT_DKR_INDEX_URL, [$DEFAULT_DKR_INDEX_URL], [Default index URL to use for image downloads])
1410AC_SUBST(DEFAULT_DKR_INDEX_URL)
1411
bc9bdbba 1412AS_IF([test "x${enable_split_usr}" = "xyes"], [
2c6db6fb 1413 AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
bc9bdbba 1414])
2fe9e87a 1415AM_CONDITIONAL(ENABLE_SPLIT_USR, [test "x${enable_split_usr}" = "xyes"])
2c6db6fb 1416
06528e8f
DM
1417# work around intltool-update issues during 'make distcheck'
1418AS_IF([test "x$0" != "x./configure"], [
1419 AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
1420])
1421
0fa2cac4
KS
1422# QEMU and OVMF UEFI firmware
1423AS_IF([test x"$cross_compiling" = "xyes"], [], [
1424 AC_PATH_PROG([QEMU], [qemu-system-x86_64])
1d64e14c
ZJS
1425 AC_CHECK_FILE([/usr/share/qemu/bios-ovmf.bin], [QEMU_BIOS=/usr/share/qemu/bios-ovmf.bin],
1426 [AC_CHECK_FILE([/usr/share/qemu-ovmf/bios.bin], [QEMU_BIOS=/usr/share/qemu-ovmf/bios.bin])])
0fa2cac4
KS
1427 AC_SUBST([QEMU_BIOS])
1428])
1429
cee22bd3 1430AC_ARG_ENABLE(tests,
fc86aa0e
MS
1431 [AC_HELP_STRING([--disable-tests], [disable tests])],
1432 enable_tests=$enableval, enable_tests=yes)
cee22bd3
HGB
1433AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
1434
fc86aa0e 1435AC_ARG_ENABLE(debug,
fad5a6c6 1436 [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap,mmap-cache)])],
fc86aa0e 1437 [if test "x$enableval" = "xyes"; then
fad5a6c6 1438 enableval="hashmap,mmap-cache"
fc86aa0e
MS
1439 fi
1440 saved_ifs="$IFS"
1441 IFS="$IFS$PATH_SEPARATOR,"
1442 for name in $enableval; do
1443 case $name in
1444 hashmap)
1445 enable_debug_hashmap=yes
1446 ;;
fad5a6c6
MS
1447 mmap-cache)
1448 enable_debug_mmap_cache=yes
1449 ;;
fc86aa0e
MS
1450 esac
1451 done
1452 IFS="$saved_ifs"],[])
1453
1454enable_debug=""
1455AS_IF([test x$enable_debug_hashmap = xyes], [
1456 AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
1457 enable_debug="hashmap $enable_debug"
1458])
fad5a6c6
MS
1459AS_IF([test x$enable_debug_mmap_cache = xyes], [
1460 AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled])
1461 enable_debug="mmap-cache $enable_debug"
99470154 1462])
fc86aa0e 1463test -z "$enable_debug" && enable_debug="none"
99470154 1464
d2d12cd1
LP
1465AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
1466AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
1467AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
db059f1b 1468AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
4f87c47b 1469AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
8c6db833 1470AC_SUBST([pamlibdir], [$with_pamlibdir])
5c390a4a 1471AC_SUBST([pamconfdir], [$with_pamconfdir])
b8079ae1 1472AC_SUBST([rootprefix], [$with_rootprefix])
ae446765 1473AC_SUBST([rootlibdir], [$with_rootlibdir])
8c4a3079 1474
3e214785 1475AC_CONFIG_FILES([
23756070
KS
1476 Makefile
1477 po/Makefile.in
3e214785
KS
1478])
1479
a45a909f 1480AC_OUTPUT
ae446765 1481AC_MSG_RESULT([
0571e011
LP
1482 $PACKAGE_NAME $VERSION
1483
7f4e0805 1484 libcryptsetup: ${have_libcryptsetup}
5b6319dc 1485 PAM: ${have_pam}
12716238 1486 AUDIT: ${have_audit}
81611586 1487 IMA: ${have_ima}
eef65bf3 1488 AppArmor: ${have_apparmor}
12716238 1489 SELinux: ${have_selinux}
c0467cf3 1490 SECCOMP: ${have_seccomp}
2b3e18de 1491 SMACK: ${have_smack}
edce2aed 1492 ZLIB: ${have_zlib}
807e17f0 1493 XZ: ${have_xz}
d89c8fdf 1494 LZ4: ${have_lz4}
8af3cf74 1495 BZIP2: ${have_bzip2}
5eda94dd 1496 ACL: ${have_acl}
7560fffc 1497 GCRYPT: ${have_gcrypt}
f6a971bc 1498 QRENCODE: ${have_qrencode}
7b17a7d7 1499 MICROHTTPD: ${have_microhttpd}
60313199 1500 GNUTLS: ${have_gnutls}
36ef43ed 1501 libcurl: ${have_libcurl}
bdf10b5b 1502 libidn: ${have_libidn}
76917807 1503 libiptc: ${have_libiptc}
8d4e028f 1504 ELFUTILS: ${have_elfutils}
27669061 1505 binfmt: ${have_binfmt}
e5e83e83 1506 vconsole: ${have_vconsole}
83fdc450 1507 bootchart: ${have_bootchart}
4de85612 1508 quotacheck: ${have_quotacheck}
6351163b 1509 tmpfiles: ${have_tmpfiles}
1b992147 1510 sysusers: ${have_sysusers}
418b9be5 1511 firstboot: ${have_firstboot}
4de85612 1512 randomseed: ${have_randomseed}
3731acf1 1513 backlight: ${have_backlight}
3990f247 1514 rfkill: ${have_rfkill}
2a018e83 1515 logind: ${have_logind}
1ee306e1 1516 machined: ${have_machined}
3d7415f4 1517 importd: ${have_importd}
b2e9fb99 1518 hostnamed: ${have_hostnamed}
f47cd184 1519 timedated: ${have_timedated}
a91df40e 1520 timesyncd: ${have_timesyncd}
e8af6973 1521 default NTP servers: ${NTP_SERVERS}
661278ee 1522 time epoch: ${TIME_EPOCH}
4cd1eaa5 1523 localed: ${have_localed}
7a243b22 1524 networkd: ${have_networkd}
091a364c 1525 resolved: ${have_resolved}
e16cb2e4 1526 default DNS servers: ${DNS_SERVERS}
f5e04665 1527 coredump: ${have_coredump}
46ba8aae 1528 polkit: ${have_polkit}
b872e9a0 1529 efi: ${have_efi}
0fa2cac4
KS
1530 gnuefi: ${have_gnuefi}
1531 efi arch: ${EFI_ARCH}
1532 EFI machine type: ${EFI_MACHINE_TYPE_NAME}
1533 EFI CC ${EFI_CC}
1534 EFI libdir: ${EFI_LIB_DIR}
1535 EFI ldsdir: ${EFI_LDS_DIR}
1536 EFI includedir: ${EFI_INC_DIR}
e3043162 1537 kmod: ${have_kmod}
d4f5a1f4 1538 xkbcommon: ${have_xkbcommon}
f553b3b1 1539 blkid: ${have_blkid}
8d3ae2bd 1540 libmount: ${have_libmount}
ac6b760c 1541 dbus: ${have_dbus}
d562955e 1542 nss-myhostname: ${have_myhostname}
fe659612 1543 hwdb: ${enable_hwdb}
84da4a30 1544 terminal: ${have_terminal}
626851be 1545 kdbus: ${have_kdbus}
8d7e170a 1546 Python: ${have_python}
2f4da3e6 1547 man pages: ${have_manpages}
6aea6d10 1548 test coverage: ${have_coverage}
2f4da3e6
ZJS
1549 Split /usr: ${enable_split_usr}
1550 SysV compatibility: ${SYSTEM_SYSV_COMPAT}
53e856e1 1551 compatibility libraries: ${have_compat_libs}
37161c51 1552 utmp/wtmp support: ${have_utmp}
3383f7e9
UTL
1553 ldconfig support: ${enable_ldconfig}
1554 hibernate support: ${enable_hibernate}
fc86aa0e 1555 extra debugging: ${enable_debug}
3e214785 1556
8c4a3079 1557 prefix: ${prefix}
b8079ae1 1558 rootprefix: ${with_rootprefix}
3e214785
KS
1559 sysconf dir: ${sysconfdir}
1560 datarootdir: ${datarootdir}
1561 includedir: ${includedir}
ae446765
KS
1562 lib dir: ${libdir}
1563 rootlib dir: ${with_rootlibdir}
2f4da3e6
ZJS
1564 SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
1565 SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
1566 Build Python: ${PYTHON}
f2ec0646 1567 sphinx binary: ${SPHINX_BUILD}
2c6db6fb 1568 PAM modules dir: ${with_pamlibdir}
5c390a4a 1569 PAM configuration dir: ${with_pamconfdir}
2c6db6fb
LP
1570 D-Bus policy dir: ${with_dbuspolicydir}
1571 D-Bus session dir: ${with_dbussessionservicedir}
1572 D-Bus system dir: ${with_dbussystemservicedir}
db059f1b 1573 Bash completions dir: ${with_bashcompletiondir}
4f87c47b 1574 Zsh completions dir: ${with_zshcompletiondir}
b1c4ca25
LP
1575 Extra start script: ${RC_LOCAL_SCRIPT_PATH_START}
1576 Extra stop script: ${RC_LOCAL_SCRIPT_PATH_STOP}
45df1f2c 1577 Debug shell: ${SUSHELL} @ ${DEBUGTTY}
f8b5d994 1578 TTY GID: ${TTY_GID}
f7dc3ab9
LP
1579 Maximum System UID: ${SYSTEM_UID_MAX}
1580 Maximum System GID: ${SYSTEM_GID_MAX}
ad95fd1d 1581 Certificate root: ${CERTIFICATEROOT}
91f4347e 1582 Default dkr Index ${DEFAULT_DKR_INDEX_URL}
66be6554 1583
5a45a936 1584 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
1f048a6b 1585 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
5a45a936 1586 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
ae446765 1587])