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