chiark / gitweb /
bus: reorder a few things
[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 AS_IF([test "x$with_python" != "xno"], [
192         AM_PATH_PYTHON(,, [:])
193         AS_IF([test "$PYTHON" != :], [have_python=yes])
194 ])
195 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
196 AS_IF([test "x$PYTHON_BINARY" = "x"],
197       [AS_IF([test "x$have_python" = "xyes"],
198              [PYTHON_BINARY="$(which "$PYTHON")"],
199              [PYTHON_BINARY=/usr/bin/python])])
200 AC_ARG_VAR(PYTHON_BINARY, [Python binary used to launch installed scripts])
201
202 AS_IF([test "x$have_python" != "xyes" -a "x$enable_python_devel" = "xyes"],
203       [AC_MSG_ERROR([*** python-devel support requires --with-python])])
204
205 have_python_devel=no
206 AC_ARG_ENABLE(python_devel, AS_HELP_STRING([--disable-python-devel], [Do not build python modules]))
207 AS_IF([test "x$have_python" = "xyes" -a "x$enable_python_devel" != "xno"], [
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])])
215       AC_PATH_PROGS(SPHINX_BUILD, sphinx-build-${PYTHON_VERSION} sphinx-build)
216 ])
217 AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
218
219 # ------------------------------------------------------------------------------
220
221 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
222 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
223 AC_CHECK_HEADERS([linux/btrfs.h], [], [])
224
225 # unconditionally pull-in librt with old glibc versions
226 AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
227
228 save_LIBS="$LIBS"
229 LIBS=
230 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
231 CAP_LIBS="$LIBS"
232 AC_SUBST(CAP_LIBS)
233
234 LIBS=
235 AC_SEARCH_LIBS([mq_open], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
236 RT_LIBS="$LIBS"
237 AC_SUBST(RT_LIBS)
238 LIBS="$save_LIBS"
239
240 AC_CHECK_FUNCS([fanotify_init fanotify_mark])
241 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
242 AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include <sys/types.h>
243 #include <unistd.h>
244 #include <sys/mount.h>
245 #include <fcntl.h>]])
246
247 # This makes sure pkg.m4 is available.
248 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
249
250 # ------------------------------------------------------------------------------
251 have_dbus=no
252 AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
253 AS_IF([test "x$enable_dbus" != "xno"], [
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])])])
259 AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
260
261 # ------------------------------------------------------------------------------
262 have_compat_libs=no
263 AC_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])
270 AM_CONDITIONAL([ENABLE_COMPAT_LIBS], [test "$have_compat_libs" = "yes"])
271
272 # ------------------------------------------------------------------------------
273 have_coverage=no
274 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
275 if 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
292 fi
293 AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
294
295 # ------------------------------------------------------------------------------
296 have_kmod=no
297 AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
298 if test "x$enable_kmod" != "xno"; then
299         PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
300         if test "x$have_kmod" = "xyes"; then
301                 PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
302                         [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
303                         AC_MSG_ERROR([*** kmod version >= 15 not found]))
304         fi
305         if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
306                 AC_MSG_ERROR([*** kmod support requested, but libraries not found])
307         fi
308 fi
309 AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
310
311 # ------------------------------------------------------------------------------
312 have_blkid=no
313 AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
314 if 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
320 fi
321 AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
322
323 # ------------------------------------------------------------------------------
324 have_ima=yes
325 AC_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
333 if test "x${have_ima}" != xno ; then
334         AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
335 fi
336
337 # ------------------------------------------------------------------------------
338 have_chkconfig=yes
339 AC_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
352 if test "x${have_chkconfig}" != xno ; then
353         AC_DEFINE(HAVE_CHKCONFIG, 1, [Define if CHKCONFIG is available])
354 fi
355
356 # ------------------------------------------------------------------------------
357 have_selinux=no
358 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
359 if test "x$enable_selinux" != "xno"; then
360         PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
361                 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no)
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
365 fi
366 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
367
368 AC_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
374 AC_SUBST(SUSHELL)
375
376 AC_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
382 AC_SUBST(DEBUGTTY)
383
384 # ------------------------------------------------------------------------------
385 have_xz=no
386 AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
387 if 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)
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
393 fi
394 AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
395
396 # ------------------------------------------------------------------------------
397 AC_ARG_ENABLE([tcpwrap],
398         AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]),
399                 [case "${enableval}" in
400                         yes) have_tcpwrap=yes ;;
401                         no) have_tcpwrap=no ;;
402                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
403                 esac],
404                 [have_tcpwrap=auto])
405
406 if test "x${have_tcpwrap}" != xno ; then
407         ACX_LIBWRAP
408         if test "x${LIBWRAP_LIBS}" = x ; then
409                 if test "x$have_tcpwrap" = xyes ; then
410                         AC_MSG_ERROR([*** TCP wrappers support not found.])
411                 fi
412                 have_tcpwrap=no
413         else
414                 have_tcpwrap=yes
415         fi
416 else
417         LIBWRAP_LIBS=
418 fi
419 AC_SUBST(LIBWRAP_LIBS)
420
421 # ------------------------------------------------------------------------------
422 AC_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
431 if 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])
450         else
451                 have_pam=no
452         fi
453 else
454         PAM_LIBS=
455 fi
456 AC_SUBST(PAM_LIBS)
457 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
458
459 # ------------------------------------------------------------------------------
460 AC_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
469 if 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
491 else
492         ACL_LIBS=
493 fi
494 AC_SUBST(ACL_LIBS)
495 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
496
497 # ------------------------------------------------------------------------------
498 AC_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
507 if 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
529 else
530         XATTR_LIBS=
531 fi
532 AC_SUBST(XATTR_LIBS)
533 AM_CONDITIONAL([HAVE_XATTR], [test "x$have_xattr" != xno])
534
535 # ------------------------------------------------------------------------------
536 AC_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
544 if 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
550 else
551         if test "x${have_smack}" = xauto; then
552                 have_smack=yes
553         fi
554 fi
555
556 AC_ARG_WITH(smack-run-label,
557 AS_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
562 if test "x${have_smack}" = xyes ; then
563         AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
564 fi
565
566 # ------------------------------------------------------------------------------
567 AC_ARG_ENABLE([gcrypt],
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
576 if 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
591 else
592         GCRYPT_LIBS=
593         GCRYPT_CFLAGS=
594 fi
595 AC_SUBST(GCRYPT_LIBS)
596 AC_SUBST(GCRYPT_CFLAGS)
597 AM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
598
599 # ------------------------------------------------------------------------------
600 AC_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
609 if 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
631 else
632         AUDIT_LIBS=
633 fi
634 AC_SUBST(AUDIT_LIBS)
635
636 # ------------------------------------------------------------------------------
637 have_libcryptsetup=no
638 AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
639 if test "x$enable_libcryptsetup" != "xno"; then
640         PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.6.0 ],
641                 [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
642         if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
643                 AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
644         fi
645 fi
646 AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
647
648 # ------------------------------------------------------------------------------
649 have_qrencode=no
650 AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
651 if 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
657 fi
658 AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
659
660 # ------------------------------------------------------------------------------
661 have_microhttpd=no
662 AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
663 if test "x$enable_microhttpd" != "xno"; then
664         PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.5],
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
669 fi
670 AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
671
672 # ------------------------------------------------------------------------------
673 have_binfmt=no
674 AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
675 if test "x$enable_binfmt" != "xno"; then
676         have_binfmt=yes
677 fi
678 AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
679
680 # ------------------------------------------------------------------------------
681 have_vconsole=no
682 AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
683 if test "x$enable_vconsole" != "xno"; then
684         have_vconsole=yes
685 fi
686 AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
687
688 # ------------------------------------------------------------------------------
689 have_readahead=no
690 AC_ARG_ENABLE(readahead, AS_HELP_STRING([--disable-readahead], [disable readahead tools]))
691 if test "x$enable_readahead" != "xno"; then
692         have_readahead=yes
693 fi
694 AM_CONDITIONAL(ENABLE_READAHEAD, [test "$have_readahead" = "yes"])
695
696 # ------------------------------------------------------------------------------
697 have_bootchart=no
698 AC_ARG_ENABLE(bootchart, AS_HELP_STRING([--disable-bootchart], [disable bootchart tool]))
699 if test "x$enable_bootchart" != "xno"; then
700         have_bootchart=yes
701 fi
702 AM_CONDITIONAL(ENABLE_BOOTCHART, [test "$have_bootchart" = "yes"])
703
704 # ------------------------------------------------------------------------------
705 have_quotacheck=no
706 AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
707 if test "x$enable_quotacheck" != "xno"; then
708         have_quotacheck=yes
709 fi
710 AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
711
712 # ------------------------------------------------------------------------------
713 have_tmpfiles=no
714 AC_ARG_ENABLE(tmpfiles, AS_HELP_STRING([--disable-tmpfiles], [disable tmpfiles support]))
715 if test "x$enable_tmpfiles" != "xno"; then
716         have_tmpfiles=yes
717 fi
718 AM_CONDITIONAL(ENABLE_TMPFILES, [test "$have_tmpfiles" = "yes"])
719
720 # ------------------------------------------------------------------------------
721 have_randomseed=no
722 AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
723 if test "x$enable_randomseed" != "xno"; then
724         have_randomseed=yes
725 fi
726 AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
727
728 # ------------------------------------------------------------------------------
729 have_backlight=no
730 AC_ARG_ENABLE(backlight, AS_HELP_STRING([--disable-backlight], [disable backlight tools]))
731 if test "x$enable_backlight" != "xno"; then
732         have_backlight=yes
733 fi
734 AM_CONDITIONAL(ENABLE_BACKLIGHT, [test "$have_backlight" = "yes"])
735
736 # ------------------------------------------------------------------------------
737 have_rfkill=no
738 AC_ARG_ENABLE(rfkill, AS_HELP_STRING([--disable-rfkill], [disable rfkill tools]))
739 if test "x$enable_rfkill" != "xno"; then
740         have_rfkill=yes
741 fi
742 AM_CONDITIONAL(ENABLE_RFKILL, [test "$have_rfkill" = "yes"])
743
744 # ------------------------------------------------------------------------------
745 have_logind=no
746 AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
747 if test "x$enable_logind" != "xno"; then
748         have_logind=yes
749 fi
750 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
751 AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
752
753 # ------------------------------------------------------------------------------
754 have_machined=no
755 AC_ARG_ENABLE(machined, AS_HELP_STRING([--disable-machined], [disable machine daemon]))
756 if test "x$enable_machined" != "xno"; then
757         have_machined=yes
758 fi
759 AM_CONDITIONAL(ENABLE_MACHINED, [test "$have_machined" = "yes"])
760 AS_IF([test "$have_machined" = "yes"], [ AC_DEFINE(HAVE_MACHINED, [1], [Machined support available]) ])
761
762 # ------------------------------------------------------------------------------
763 have_hostnamed=no
764 AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
765 if test "x$enable_hostnamed" != "xno"; then
766         have_hostnamed=yes
767 fi
768 AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
769
770 # ------------------------------------------------------------------------------
771 have_timedated=no
772 AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
773 if test "x$enable_timedated" != "xno"; then
774         have_timedated=yes
775 fi
776 AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
777
778 # ------------------------------------------------------------------------------
779 have_localed=no
780 AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
781 if test "x$enable_localed" != "xno"; then
782         have_localed=yes
783 fi
784 AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
785
786 # ------------------------------------------------------------------------------
787 have_coredump=no
788 AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
789 if test "x$enable_coredump" != "xno"; then
790         have_coredump=yes
791 fi
792 AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
793
794 # ------------------------------------------------------------------------------
795 have_polkit=no
796 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
797 if test "x$enable_polkit" != "xno"; then
798         AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
799         have_polkit=yes
800 fi
801 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
802
803 # ------------------------------------------------------------------------------
804 AC_ARG_ENABLE(networkd, AS_HELP_STRING([--disable-networkd], [disable networkd]))
805 if test "x$enable_networkd" != "xno"; then
806         AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled])
807         have_networkd=yes
808 fi
809 AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"])
810
811 # ------------------------------------------------------------------------------
812 have_efi=no
813 AC_ARG_ENABLE(efi, AS_HELP_STRING([--disable-efi], [disable EFI support]))
814 if test "x$enable_efi" != "xno"; then
815         AC_DEFINE(ENABLE_EFI, 1, [Define if EFI support is to be enabled])
816         have_efi=yes
817 fi
818 AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
819
820 # ------------------------------------------------------------------------------
821 have_multi_seat_x=no
822 AC_ARG_ENABLE(multi_seat_x, AS_HELP_STRING([--disable-multi-seat-x], [do not build multi-seat-x]))
823 if test "x$enable_multi_seat_x" != "xno"; then
824         have_multi_seat_x=yes
825 fi
826 AM_CONDITIONAL(ENABLE_MULTI_SEAT_X, [test "$have_multi_seat_x" = "yes"])
827
828 # ------------------------------------------------------------------------------
829 have_kdbus=no
830 AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--enable-kdbus], [do connect to kdbus by default]))
831 if test "x$enable_kdbus" = "xyes"; then
832         AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus support is to be enabled])
833         have_kdbus=yes
834         M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
835 fi
836 AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
837
838 # ------------------------------------------------------------------------------
839 AC_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
845 AC_ARG_WITH(rc-local-script-path-stop,
846         AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
847                 [Path to /usr/sbin/halt.local]),
848         [RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
849         [RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
850
851 AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
852 AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
853
854 AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
855 AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
856
857 # ------------------------------------------------------------------------------
858 AC_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
864 AC_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
870 AC_DEFINE_UNQUOTED(KBD_LOADKEYS, ["$KBD_LOADKEYS"], [Path of loadkeys])
871 AC_DEFINE_UNQUOTED(KBD_SETFONT, ["$KBD_SETFONT"], [Path of setfont])
872
873 AC_SUBST(KBD_LOADKEYS)
874 AC_SUBST(KBD_SETFONT)
875
876 AC_ARG_WITH(telinit,
877         AS_HELP_STRING([--with-telinit=PATH],
878                 [Path to telinit]),
879         [TELINIT="$withval"],
880         [TELINIT="/lib/sysvinit/telinit"])
881
882 AC_DEFINE_UNQUOTED(TELINIT, ["$TELINIT"], [Path to telinit])
883
884 AC_SUBST(TELINIT)
885
886 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
887
888 # ------------------------------------------------------------------------------
889 have_myhostname=no
890 AC_ARG_ENABLE(myhostname, AS_HELP_STRING([--disable-myhostname], [disable nss-myhostname support]))
891 if test "x$enable_myhostname" != "xno"; then
892         AC_HEADER_STDC
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])
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
904 fi
905 AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
906
907 # ------------------------------------------------------------------------------
908 AC_ARG_WITH(firmware-path,
909        AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
910           [Firmware search path (default="")]),
911        [], [with_firmware_path=""])
912 OLD_IFS=$IFS
913 IFS=:
914 for 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
920 done
921 IFS=$OLD_IFS
922 AC_SUBST(FIRMWARE_PATH)
923 AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
924 AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
925
926 # ------------------------------------------------------------------------------
927 AC_ARG_ENABLE([gudev],
928        AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
929        [], [enable_gudev=yes])
930 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]) ])
931 AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
932 AS_IF([test "x$enable_gudev" = "xyes"], [ AC_DEFINE(HAVE_GLIB, 1, [Define if glib is available]) ])
933
934 # ------------------------------------------------------------------------------
935 have_manpages=no
936 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
937 AS_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 ])
943 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
944
945 # ------------------------------------------------------------------------------
946
947 # Location of the init scripts as mandated by LSB
948 SYSTEM_SYSVINIT_PATH=/etc/init.d
949 SYSTEM_SYSVRCND_PATH=/etc/rc.d
950
951 AC_ARG_WITH([sysvinit-path],
952         [AS_HELP_STRING([--with-sysvinit-path=PATH],
953                 [Specify the path to where the SysV init scripts are located])],
954         [SYSTEM_SYSVINIT_PATH="$withval"],
955         [])
956
957 AC_ARG_WITH([sysvrcnd-path],
958         [AS_HELP_STRING([--with-sysvrcnd-path=PATH],
959                 [Specify the path to the base directory for the SysV rcN.d directories])],
960         [SYSTEM_SYSVRCND_PATH="$withval"],
961         [])
962
963 if 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"
966         M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
967 elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
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.])
969 else
970         SYSTEM_SYSV_COMPAT="no"
971 fi
972
973 AC_SUBST(SYSTEM_SYSVINIT_PATH)
974 AC_SUBST(SYSTEM_SYSVRCND_PATH)
975 AC_SUBST(M4_DEFINES)
976
977 AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
978
979 AC_ARG_WITH([tty-gid],
980         [AS_HELP_STRING([--with-tty-gid=GID],
981                 [Specify the numeric GID of the 'tty' group])],
982         [AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])],
983         [])
984
985 AC_ARG_WITH([dbuspolicydir],
986         AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
987         [],
988         [with_dbuspolicydir=$($PKG_CONFIG --variable=sysconfdir dbus-1)/dbus-1/system.d])
989
990 AC_ARG_WITH([dbussessionservicedir],
991         AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
992         [],
993         [with_dbussessionservicedir=$($PKG_CONFIG --variable=session_bus_services_dir dbus-1)])
994
995 AC_ARG_WITH([dbussystemservicedir],
996         AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
997         [],
998         [with_dbussystemservicedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../system-services)])
999
1000 AC_ARG_WITH([dbusinterfacedir],
1001         AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
1002         [],
1003         [with_dbusinterfacedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../interfaces)])
1004
1005 AC_ARG_WITH([bashcompletiondir],
1006         AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
1007         [],
1008         [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
1009                 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
1010         ] , [
1011                 with_bashcompletiondir=${datadir}/bash-completion/completions
1012         ])])
1013
1014 AC_ARG_WITH([zshcompletiondir],
1015         AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
1016         [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
1017
1018 AC_ARG_WITH([rootprefix],
1019         AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
1020         [], [with_rootprefix=${ac_default_prefix}])
1021
1022 AC_ARG_WITH([rootlibdir],
1023         AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
1024         [],
1025         [with_rootlibdir=${libdir}])
1026
1027 AC_ARG_WITH([pamlibdir],
1028         AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
1029         [],
1030         [with_pamlibdir=${with_rootlibdir}/security])
1031
1032 AC_ARG_WITH([pamconfdir],
1033         AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
1034         [],
1035         [with_pamconfdir=${sysconfdir}/pam.d])
1036
1037 AC_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
1046 AS_IF([test "x${enable_split_usr}" = "xyes"], [
1047         AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
1048 ])
1049
1050 # Work around intltoolize and gtk-doc problems in VPATH builds
1051 AM_CONDITIONAL([ENABLE_GTK_DOC_TESTS], [test "x$0" = "x./configure"],
1052                                        [Define to do gtk-doc tests])
1053 AS_IF([test "x$0" != "x./configure"], [
1054         AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
1055 ])
1056
1057 AC_ARG_ENABLE(tests,
1058        [AC_HELP_STRING([--disable-tests], [disable tests])],
1059        enable_tests=$enableval, enable_tests=yes)
1060 AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
1061
1062 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
1063 AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
1064 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
1065 AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir])
1066 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
1067 AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
1068 AC_SUBST([pamlibdir], [$with_pamlibdir])
1069 AC_SUBST([pamconfdir], [$with_pamconfdir])
1070 AC_SUBST([rootprefix], [$with_rootprefix])
1071 AC_SUBST([rootlibdir], [$with_rootlibdir])
1072
1073 AC_CONFIG_FILES([
1074         Makefile po/Makefile.in
1075         docs/libudev/Makefile
1076         docs/libudev/version.xml
1077         docs/gudev/Makefile
1078         docs/gudev/version.xml
1079 ])
1080
1081 AC_OUTPUT
1082 AC_MSG_RESULT([
1083         $PACKAGE_NAME $VERSION
1084
1085         libcryptsetup:           ${have_libcryptsetup}
1086         tcpwrap:                 ${have_tcpwrap}
1087         PAM:                     ${have_pam}
1088         AUDIT:                   ${have_audit}
1089         IMA:                     ${have_ima}
1090         SELinux:                 ${have_selinux}
1091         SMACK:                   ${have_smack}
1092         XZ:                      ${have_xz}
1093         ACL:                     ${have_acl}
1094         XATTR:                   ${have_xattr}
1095         GCRYPT:                  ${have_gcrypt}
1096         QRENCODE:                ${have_qrencode}
1097         MICROHTTPD:              ${have_microhttpd}
1098         CHKCONFIG:               ${have_chkconfig}
1099         binfmt:                  ${have_binfmt}
1100         vconsole:                ${have_vconsole}
1101         readahead:               ${have_readahead}
1102         bootchart:               ${have_bootchart}
1103         quotacheck:              ${have_quotacheck}
1104         tmpfiles:                ${have_tmpfiles}
1105         randomseed:              ${have_randomseed}
1106         backlight:               ${have_backlight}
1107         rfkill:                  ${have_rfkill}
1108         logind:                  ${have_logind}
1109         machined:                ${have_machined}
1110         hostnamed:               ${have_hostnamed}
1111         timedated:               ${have_timedated}
1112         localed:                 ${have_localed}
1113         coredump:                ${have_coredump}
1114         polkit:                  ${have_polkit}
1115         efi:                     ${have_efi}
1116         kmod:                    ${have_kmod}
1117         blkid:                   ${have_blkid}
1118         dbus:                    ${have_dbus}
1119         nss-myhostname:          ${have_myhostname}
1120         gudev:                   ${enable_gudev}
1121         gintrospection:          ${enable_introspection}
1122         multi-seat-x:            ${have_multi_seat_x}
1123         kdbus:                   ${have_kdbus}
1124         Python:                  ${have_python}
1125         Python Headers:          ${have_python_devel}
1126         man pages:               ${have_manpages}
1127         gtk-doc:                 ${enable_gtk_doc}
1128         test coverage:           ${have_coverage}
1129         Split /usr:              ${enable_split_usr}
1130         SysV compatibility:      ${SYSTEM_SYSV_COMPAT}
1131         compatibility libraries: ${have_compat_libs}
1132
1133         prefix:                  ${prefix}
1134         rootprefix:              ${with_rootprefix}
1135         sysconf dir:             ${sysconfdir}
1136         datarootdir:             ${datarootdir}
1137         includedir:              ${includedir}
1138         include_prefix:          ${INCLUDE_PREFIX}
1139         lib dir:                 ${libdir}
1140         rootlib dir:             ${with_rootlibdir}
1141         SysV init scripts:       ${SYSTEM_SYSVINIT_PATH}
1142         SysV rc?.d directories:  ${SYSTEM_SYSVRCND_PATH}
1143         Build Python:            ${PYTHON}
1144         Installation Python:     ${PYTHON_BINARY}
1145         sphinx binary:           ${SPHINX_BUILD}
1146         firmware path:           ${FIRMWARE_PATH}
1147         PAM modules dir:         ${with_pamlibdir}
1148         PAM configuration dir:   ${with_pamconfdir}
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}
1153         Bash completions dir:    ${with_bashcompletiondir}
1154         Zsh completions dir:     ${with_zshcompletiondir}
1155         Extra start script:      ${RC_LOCAL_SCRIPT_PATH_START}
1156         Extra stop script:       ${RC_LOCAL_SCRIPT_PATH_STOP}
1157         Debug shell:             ${SUSHELL} @ ${DEBUGTTY}
1158
1159         CFLAGS:                  ${OUR_CFLAGS} ${CFLAGS}
1160         CPPFLAGS:                ${OUR_CPPFLAGS} ${CPPFLAGS}
1161         LDFLAGS:                 ${OUR_LDFLAGS} ${LDFLAGS}
1162         PYTHON_CFLAGS:           ${PYTHON_DEVEL_CFLAGS}
1163         PYTHON_LIBS:             ${PYTHON_DEVEL_LIBS}
1164 ])