]> git.ipfire.org Git - thirdparty/systemd.git/blame - configure.ac
debug-shell: add condition for tty device to run on
[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],
42a04ee6 23 [214],
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])
4196a3ea 37AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
3e214785 38AM_SILENT_RULES([yes])
47be870b 39AC_CANONICAL_HOST
22be093f 40AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
d59d0a2b 41AS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" ||
42 test "x$host_cpu" = "xmips64" || test "x$host_cpu" = "xmips64el"],
43 [AC_DEFINE(ARCH_MIPS, [], [Whether on mips arch])])
47be870b 44
3e214785 45LT_PREREQ(2.2)
8666abb4 46LT_INIT([disable-static])
47be870b 47
5e63ce78 48AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by systemd])])
3d585edb 49AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by systemd])])
5e63ce78 50
1c7dde3e
BN
51# i18n stuff for the PolicyKit policy files
52IT_PROG_INTLTOOL([0.40.0])
53
54GETTEXT_PACKAGE=systemd
55AC_SUBST(GETTEXT_PACKAGE)
56
e9da3678
LP
57AC_PROG_MKDIR_P
58AC_PROG_LN_S
59AC_PROG_SED
3ce4fad8 60AC_PROG_GREP
f975e971 61AC_PROG_AWK
e9da3678 62
47be870b 63AC_PROG_CC_C99
47be870b 64
3e214785 65AC_PATH_PROG([M4], [m4])
fe1fed02 66AC_PATH_PROG([XSLTPROC], [xsltproc])
92ec4495 67
2d0efdf1
SS
68AC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon], [$PATH:/usr/sbin:/sbin])
69AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck], [$PATH:/usr/sbin:/sbin])
b51fc639 70
2d0efdf1 71AC_PATH_PROG([KILL], [kill], [/usr/bin/kill], [$PATH:/usr/sbin:/sbin])
96ede260 72
2d0efdf1 73AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin])
edeb68c5 74
2d0efdf1 75AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
78013564 76
44688352
LP
77AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
78
4acbce79
ZJS
79M4_DEFINES=
80
80a5cbac 81# gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
b37250d6
ZJS
82m4_ifdef([GTK_DOC_CHECK], [
83GTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
6581f00f
ZJS
84 [AM_CONDITIONAL([ENABLE_GTK_DOC], [false])
85 enable_gtk_doc=no])
92ec4495 86
fe1fed02
ZJS
87AS_IF([test "x$enable_gtk_doc" = "xyes" -a "x$XSLTPROC" = x], [
88 AC_MSG_ERROR([*** GTK doc requested but xsltproc not found])
89])
90
6e92b23f 91m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
0eaeca1f 92GOBJECT_INTROSPECTION_CHECK([1.31.1])
d66ee73a
ZJS
93], [
94 AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
95 enable_introspection=no])
3e214785 96
ac714a78
MJ
97AC_CHECK_TOOL(STRINGS, strings)
98AC_CHECK_TOOL(GPERF, gperf)
b62cfcea
MB
99if test -z "$GPERF" ; then
100 AC_MSG_ERROR([*** gperf not found])
101fi
9a60da28 102
732bfe09
ZJS
103# ------------------------------------------------------------------------------
104address_sanitizer_cflags=
105address_sanitizer_cppflags=
106address_sanitizer_ldflags=
107AC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
108AS_IF([test "x$enable_address_sanitizer" = "xyes"], [
109 CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
110 AS_IF([test -z "$with_as_cflags"],
111 [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
112 address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
113 address_sanitizer_cppflags="-DVALGRIND=1"
114 address_sanitizer_ldflags="-Wc,-fsanitize=address"
115 ])
116
ae0ceefc
ZJS
117undefined_sanitizer_cflags=
118undefined_sanitizer_cppflags=
119undefined_sanitizer_ldflags=
120AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
121AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
122 CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
123 AS_IF([test -z "$with_us_cflags"],
124 [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
125 undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
126 undefined_sanitizer_cppflags="-DVALGRIND=1"
127 undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
128 ])
129
130sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
131sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
132sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
133
eb2e280f 134CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
be1a67d9 135 -pipe \
d1ab0ca0 136 -Wall \
d1ab0ca0 137 -Wextra \
27765dfc 138 -Wno-inline \
d1ab0ca0 139 -Wundef \
780040dc 140 "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
d1ab0ca0
LP
141 -Wlogical-op \
142 -Wsign-compare \
d1ab0ca0 143 -Wmissing-include-dirs \
d1ab0ca0
LP
144 -Wold-style-definition \
145 -Wpointer-arith \
146 -Winit-self \
03930e48 147 -Wdeclaration-after-statement \
d1ab0ca0 148 -Wfloat-equal \
693eb9a2 149 -Wsuggest-attribute=noreturn \
d1ab0ca0
LP
150 -Wmissing-prototypes \
151 -Wstrict-prototypes \
152 -Wredundant-decls \
153 -Wmissing-declarations \
154 -Wmissing-noreturn \
155 -Wshadow \
156 -Wendif-labels \
d1ab0ca0
LP
157 -Wstrict-aliasing=2 \
158 -Wwrite-strings \
be1a67d9
LP
159 -Wno-long-long \
160 -Wno-overlength-strings \
d1ab0ca0 161 -Wno-unused-parameter \
be1a67d9 162 -Wno-missing-field-initializers \
8745297f 163 -Wno-unused-result \
d200735e 164 -Werror=overflow \
213298fb 165 -Wdate-time \
693eb9a2 166 -Wnested-externs \
be1a67d9 167 -ffast-math \
d1ab0ca0
LP
168 -fno-common \
169 -fdiagnostics-show-option \
9f64229f 170 -fdiagnostics-color \
9b85fc6a
GSB
171 -fno-strict-aliasing \
172 -fvisibility=hidden \
173 -ffunction-sections \
5a45a936 174 -fdata-sections \
c1663b9d 175 -fstack-protector \
aca33b07 176 -fstack-protector-strong \
2a4d1ec1 177 -fPIE \
c1663b9d 178 --param=ssp-buffer-size=4])
b850b06e
KS
179AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
180 [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
235c6e62 181 -flto -ffat-lto-objects])],
b850b06e 182 [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
ae0ceefc 183AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
5a45a936 184
03a170c0 185AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
a6c0b31d
ZJS
186 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
187 -Wp,-D_FORTIFY_SOURCE=2])],
188 [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
ae0ceefc 189AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
9e7adc3a
LDM
190
191CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
9b85fc6a 192 -Wl,--as-needed \
9d2d0fe1 193 -Wl,--no-undefined \
5a45a936
LP
194 -Wl,--gc-sections \
195 -Wl,-z,relro \
39c4ead2 196 -Wl,-z,now \
2a4d1ec1 197 -pie \
39c4ead2 198 -Wl,-fuse-ld=gold])
ae0ceefc 199AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
47be870b 200
ccd06097
ZJS
201AC_CHECK_SIZEOF(pid_t)
202AC_CHECK_SIZEOF(uid_t)
1c231f56 203AC_CHECK_SIZEOF(gid_t)
de0671ee
ZJS
204AC_CHECK_SIZEOF(time_t)
205AC_CHECK_SIZEOF(rlim_t,,[
206 #include <sys/time.h>
207 #include <sys/resource.h>
208])
ccd06097 209
c937e0d5
ZJS
210# ------------------------------------------------------------------------------
211# we use python to build the man page index, and for systemd-python
212have_python=no
c937e0d5
ZJS
213AC_ARG_WITH([python],
214 [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
215
32dcef3a 216have_lxml=no
c937e0d5
ZJS
217AS_IF([test "x$with_python" != "xno"], [
218 AM_PATH_PYTHON(,, [:])
32dcef3a
ZJS
219 AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes], [have_lxml=no])
220 AS_IF([test "$PYTHON" != : -a $have_lxml = yes], [have_python=yes])
c937e0d5
ZJS
221])
222AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
223AS_IF([test "x$PYTHON_BINARY" = "x"],
224 [AS_IF([test "x$have_python" = "xyes"],
25ee45f9 225 [PYTHON_BINARY="$(which "$PYTHON")"],
c937e0d5
ZJS
226 [PYTHON_BINARY=/usr/bin/python])])
227AC_ARG_VAR(PYTHON_BINARY, [Python binary used to launch installed scripts])
228
1864b0e3
ZJS
229AS_IF([test "x$have_python" != "xyes" -a "x$enable_python_devel" = "xyes"],
230 [AC_MSG_ERROR([*** python-devel support requires --with-python])])
231
a6c0b31d
ZJS
232have_python_devel=no
233AC_ARG_ENABLE(python_devel, AS_HELP_STRING([--disable-python-devel], [Do not build python modules]))
1864b0e3 234AS_IF([test "x$have_python" = "xyes" -a "x$enable_python_devel" != "xno"], [
a6c0b31d
ZJS
235 PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}],
236 [have_python_devel=yes],
237 [PKG_CHECK_MODULES([PYTHON_DEVEL], [python],
238 [have_python_devel=yes],
239 [have_python_devel=no])])
240 AS_IF([test "x$have_python_devel" = xno -a "x$enable_python_devel" = xyes],
241 [AC_MSG_ERROR([*** python-devel support requested but libraries not found])])
f2ec0646 242 AC_PATH_PROGS(SPHINX_BUILD, sphinx-build-${PYTHON_VERSION} sphinx-build)
c937e0d5
ZJS
243])
244AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
245
246# ------------------------------------------------------------------------------
247
afea26ad 248AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
7959ff99 249AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
4b357e15 250AC_CHECK_HEADERS([linux/btrfs.h], [], [])
7959ff99
KS
251
252# unconditionally pull-in librt with old glibc versions
253AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
85f19d82
MB
254
255save_LIBS="$LIBS"
256LIBS=
47be870b 257AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
85f19d82 258CAP_LIBS="$LIBS"
7959ff99
KS
259AC_SUBST(CAP_LIBS)
260
261LIBS=
fba1ea06
SL
262AC_SEARCH_LIBS([mq_open], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
263RT_LIBS="$LIBS"
264AC_SUBST(RT_LIBS)
85f19d82 265LIBS="$save_LIBS"
47be870b 266
9388e99e 267AC_CHECK_FUNCS([fanotify_init fanotify_mark])
4db17f29 268AC_CHECK_FUNCS([__secure_getenv secure_getenv])
5f381b35 269AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, LO_FLAGS_PARTSCAN], [], [], [[#include <sys/types.h>
a8348796 270#include <unistd.h>
9388e99e 271#include <sys/mount.h>
3b794314 272#include <fcntl.h>
5f381b35
LP
273#include <sched.h>
274#include <linux/loop.h>]])
a8348796 275
b237ef2c 276# This makes sure pkg.m4 is available.
a9b5b032 277m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
d1ab0ca0 278
22703094 279# ------------------------------------------------------------------------------
ac6b760c
ZJS
280have_dbus=no
281AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
8114dedc 282AS_IF([test "x$enable_dbus" != "xno"], [
ac6b760c
ZJS
283 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2],
284 [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes],
285 [have_dbus=no])
286 AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"],
287 [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])])
22703094 288AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
4b357e15 289
53e856e1
ZJS
290# ------------------------------------------------------------------------------
291have_compat_libs=no
292AC_ARG_ENABLE([compat_libs], AS_HELP_STRING([--enable-compat-libs],[Enable creation of compatibility libraries]),
293 [case "${enableval}" in
294 yes) have_compat_libs=yes ;;
295 no) have_compat_libs=no ;;
296 *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libs) ;;
297 esac],
298 [have_compat_libs=no])
299AM_CONDITIONAL([ENABLE_COMPAT_LIBS], [test "$have_compat_libs" = "yes"])
300
6aea6d10
TA
301# ------------------------------------------------------------------------------
302have_coverage=no
303AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
304if test "x$enable_coverage" = "xyes" ; then
305 AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
306 if test "x$lcov_found" = xno ; then
307 AC_MSG_ERROR([*** lcov support requested but the program was not found])
308 else
309 lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
310 lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
311 if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
312 AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
313 else
314 have_coverage=yes
315 CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
316 -fprofile-arcs \
317 -ftest-coverage])
318 AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
319 fi
320 fi
321fi
322AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
323
e3043162
TG
324# ------------------------------------------------------------------------------
325have_kmod=no
326AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
327if test "x$enable_kmod" != "xno"; then
e2ca86cf
DR
328 PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
329 if test "x$have_kmod" = "xyes"; then
a18535d9 330 PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
e2ca86cf 331 [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
70d83209 332 AC_MSG_ERROR([*** kmod version >= 15 not found]))
e2ca86cf 333 fi
e3043162 334 if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
c4955740 335 AC_MSG_ERROR([*** kmod support requested, but libraries not found])
e3043162
TG
336 fi
337fi
338AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
f553b3b1
AO
339
340# ------------------------------------------------------------------------------
341have_blkid=no
342AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
343if test "x$enable_blkid" != "xno"; then
344 PKG_CHECK_MODULES(BLKID, [ blkid >= 2.20 ],
345 [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
346 if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
347 AC_MSG_ERROR([*** blkid support requested but libraries not found])
348 fi
349fi
350AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
728beb28 351
c0467cf3
RC
352# ------------------------------------------------------------------------------
353have_seccomp=no
354AC_ARG_ENABLE(seccomp, AS_HELP_STRING([--disable-seccomp], [Disable optional SECCOMP support]))
355if test "x$enable_seccomp" != "xno"; then
356 PKG_CHECK_MODULES(SECCOMP, [libseccomp >= 1.0.0],
17df7223
LP
357 [AC_DEFINE(HAVE_SECCOMP, 1, [Define if seccomp is available])
358 have_seccomp=yes
359 M4_DEFINES="$M4_DEFINES -DHAVE_SECCOMP"],
c0467cf3
RC
360 [have_seccomp=no])
361 if test "x$have_seccomp" = "xno" -a "x$enable_seccomp" = "xyes"; then
362 AC_MSG_ERROR([*** seccomp support requested but libraries not found])
363 fi
364fi
365AM_CONDITIONAL(HAVE_SECCOMP, [test "$have_seccomp" = "yes"])
366
3e214785 367# ------------------------------------------------------------------------------
81611586
RS
368have_ima=yes
369AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]),
370 [case "${enableval}" in
371 yes) have_ima=yes ;;
372 no) have_ima=no ;;
373 *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
374 esac],
375 [have_ima=yes])
376
377if test "x${have_ima}" != xno ; then
378 AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
379fi
380
77e68fa2
LP
381# ------------------------------------------------------------------------------
382have_chkconfig=yes
383AC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optional chkconfig support]),
384 [case "${enableval}" in
385 yes) have_chkconfig=yes ;;
386 no) have_chkconfig=no ;;
387 *) AC_MSG_ERROR(bad value ${enableval} for --disable-chkconfig) ;;
388 esac],
389 [AC_PATH_PROG(CHKCONFIG, chkconfig)
390 if test -z "$CHKCONFIG"; then
391 have_chkconfig=no
392 else
393 have_chkconfig=yes
394 fi])
395
396if test "x${have_chkconfig}" != xno ; then
397 AC_DEFINE(HAVE_CHKCONFIG, 1, [Define if CHKCONFIG is available])
398fi
399
3e214785 400# ------------------------------------------------------------------------------
591622d7
LP
401have_selinux=no
402AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
403if test "x$enable_selinux" != "xno"; then
3f8cc098 404 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
6a6751fe
LP
405 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
406 have_selinux=yes
407 M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
408 [have_selinux=no])
591622d7
LP
409 if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
410 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
411 fi
56cf987f 412fi
591622d7 413AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
45df1f2c 414
eef65bf3
MS
415have_apparmor=no
416AC_ARG_ENABLE(apparmor, AS_HELP_STRING([--disable-apparmor], [Disable optional AppArmor support]))
417if test "x$enable_apparmor" != "xno"; then
418 PKG_CHECK_MODULES([APPARMOR], [libapparmor],
419 [AC_DEFINE(HAVE_APPARMOR, 1, [Define if AppArmor is available])
420 have_apparmor=yes
421 M4_DEFINES="$M4_DEFINES -DHAVE_APPARMOR"],
422 [have_apparmor=no])
423 if test "x$have_apparmor" = xno -a "x$enable_apparmor" = xyes; then
424 AC_MSG_ERROR([*** AppArmor support requested but libraries not found])
425 fi
426fi
427AM_CONDITIONAL(HAVE_APPARMOR, [test "$have_apparmor" = "yes"])
428
429
45df1f2c
CR
430AC_ARG_WITH(debug-shell,
431 AS_HELP_STRING([--with-debug-shell=PATH],
432 [Path to debug shell binary]),
433 [SUSHELL="$withval"],[
434 AS_IF([test "x${have_selinux}" != "xno"], [SUSHELL="/sbin/sushell"] , [SUSHELL="/bin/sh"])])
435
5ec6b15b 436AC_SUBST(SUSHELL)
56cf987f 437
45df1f2c
CR
438AC_ARG_WITH([debug-tty],
439 AS_HELP_STRING([--with-debug-tty=PATH],
440 [Specify the tty device for debug shell]),
441 [DEBUGTTY="$withval"],
442 [DEBUGTTY=/dev/tty9])
443
444AC_SUBST(DEBUGTTY)
445
3e214785 446# ------------------------------------------------------------------------------
807e17f0
LP
447have_xz=no
448AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
449if test "x$enable_xz" != "xno"; then
450 PKG_CHECK_MODULES(XZ, [ liblzma ],
451 [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no)
807e17f0
LP
452 if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then
453 AC_MSG_ERROR([*** Xz support requested but libraries not found])
454 fi
455fi
456AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
457
3e214785 458# ------------------------------------------------------------------------------
5b6319dc
LP
459AC_ARG_ENABLE([pam],
460 AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
461 [case "${enableval}" in
462 yes) have_pam=yes ;;
463 no) have_pam=no ;;
464 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
465 esac],
466 [have_pam=auto])
467
468if test "x${have_pam}" != xno ; then
469 AC_CHECK_HEADERS(
470 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
471 [have_pam=yes],
472 [if test "x$have_pam" = xyes ; then
473 AC_MSG_ERROR([*** PAM headers not found.])
474 fi])
475
476 AC_CHECK_LIB(
477 [pam],
478 [pam_syslog],
479 [have_pam=yes],
480 [if test "x$have_pam" = xyes ; then
481 AC_MSG_ERROR([*** libpam not found.])
482 fi])
483
484 if test "x$have_pam" = xyes ; then
485 PAM_LIBS="-lpam -lpam_misc"
486 AC_DEFINE(HAVE_PAM, 1, [PAM available])
6a6751fe 487 M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
812cce32
LP
488 else
489 have_pam=no
5b6319dc
LP
490 fi
491else
492 PAM_LIBS=
493fi
494AC_SUBST(PAM_LIBS)
495AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
496
3e214785 497# ------------------------------------------------------------------------------
5eda94dd
LP
498AC_ARG_ENABLE([acl],
499 AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
500 [case "${enableval}" in
501 yes) have_acl=yes ;;
502 no) have_acl=no ;;
503 *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
504 esac],
505 [have_acl=auto])
506
507if test "x${have_acl}" != xno ; then
508 AC_CHECK_HEADERS(
509 [sys/acl.h acl/libacl.h],
510 [have_acl=yes],
511 [if test "x$have_acl" = xyes ; then
512 AC_MSG_ERROR([*** ACL headers not found.])
513 fi])
514
515 AC_CHECK_LIB(
516 [acl],
517 [acl_get_file],
518 [have_acl=yes],
519 [if test "x$have_acl" = xyes ; then
520 AC_MSG_ERROR([*** libacl not found.])
521 fi])
522
523 if test "x$have_acl" = xyes ; then
524 ACL_LIBS="-lacl"
525 AC_DEFINE(HAVE_ACL, 1, [ACL available])
526 else
527 have_acl=no
528 fi
529else
530 ACL_LIBS=
531fi
532AC_SUBST(ACL_LIBS)
533AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
534
2b3e18de
KL
535# ------------------------------------------------------------------------------
536AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK support]),
537 [case "${enableval}" in
538 yes) have_smack=yes ;;
539 no) have_smack=no ;;
540 *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
541 esac],
542 [have_smack=auto])
543
d2edfae0
KS
544if test "x${have_smack}" = xauto; then
545 M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
546 have_smack=yes
2b3e18de
KL
547fi
548
8b197c3a
AK
549AC_ARG_WITH(smack-run-label,
550AS_HELP_STRING([--with-smack-run-label=STRING],
551 [run systemd --system with a specific SMACK label]),
552 [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run with a smack label])],
553 [])
554
2b3e18de
KL
555if test "x${have_smack}" = xyes ; then
556 AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
557fi
558
7560fffc 559# ------------------------------------------------------------------------------
feb12d3e 560AC_ARG_ENABLE([gcrypt],
7560fffc
LP
561 AS_HELP_STRING([--disable-gcrypt],[Disable optional GCRYPT support]),
562 [case "${enableval}" in
563 yes) have_gcrypt=yes ;;
564 no) have_gcrypt=no ;;
565 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
566 esac],
567 [have_gcrypt=auto])
568
569if test "x${have_gcrypt}" != xno ; then
570 AM_PATH_LIBGCRYPT(
571 [1.4.5],
572 [have_gcrypt=yes],
573 [if test "x$have_gcrypt" = xyes ; then
574 AC_MSG_ERROR([*** GCRYPT headers not found.])
575 fi])
576
577 if test "x$have_gcrypt" = xyes ; then
578 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
579 GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS"
580 AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
581 else
582 have_gcrypt=no
583 fi
584else
585 GCRYPT_LIBS=
586 GCRYPT_CFLAGS=
587fi
588AC_SUBST(GCRYPT_LIBS)
589AC_SUBST(GCRYPT_CFLAGS)
590AM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
591
3e214785 592# ------------------------------------------------------------------------------
4927fcae
LP
593AC_ARG_ENABLE([audit],
594 AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
595 [case "${enableval}" in
596 yes) have_audit=yes ;;
597 no) have_audit=no ;;
598 *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
599 esac],
600 [have_audit=auto])
601
602if test "x${have_audit}" != xno ; then
603 AC_CHECK_HEADERS(
604 [libaudit.h],
605 [have_audit=yes],
606 [if test "x$have_audit" = xyes ; then
607 AC_MSG_ERROR([*** AUDIT headers not found.])
608 fi])
609
610 AC_CHECK_LIB(
611 [audit],
612 [audit_open],
613 [have_audit=yes],
614 [if test "x$have_audit" = xyes ; then
615 AC_MSG_ERROR([*** libaudit not found.])
616 fi])
617
618 if test "x$have_audit" = xyes ; then
619 AUDIT_LIBS="-laudit"
620 AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
621 else
622 have_audit=no
623 fi
624else
625 AUDIT_LIBS=
626fi
627AC_SUBST(AUDIT_LIBS)
628
3e214785 629# ------------------------------------------------------------------------------
7f4e0805
LP
630have_libcryptsetup=no
631AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
632if test "x$enable_libcryptsetup" != "xno"; then
8cf3ca80 633 PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.6.0 ],
7f4e0805 634 [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
7f4e0805 635 if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
591622d7 636 AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
7f4e0805
LP
637 fi
638fi
639AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
640
f6a971bc
LP
641# ------------------------------------------------------------------------------
642have_qrencode=no
643AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
644if test "x$enable_qrencode" != "xno"; then
645 PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
646 [AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
647 if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
648 AC_MSG_ERROR([*** qrencode support requested but libraries not found])
649 fi
650fi
651AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
652
7b17a7d7
LP
653# ------------------------------------------------------------------------------
654have_microhttpd=no
655AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
656if test "x$enable_microhttpd" != "xno"; then
3f573096 657 PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.33],
7b17a7d7
LP
658 [AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available]) have_microhttpd=yes], have_microhttpd=no)
659 if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
660 AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
661 fi
662fi
663AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
664
60313199
ZJS
665# ------------------------------------------------------------------------------
666have_gnutls=no
667AC_ARG_ENABLE(gnutls, AS_HELP_STRING([--disable-gnutls], [disable gnutls support]))
668if test "x$enable_gnutls" != "xno"; then
f12be7e8 669 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.1.4],
60313199
ZJS
670 [AC_DEFINE(HAVE_GNUTLS, 1, [Define if gnutls is available]) have_gnutls=yes], have_gnutls=no)
671 if test "x$have_gnutls" = xno -a "x$enable_gnutls" = xyes; then
672 AC_MSG_ERROR([*** gnutls support requested but libraries not found])
673 fi
674fi
675AM_CONDITIONAL(HAVE_GNUTLS, [test "$have_gnutls" = "yes"])
676
3e214785 677# ------------------------------------------------------------------------------
27669061
MV
678have_binfmt=no
679AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
680if test "x$enable_binfmt" != "xno"; then
be31376e 681 have_binfmt=yes
27669061
MV
682fi
683AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
684
3e214785 685# ------------------------------------------------------------------------------
e5e83e83
LP
686have_vconsole=no
687AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
688if test "x$enable_vconsole" != "xno"; then
be31376e 689 have_vconsole=yes
e5e83e83
LP
690fi
691AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
692
3e214785 693# ------------------------------------------------------------------------------
e5e83e83
LP
694have_readahead=no
695AC_ARG_ENABLE(readahead, AS_HELP_STRING([--disable-readahead], [disable readahead tools]))
696if test "x$enable_readahead" != "xno"; then
be31376e 697 have_readahead=yes
e5e83e83
LP
698fi
699AM_CONDITIONAL(ENABLE_READAHEAD, [test "$have_readahead" = "yes"])
700
83fdc450
AK
701# ------------------------------------------------------------------------------
702have_bootchart=no
703AC_ARG_ENABLE(bootchart, AS_HELP_STRING([--disable-bootchart], [disable bootchart tool]))
704if test "x$enable_bootchart" != "xno"; then
705 have_bootchart=yes
706fi
707AM_CONDITIONAL(ENABLE_BOOTCHART, [test "$have_bootchart" = "yes"])
708
3e214785 709# ------------------------------------------------------------------------------
4de85612
LP
710have_quotacheck=no
711AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
712if test "x$enable_quotacheck" != "xno"; then
be31376e 713 have_quotacheck=yes
4de85612
LP
714fi
715AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
716
6351163b
UTL
717# ------------------------------------------------------------------------------
718have_tmpfiles=no
719AC_ARG_ENABLE(tmpfiles, AS_HELP_STRING([--disable-tmpfiles], [disable tmpfiles support]))
720if test "x$enable_tmpfiles" != "xno"; then
721 have_tmpfiles=yes
722fi
723AM_CONDITIONAL(ENABLE_TMPFILES, [test "$have_tmpfiles" = "yes"])
724
3e214785 725# ------------------------------------------------------------------------------
4de85612
LP
726have_randomseed=no
727AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
728if test "x$enable_randomseed" != "xno"; then
be31376e 729 have_randomseed=yes
4de85612
LP
730fi
731AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
732
3731acf1
LP
733# ------------------------------------------------------------------------------
734have_backlight=no
735AC_ARG_ENABLE(backlight, AS_HELP_STRING([--disable-backlight], [disable backlight tools]))
736if test "x$enable_backlight" != "xno"; then
737 have_backlight=yes
738fi
739AM_CONDITIONAL(ENABLE_BACKLIGHT, [test "$have_backlight" = "yes"])
740
3990f247
LP
741# ------------------------------------------------------------------------------
742have_rfkill=no
743AC_ARG_ENABLE(rfkill, AS_HELP_STRING([--disable-rfkill], [disable rfkill tools]))
744if test "x$enable_rfkill" != "xno"; then
745 have_rfkill=yes
746fi
747AM_CONDITIONAL(ENABLE_RFKILL, [test "$have_rfkill" = "yes"])
748
3e214785 749# ------------------------------------------------------------------------------
2a018e83
KS
750have_logind=no
751AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
752if test "x$enable_logind" != "xno"; then
be31376e 753 have_logind=yes
2a018e83
KS
754fi
755AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
4c80c73c 756AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
2a018e83 757
1ee306e1
LP
758# ------------------------------------------------------------------------------
759have_machined=no
760AC_ARG_ENABLE(machined, AS_HELP_STRING([--disable-machined], [disable machine daemon]))
761if test "x$enable_machined" != "xno"; then
762 have_machined=yes
763fi
764AM_CONDITIONAL(ENABLE_MACHINED, [test "$have_machined" = "yes"])
765AS_IF([test "$have_machined" = "yes"], [ AC_DEFINE(HAVE_MACHINED, [1], [Machined support available]) ])
766
3e214785 767# ------------------------------------------------------------------------------
b2e9fb99
MV
768have_hostnamed=no
769AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
770if test "x$enable_hostnamed" != "xno"; then
be31376e 771 have_hostnamed=yes
b2e9fb99
MV
772fi
773AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
774
3e214785 775# ------------------------------------------------------------------------------
f47cd184
MV
776have_timedated=no
777AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
778if test "x$enable_timedated" != "xno"; then
be31376e 779 have_timedated=yes
f47cd184
MV
780fi
781AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
782
3e214785 783# ------------------------------------------------------------------------------
687ed123
KS
784have_timesyncd=no
785AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon]))
43ba1b3e 786if test "x$enable_timesyncd" != "xno"; then
687ed123
KS
787 have_timesyncd=yes
788fi
789AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"])
790
e8af6973
LP
791AC_ARG_WITH(ntp-servers,
792 AS_HELP_STRING([--with-ntp-servers=NTPSERVERS],
793 [Space-separated list of default NTP servers]),
794 [NTP_SERVERS="$withval"],
795 [NTP_SERVERS="time1.google.com time2.google.com time3.google.com time4.google.com"])
796
797AC_DEFINE_UNQUOTED(NTP_SERVERS, ["$NTP_SERVERS"], [Default NTP Servers])
798AC_SUBST(NTP_SERVERS)
799
661278ee
LP
800AC_ARG_WITH(time-epoch,
801 AS_HELP_STRING([--with-time-epoch=SECONDS],
5ea846cc 802 [Time epoch for time clients]),
661278ee
LP
803 [TIME_EPOCH="$withval"],
804 [TIME_EPOCH="`stat -c %Y ${srcdir}/NEWS 2>/dev/null || echo 0`"])
805
806AC_DEFINE_UNQUOTED(TIME_EPOCH, [$TIME_EPOCH], [Time Epoch])
807
f7dc3ab9
LP
808# ------------------------------------------------------------------------------
809AC_ARG_WITH(system-uid-max,
810 AS_HELP_STRING([--with-system-uid-max=UID]
811 [Maximum UID for system users]),
812 [SYSTEM_UID_MAX="$withval"],
813 [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`"])
814
815AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
816AC_SUBST(SYSTEM_UID_MAX)
817
818# ------------------------------------------------------------------------------
819AC_ARG_WITH(system-gid-max,
820 AS_HELP_STRING([--with-system-gid-max=GID]
821 [Maximum GID for system groups]),
822 [SYSTEM_GID_MAX="$withval"],
823 [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`"])
824
825AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
826AC_SUBST(SYSTEM_GID_MAX)
827
687ed123 828# ------------------------------------------------------------------------------
4cd1eaa5
MV
829have_localed=no
830AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
831if test "x$enable_localed" != "xno"; then
be31376e 832 have_localed=yes
4cd1eaa5
MV
833fi
834AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
835
3e214785 836# ------------------------------------------------------------------------------
f5e04665
LP
837have_coredump=no
838AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
839if test "x$enable_coredump" != "xno"; then
be31376e 840 have_coredump=yes
f5e04665
LP
841fi
842AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
843
46ba8aae
LP
844# ------------------------------------------------------------------------------
845have_polkit=no
846AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
847if test "x$enable_polkit" != "xno"; then
848 AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
849 have_polkit=yes
850fi
851AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
852
3c9317d2 853# ------------------------------------------------------------------------------
091a364c
TG
854have_resolved=no
855AC_ARG_ENABLE(resolved, AS_HELP_STRING([--disable-resolved], [disable resolve daemon]))
856if test "x$enable_resolved" != "xno"; then
857 have_resolved=yes
3c9317d2 858fi
091a364c 859AM_CONDITIONAL(ENABLE_RESOLVED, [test "$have_resolved" = "yes"])
3c9317d2 860
e16cb2e4
TG
861AC_ARG_WITH(dns-servers,
862 AS_HELP_STRING([--with-dns-servers=DNSSERVERS],
863 [Space-separated list of default DNS servers]),
49e5c2b2 864 [DNS_SERVERS="$withval"],
7b4d7968 865 [DNS_SERVERS="8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844"])
e16cb2e4
TG
866
867AC_DEFINE_UNQUOTED(DNS_SERVERS, ["$DNS_SERVERS"], [Default DNS Servers])
868AC_SUBST(DNS_SERVERS)
869
091a364c
TG
870# ------------------------------------------------------------------------------
871have_networkd=no
872AC_ARG_ENABLE(networkd, AS_HELP_STRING([--disable-networkd], [disable networkd]))
873if test "x$enable_networkd" != "xno"; then
874 AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled])
875 have_networkd=yes
876fi
091a364c
TG
877AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"])
878
b872e9a0
LP
879# ------------------------------------------------------------------------------
880have_efi=no
881AC_ARG_ENABLE(efi, AS_HELP_STRING([--disable-efi], [disable EFI support]))
882if test "x$enable_efi" != "xno"; then
883 AC_DEFINE(ENABLE_EFI, 1, [Define if EFI support is to be enabled])
884 have_efi=yes
885fi
886AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
887
bd441fa2
ZJS
888# ------------------------------------------------------------------------------
889have_multi_seat_x=no
890AC_ARG_ENABLE(multi_seat_x, AS_HELP_STRING([--disable-multi-seat-x], [do not build multi-seat-x]))
891if test "x$enable_multi_seat_x" != "xno"; then
892 have_multi_seat_x=yes
893fi
894AM_CONDITIONAL(ENABLE_MULTI_SEAT_X, [test "$have_multi_seat_x" = "yes"])
895
626851be
LP
896# ------------------------------------------------------------------------------
897have_kdbus=no
c97a6dbc 898AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--enable-kdbus], [do connect to kdbus by default]))
146ccaaf 899if test "x$enable_kdbus" = "xyes"; then
626851be
LP
900 AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus support is to be enabled])
901 have_kdbus=yes
4acbce79 902 M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
626851be
LP
903fi
904AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
905
b1c4ca25
LP
906# ------------------------------------------------------------------------------
907AC_ARG_WITH(rc-local-script-path-start,
908 AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
909 [Path to /etc/rc.local]),
910 [RC_LOCAL_SCRIPT_PATH_START="$withval"],
911 [RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
912
913AC_ARG_WITH(rc-local-script-path-stop,
914 AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
bc270841 915 [Path to /usr/sbin/halt.local]),
b1c4ca25 916 [RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
bc270841 917 [RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
b1c4ca25
LP
918
919AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
bc270841 920AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
b1c4ca25
LP
921
922AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
923AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
924
a382332e
LP
925# ------------------------------------------------------------------------------
926AC_ARG_WITH(kbd-loadkeys,
927 AS_HELP_STRING([--with-kbd-loadkeys=PATH],
928 [Path to loadkeys]),
929 [KBD_LOADKEYS="$withval"],
930 [KBD_LOADKEYS="/usr/bin/loadkeys"])
931
932AC_ARG_WITH(kbd-setfont,
933 AS_HELP_STRING([--with-kbd-setfont=PATH],
934 [Path to setfont]),
935 [KBD_SETFONT="$withval"],
936 [KBD_SETFONT="/usr/bin/setfont"])
937
938AC_DEFINE_UNQUOTED(KBD_LOADKEYS, ["$KBD_LOADKEYS"], [Path of loadkeys])
939AC_DEFINE_UNQUOTED(KBD_SETFONT, ["$KBD_SETFONT"], [Path of setfont])
940
941AC_SUBST(KBD_LOADKEYS)
942AC_SUBST(KBD_SETFONT)
943
4ad61fd1
CR
944AC_ARG_WITH(telinit,
945 AS_HELP_STRING([--with-telinit=PATH],
946 [Path to telinit]),
947 [TELINIT="$withval"],
abaaabf4 948 [TELINIT="/lib/sysvinit/telinit"])
4ad61fd1
CR
949
950AC_DEFINE_UNQUOTED(TELINIT, ["$TELINIT"], [Path to telinit])
951
952AC_SUBST(TELINIT)
953
54b434b1 954AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
7211f918 955
d562955e
TG
956# ------------------------------------------------------------------------------
957have_myhostname=no
f8c5a581 958AC_ARG_ENABLE(myhostname, AS_HELP_STRING([--disable-myhostname], [disable nss-myhostname support]))
d562955e
TG
959if test "x$enable_myhostname" != "xno"; then
960 AC_HEADER_STDC
a3b6fafe 961 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
962
963 AC_C_CONST
964 AC_TYPE_SIZE_T
965 AC_HEADER_TIME
966
967 AC_FUNC_MALLOC
968 AC_FUNC_SELECT_ARGTYPES
969 AC_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
970
971 have_myhostname=yes
972fi
973AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
974
3e214785
KS
975# ------------------------------------------------------------------------------
976AC_ARG_WITH(firmware-path,
977 AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
a3bd8447
TG
978 [Firmware search path (default="")]),
979 [], [with_firmware_path=""])
3e214785
KS
980OLD_IFS=$IFS
981IFS=:
982for i in $with_firmware_path; do
983 if test "x${FIRMWARE_PATH}" = "x"; then
984 FIRMWARE_PATH="\\\"${i}/\\\""
985 else
986 FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
987 fi
988done
989IFS=$OLD_IFS
a3bd8447 990AC_SUBST(FIRMWARE_PATH)
d8d4bee7 991AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
a3bd8447 992AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
3e214785
KS
993
994# ------------------------------------------------------------------------------
995AC_ARG_ENABLE([gudev],
996 AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
997 [], [enable_gudev=yes])
de1c301e 998AS_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 999AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
de1c301e
LP
1000AS_IF([test "x$enable_gudev" = "xyes"], [ AC_DEFINE(HAVE_GLIB, 1, [Define if glib is available]) ])
1001
3e214785 1002# ------------------------------------------------------------------------------
75db9a77 1003have_manpages=no
4c2b0e4e 1004AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
4ca39b28 1005AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
fe1fed02 1006AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
75db9a77 1007
3e214785 1008# ------------------------------------------------------------------------------
d1ab0ca0 1009
34eff652
LP
1010# Location of the init scripts as mandated by LSB
1011SYSTEM_SYSVINIT_PATH=/etc/init.d
f1dd0c3f 1012SYSTEM_SYSVRCND_PATH=/etc/rc.d
12e84679 1013
136337ff 1014AC_ARG_WITH([sysvinit-path],
be31376e 1015 [AS_HELP_STRING([--with-sysvinit-path=PATH],
bc270841 1016 [Specify the path to where the SysV init scripts are located])],
be31376e
KS
1017 [SYSTEM_SYSVINIT_PATH="$withval"],
1018 [])
136337ff 1019
dee4c244
LP
1020AC_ARG_WITH([sysvrcnd-path],
1021 [AS_HELP_STRING([--with-sysvrcnd-path=PATH],
bc270841 1022 [Specify the path to the base directory for the SysV rcN.d directories])],
136337ff
TFH
1023 [SYSTEM_SYSVRCND_PATH="$withval"],
1024 [])
1025
07459bb6
FF
1026if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
1027 AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
1028 SYSTEM_SYSV_COMPAT="yes"
f975e971 1029 M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
07459bb6 1030elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
dee4c244 1031 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
1032else
1033 SYSTEM_SYSV_COMPAT="no"
1034fi
1035
bc270841
LP
1036AC_SUBST(SYSTEM_SYSVINIT_PATH)
1037AC_SUBST(SYSTEM_SYSVRCND_PATH)
1038AC_SUBST(M4_DEFINES)
1039
1040AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
1041
bef2733f 1042AC_ARG_WITH([tty-gid],
a05ea46d 1043 [AS_HELP_STRING([--with-tty-gid=GID],
bef2733f
LP
1044 [Specify the numeric GID of the 'tty' group])],
1045 [AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])],
1046 [])
1047
d2d12cd1
LP
1048AC_ARG_WITH([dbuspolicydir],
1049 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
1050 [],
25ee45f9 1051 [with_dbuspolicydir=$($PKG_CONFIG --variable=sysconfdir dbus-1)/dbus-1/system.d])
d122948d 1052
d2d12cd1
LP
1053AC_ARG_WITH([dbussessionservicedir],
1054 AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
1055 [],
25ee45f9 1056 [with_dbussessionservicedir=$($PKG_CONFIG --variable=session_bus_services_dir dbus-1)])
d122948d 1057
d2d12cd1
LP
1058AC_ARG_WITH([dbussystemservicedir],
1059 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
1060 [],
03c14914 1061 [with_dbussystemservicedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../system-services)])
d122948d 1062
d2d12cd1
LP
1063AC_ARG_WITH([dbusinterfacedir],
1064 AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
1065 [],
03c14914 1066 [with_dbusinterfacedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../interfaces)])
d122948d 1067
db059f1b
MB
1068AC_ARG_WITH([bashcompletiondir],
1069 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
1070 [],
25ee45f9
MB
1071 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
1072 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
db059f1b
MB
1073 ] , [
1074 with_bashcompletiondir=${datadir}/bash-completion/completions
1075 ])])
1076
4f87c47b
WG
1077AC_ARG_WITH([zshcompletiondir],
1078 AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
1079 [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
1080
b8079ae1
KS
1081AC_ARG_WITH([rootprefix],
1082 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
39ad55a9 1083 [], [with_rootprefix=${ac_default_prefix}])
d2d12cd1 1084
ae446765
KS
1085AC_ARG_WITH([rootlibdir],
1086 AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
1087 [],
1088 [with_rootlibdir=${libdir}])
1089
9d3203b4 1090AC_ARG_WITH([pamlibdir],
b0cca7d8 1091 AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
9d3203b4
KS
1092 [],
1093 [with_pamlibdir=${with_rootlibdir}/security])
1094
5c390a4a
ZJS
1095AC_ARG_WITH([pamconfdir],
1096 AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
1097 [],
1098 [with_pamconfdir=${sysconfdir}/pam.d])
1099
bc9bdbba
MG
1100AC_ARG_ENABLE([split-usr],
1101 AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
1102 [],
1103 [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
1104 enable_split_usr=yes
1105 ], [
1106 enable_split_usr=no
1107 ])])
1108
1109AS_IF([test "x${enable_split_usr}" = "xyes"], [
2c6db6fb 1110 AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
bc9bdbba 1111])
2c6db6fb 1112
6fc00209
ZJS
1113# Work around intltoolize and gtk-doc problems in VPATH builds
1114AM_CONDITIONAL([ENABLE_GTK_DOC_TESTS], [test "x$0" = "x./configure"],
1115 [Define to do gtk-doc tests])
1116AS_IF([test "x$0" != "x./configure"], [
1117 AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
1118])
1119
cee22bd3
HGB
1120AC_ARG_ENABLE(tests,
1121 [AC_HELP_STRING([--disable-tests], [disable tests])],
1122 enable_tests=$enableval, enable_tests=yes)
1123AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
1124
d2d12cd1
LP
1125AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
1126AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
1127AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
1128AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir])
db059f1b 1129AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
4f87c47b 1130AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
8c6db833 1131AC_SUBST([pamlibdir], [$with_pamlibdir])
5c390a4a 1132AC_SUBST([pamconfdir], [$with_pamconfdir])
b8079ae1 1133AC_SUBST([rootprefix], [$with_rootprefix])
ae446765 1134AC_SUBST([rootlibdir], [$with_rootlibdir])
8c4a3079 1135
3e214785
KS
1136AC_CONFIG_FILES([
1137 Makefile po/Makefile.in
bb061708
KS
1138 docs/libudev/Makefile
1139 docs/libudev/version.xml
1140 docs/gudev/Makefile
1141 docs/gudev/version.xml
3e214785
KS
1142])
1143
a45a909f 1144AC_OUTPUT
ae446765 1145AC_MSG_RESULT([
0571e011
LP
1146 $PACKAGE_NAME $VERSION
1147
7f4e0805 1148 libcryptsetup: ${have_libcryptsetup}
5b6319dc 1149 PAM: ${have_pam}
12716238 1150 AUDIT: ${have_audit}
81611586 1151 IMA: ${have_ima}
eef65bf3 1152 AppArmor: ${have_apparmor}
12716238 1153 SELinux: ${have_selinux}
c0467cf3 1154 SECCOMP: ${have_seccomp}
2b3e18de 1155 SMACK: ${have_smack}
807e17f0 1156 XZ: ${have_xz}
5eda94dd 1157 ACL: ${have_acl}
7560fffc 1158 GCRYPT: ${have_gcrypt}
f6a971bc 1159 QRENCODE: ${have_qrencode}
7b17a7d7 1160 MICROHTTPD: ${have_microhttpd}
77e68fa2 1161 CHKCONFIG: ${have_chkconfig}
60313199 1162 GNUTLS: ${have_gnutls}
27669061 1163 binfmt: ${have_binfmt}
e5e83e83
LP
1164 vconsole: ${have_vconsole}
1165 readahead: ${have_readahead}
83fdc450 1166 bootchart: ${have_bootchart}
4de85612 1167 quotacheck: ${have_quotacheck}
6351163b 1168 tmpfiles: ${have_tmpfiles}
4de85612 1169 randomseed: ${have_randomseed}
3731acf1 1170 backlight: ${have_backlight}
3990f247 1171 rfkill: ${have_rfkill}
2a018e83 1172 logind: ${have_logind}
1ee306e1 1173 machined: ${have_machined}
b2e9fb99 1174 hostnamed: ${have_hostnamed}
f47cd184 1175 timedated: ${have_timedated}
a91df40e 1176 timesyncd: ${have_timesyncd}
e8af6973 1177 default NTP servers: ${NTP_SERVERS}
661278ee 1178 time epoch: ${TIME_EPOCH}
4cd1eaa5 1179 localed: ${have_localed}
7a243b22 1180 networkd: ${have_networkd}
091a364c 1181 resolved: ${have_resolved}
e16cb2e4 1182 default DNS servers: ${DNS_SERVERS}
f5e04665 1183 coredump: ${have_coredump}
46ba8aae 1184 polkit: ${have_polkit}
b872e9a0 1185 efi: ${have_efi}
e3043162 1186 kmod: ${have_kmod}
f553b3b1 1187 blkid: ${have_blkid}
ac6b760c 1188 dbus: ${have_dbus}
d562955e 1189 nss-myhostname: ${have_myhostname}
3e214785
KS
1190 gudev: ${enable_gudev}
1191 gintrospection: ${enable_introspection}
bd441fa2 1192 multi-seat-x: ${have_multi_seat_x}
626851be 1193 kdbus: ${have_kdbus}
8d7e170a
LP
1194 Python: ${have_python}
1195 Python Headers: ${have_python_devel}
2f4da3e6
ZJS
1196 man pages: ${have_manpages}
1197 gtk-doc: ${enable_gtk_doc}
6aea6d10 1198 test coverage: ${have_coverage}
2f4da3e6
ZJS
1199 Split /usr: ${enable_split_usr}
1200 SysV compatibility: ${SYSTEM_SYSV_COMPAT}
53e856e1 1201 compatibility libraries: ${have_compat_libs}
3e214785 1202
8c4a3079 1203 prefix: ${prefix}
b8079ae1 1204 rootprefix: ${with_rootprefix}
3e214785
KS
1205 sysconf dir: ${sysconfdir}
1206 datarootdir: ${datarootdir}
1207 includedir: ${includedir}
1208 include_prefix: ${INCLUDE_PREFIX}
ae446765
KS
1209 lib dir: ${libdir}
1210 rootlib dir: ${with_rootlibdir}
2f4da3e6
ZJS
1211 SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
1212 SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
1213 Build Python: ${PYTHON}
1214 Installation Python: ${PYTHON_BINARY}
f2ec0646 1215 sphinx binary: ${SPHINX_BUILD}
2f4da3e6 1216 firmware path: ${FIRMWARE_PATH}
2c6db6fb 1217 PAM modules dir: ${with_pamlibdir}
5c390a4a 1218 PAM configuration dir: ${with_pamconfdir}
2c6db6fb
LP
1219 D-Bus policy dir: ${with_dbuspolicydir}
1220 D-Bus session dir: ${with_dbussessionservicedir}
1221 D-Bus system dir: ${with_dbussystemservicedir}
1222 D-Bus interfaces dir: ${with_dbusinterfacedir}
db059f1b 1223 Bash completions dir: ${with_bashcompletiondir}
4f87c47b 1224 Zsh completions dir: ${with_zshcompletiondir}
b1c4ca25
LP
1225 Extra start script: ${RC_LOCAL_SCRIPT_PATH_START}
1226 Extra stop script: ${RC_LOCAL_SCRIPT_PATH_STOP}
45df1f2c 1227 Debug shell: ${SUSHELL} @ ${DEBUGTTY}
f7dc3ab9
LP
1228 Maximum System UID: ${SYSTEM_UID_MAX}
1229 Maximum System GID: ${SYSTEM_GID_MAX}
66be6554 1230
5a45a936 1231 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
1f048a6b 1232 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
5a45a936 1233 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
a6c0b31d
ZJS
1234 PYTHON_CFLAGS: ${PYTHON_DEVEL_CFLAGS}
1235 PYTHON_LIBS: ${PYTHON_DEVEL_LIBS}
ae446765 1236])