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