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