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