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