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