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