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