chiark / gitweb /
a87a02656a7d83b5acf2323ebbdb593e0b307903
[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         [214],
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])
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], [$PATH:/usr/sbin:/sbin])
69 AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck], [$PATH:/usr/sbin:/sbin])
70
71 AC_PATH_PROG([KILL], [kill], [/usr/bin/kill], [$PATH:/usr/sbin:/sbin])
72
73 AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin])
74
75 AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
76
77 AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
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 undefined_sanitizer_cflags=
118 undefined_sanitizer_cppflags=
119 undefined_sanitizer_ldflags=
120 AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
121 AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
122             CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
123             AS_IF([test -z "$with_us_cflags"],
124                   [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
125             undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
126             undefined_sanitizer_cppflags="-DVALGRIND=1"
127             undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
128       ])
129
130 sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
131 sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
132 sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
133
134 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
135         -pipe \
136         -Wall \
137         -Wextra \
138         -Wno-inline \
139         -Wundef \
140         "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
141         -Wlogical-op \
142         -Wsign-compare \
143         -Wmissing-include-dirs \
144         -Wold-style-definition \
145         -Wpointer-arith \
146         -Winit-self \
147         -Wdeclaration-after-statement \
148         -Wfloat-equal \
149         -Wsuggest-attribute=noreturn \
150         -Wmissing-prototypes \
151         -Wstrict-prototypes \
152         -Wredundant-decls \
153         -Wmissing-declarations \
154         -Wmissing-noreturn \
155         -Wshadow \
156         -Wendif-labels \
157         -Wstrict-aliasing=2 \
158         -Wwrite-strings \
159         -Wno-long-long \
160         -Wno-overlength-strings \
161         -Wno-unused-parameter \
162         -Wno-missing-field-initializers \
163         -Wno-unused-result \
164         -Werror=overflow \
165         -Wdate-time \
166         -Wnested-externs \
167         -ffast-math \
168         -fno-common \
169         -fdiagnostics-show-option \
170         -fdiagnostics-color \
171         -fno-strict-aliasing \
172         -fvisibility=hidden \
173         -ffunction-sections \
174         -fdata-sections \
175         -fstack-protector \
176         -fstack-protector-strong \
177         -fPIE \
178         --param=ssp-buffer-size=4])
179 AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
180         [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
181                -flto -ffat-lto-objects])],
182         [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
183 AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
184
185 AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
186         [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
187                -Wp,-D_FORTIFY_SOURCE=2])],
188         [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
189 AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
190
191 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
192         -Wl,--as-needed \
193         -Wl,--no-undefined \
194         -Wl,--gc-sections \
195         -Wl,-z,relro \
196         -Wl,-z,now \
197         -pie \
198         -Wl,-fuse-ld=gold])
199 AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
200
201 AC_CHECK_SIZEOF(pid_t)
202 AC_CHECK_SIZEOF(uid_t)
203 AC_CHECK_SIZEOF(gid_t)
204 AC_CHECK_SIZEOF(time_t)
205 AC_CHECK_SIZEOF(rlim_t,,[
206        #include <sys/time.h>
207        #include <sys/resource.h>
208 ])
209
210 # ------------------------------------------------------------------------------
211 # we use python to build the man page index, and for systemd-python
212 have_python=no
213 AC_ARG_WITH([python],
214         [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
215
216 have_lxml=no
217 AS_IF([test "x$with_python" != "xno"], [
218         AM_PATH_PYTHON(,, [:])
219         AS_IF([test "x$PYTHON" != "x:"], [
220                 AC_MSG_CHECKING([for python lxml module])
221                 AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
222                 AC_MSG_RESULT([$have_lxml])
223                 AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
224                       [AC_MSG_WARN([*** python support requires python-lxml module installed])])
225         ])
226 ])
227 AS_IF([test "$have_python" != "yes"], [
228       AS_IF([test "$with_python" = "yes"],
229             [AC_MSG_ERROR([*** python support requested but python support not found])])
230       AS_IF([test "$with_python" != "no"],
231             [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
232 ])
233
234 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
235 AS_IF([test "x$PYTHON_BINARY" = "x"],
236       [AS_IF([test "x$have_python" = "xyes"],
237              [PYTHON_BINARY="$(which "$PYTHON")"],
238              [PYTHON_BINARY=/usr/bin/python])])
239 AC_ARG_VAR(PYTHON_BINARY, [Python binary used to launch installed scripts])
240
241 AS_IF([test "x$have_python" != "xyes" -a "x$enable_python_devel" = "xyes"],
242       [AC_MSG_ERROR([*** python-devel support requires --with-python])])
243
244 have_python_devel=no
245 AC_ARG_ENABLE(python_devel, AS_HELP_STRING([--disable-python-devel], [Do not build python modules]))
246 AS_IF([test "x$have_python" = "xyes" -a "x$enable_python_devel" != "xno"], [
247       PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}],
248             [have_python_devel=yes],
249             [PKG_CHECK_MODULES([PYTHON_DEVEL], [python],
250                   [have_python_devel=yes],
251                   [have_python_devel=no])])
252       AS_IF([test "x$have_python_devel" = xno -a "x$enable_python_devel" = xyes],
253             [AC_MSG_ERROR([*** python-devel support requested but libraries not found])])
254       AC_PATH_PROGS(SPHINX_BUILD, sphinx-build-${PYTHON_VERSION} sphinx-build)
255 ])
256 AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
257
258 # ------------------------------------------------------------------------------
259
260 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
261 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
262 AC_CHECK_HEADERS([linux/btrfs.h], [], [])
263
264 # unconditionally pull-in librt with old glibc versions
265 AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
266
267 save_LIBS="$LIBS"
268 LIBS=
269 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
270 CAP_LIBS="$LIBS"
271 AC_SUBST(CAP_LIBS)
272
273 LIBS=
274 AC_SEARCH_LIBS([mq_open], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
275 RT_LIBS="$LIBS"
276 AC_SUBST(RT_LIBS)
277 LIBS="$save_LIBS"
278
279 AC_CHECK_FUNCS([fanotify_init fanotify_mark])
280 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
281 AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, LO_FLAGS_PARTSCAN], [], [], [[#include <sys/types.h>
282 #include <unistd.h>
283 #include <sys/mount.h>
284 #include <fcntl.h>
285 #include <sched.h>
286 #include <linux/loop.h>]])
287
288 # This makes sure pkg.m4 is available.
289 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
290
291 # ------------------------------------------------------------------------------
292 have_dbus=no
293 AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
294 AS_IF([test "x$enable_dbus" != "xno"], [
295         PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2],
296                 [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes],
297                 [have_dbus=no])
298         AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"],
299                 [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])])
300 AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
301
302 # ------------------------------------------------------------------------------
303 have_compat_libs=no
304 AC_ARG_ENABLE([compat_libs], AS_HELP_STRING([--enable-compat-libs],[Enable creation of compatibility libraries]),
305                 [case "${enableval}" in
306                         yes) have_compat_libs=yes ;;
307                         no) have_compat_libs=no ;;
308                         *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libs) ;;
309                 esac],
310                 [have_compat_libs=no])
311 AM_CONDITIONAL([ENABLE_COMPAT_LIBS], [test "$have_compat_libs" = "yes"])
312
313 # ------------------------------------------------------------------------------
314 have_coverage=no
315 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
316 if test "x$enable_coverage" = "xyes" ; then
317         AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
318         if test "x$lcov_found" = xno ; then
319                 AC_MSG_ERROR([*** lcov support requested but the program was not found])
320         else
321                 lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
322                 lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
323                 if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
324                         AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
325                 else
326                         have_coverage=yes
327                         CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
328                         -fprofile-arcs \
329                         -ftest-coverage])
330                         AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
331                 fi
332         fi
333 fi
334 AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
335
336 # ------------------------------------------------------------------------------
337 have_kmod=no
338 AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
339 if test "x$enable_kmod" != "xno"; then
340         PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
341         if test "x$have_kmod" = "xyes"; then
342                 PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
343                         [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
344                         AC_MSG_ERROR([*** kmod version >= 15 not found]))
345         fi
346         if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
347                 AC_MSG_ERROR([*** kmod support requested, but libraries not found])
348         fi
349 fi
350 AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
351
352 # ------------------------------------------------------------------------------
353 have_blkid=no
354 AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
355 if test "x$enable_blkid" != "xno"; then
356         PKG_CHECK_MODULES(BLKID, [ blkid >= 2.20 ],
357                 [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
358         if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
359                 AC_MSG_ERROR([*** blkid support requested but libraries not found])
360         fi
361 fi
362 AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
363
364 # ------------------------------------------------------------------------------
365 have_seccomp=no
366 AC_ARG_ENABLE(seccomp, AS_HELP_STRING([--disable-seccomp], [Disable optional SECCOMP support]))
367 if test "x$enable_seccomp" != "xno"; then
368         PKG_CHECK_MODULES(SECCOMP, [libseccomp >= 1.0.0],
369                [AC_DEFINE(HAVE_SECCOMP, 1, [Define if seccomp is available])
370                 have_seccomp=yes
371                 M4_DEFINES="$M4_DEFINES -DHAVE_SECCOMP"],
372                [have_seccomp=no])
373         if test "x$have_seccomp" = "xno" -a "x$enable_seccomp" = "xyes"; then
374                 AC_MSG_ERROR([*** seccomp support requested but libraries not found])
375         fi
376 fi
377 AM_CONDITIONAL(HAVE_SECCOMP, [test "$have_seccomp" = "yes"])
378
379 # ------------------------------------------------------------------------------
380 have_ima=yes
381 AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]),
382                 [case "${enableval}" in
383                         yes) have_ima=yes ;;
384                         no) have_ima=no ;;
385                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
386                 esac],
387                 [have_ima=yes])
388
389 if test "x${have_ima}" != xno ; then
390         AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
391 fi
392
393 # ------------------------------------------------------------------------------
394 have_chkconfig=yes
395 AC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optional chkconfig support]),
396                 [case "${enableval}" in
397                         yes) have_chkconfig=yes ;;
398                         no) have_chkconfig=no ;;
399                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-chkconfig) ;;
400                 esac],
401                 [AC_PATH_PROG(CHKCONFIG, chkconfig)
402                 if test -z "$CHKCONFIG"; then
403                         have_chkconfig=no
404                 else
405                         have_chkconfig=yes
406                 fi])
407
408 if test "x${have_chkconfig}" != xno ; then
409         AC_DEFINE(HAVE_CHKCONFIG, 1, [Define if CHKCONFIG is available])
410 fi
411
412 # ------------------------------------------------------------------------------
413 have_selinux=no
414 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
415 if test "x$enable_selinux" != "xno"; then
416         PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
417                 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
418                  have_selinux=yes
419                  M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
420                 [have_selinux=no])
421         if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
422                 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
423         fi
424 fi
425 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
426
427 have_apparmor=no
428 AC_ARG_ENABLE(apparmor, AS_HELP_STRING([--disable-apparmor], [Disable optional AppArmor support]))
429 if test "x$enable_apparmor" != "xno"; then
430         PKG_CHECK_MODULES([APPARMOR], [libapparmor],
431                 [AC_DEFINE(HAVE_APPARMOR, 1, [Define if AppArmor is available])
432                  have_apparmor=yes
433                  M4_DEFINES="$M4_DEFINES -DHAVE_APPARMOR"],
434                 [have_apparmor=no])
435         if test "x$have_apparmor" = xno -a "x$enable_apparmor" = xyes; then
436                 AC_MSG_ERROR([*** AppArmor support requested but libraries not found])
437         fi
438 fi
439 AM_CONDITIONAL(HAVE_APPARMOR, [test "$have_apparmor" = "yes"])
440
441
442 AC_ARG_WITH(debug-shell,
443         AS_HELP_STRING([--with-debug-shell=PATH],
444                 [Path to debug shell binary]),
445         [SUSHELL="$withval"],[
446         AS_IF([test "x${have_selinux}" != "xno"], [SUSHELL="/sbin/sushell"] , [SUSHELL="/bin/sh"])])
447
448 AC_SUBST(SUSHELL)
449
450 AC_ARG_WITH([debug-tty],
451         AS_HELP_STRING([--with-debug-tty=PATH],
452                 [Specify the tty device for debug shell]),
453         [DEBUGTTY="$withval"],
454         [DEBUGTTY=/dev/tty9])
455
456 AC_SUBST(DEBUGTTY)
457
458 # ------------------------------------------------------------------------------
459 have_xz=no
460 AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
461 if test "x$enable_xz" != "xno"; then
462         PKG_CHECK_MODULES(XZ, [ liblzma ],
463                 [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no)
464         if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then
465                 AC_MSG_ERROR([*** Xz support requested but libraries not found])
466         fi
467 fi
468 AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
469
470 # ------------------------------------------------------------------------------
471 AC_ARG_ENABLE([pam],
472         AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
473                 [case "${enableval}" in
474                         yes) have_pam=yes ;;
475                         no) have_pam=no ;;
476                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
477                 esac],
478                 [have_pam=auto])
479
480 if test "x${have_pam}" != xno ; then
481         AC_CHECK_HEADERS(
482                 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
483                 [have_pam=yes],
484                 [if test "x$have_pam" = xyes ; then
485                         AC_MSG_ERROR([*** PAM headers not found.])
486                 fi])
487
488         AC_CHECK_LIB(
489                 [pam],
490                 [pam_syslog],
491                 [have_pam=yes],
492                 [if test "x$have_pam" = xyes ; then
493                         AC_MSG_ERROR([*** libpam not found.])
494                 fi])
495
496         if test "x$have_pam" = xyes ; then
497                 PAM_LIBS="-lpam -lpam_misc"
498                 AC_DEFINE(HAVE_PAM, 1, [PAM available])
499                 M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
500         else
501                 have_pam=no
502         fi
503 else
504         PAM_LIBS=
505 fi
506 AC_SUBST(PAM_LIBS)
507 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
508
509 # ------------------------------------------------------------------------------
510 AC_ARG_ENABLE([acl],
511         AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
512                 [case "${enableval}" in
513                         yes) have_acl=yes ;;
514                         no) have_acl=no ;;
515                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
516                 esac],
517                 [have_acl=auto])
518
519 if test "x${have_acl}" != xno ; then
520         AC_CHECK_HEADERS(
521                 [sys/acl.h acl/libacl.h],
522                 [have_acl=yes],
523                 [if test "x$have_acl" = xyes ; then
524                         AC_MSG_ERROR([*** ACL headers not found.])
525                 fi])
526
527         AC_CHECK_LIB(
528                 [acl],
529                 [acl_get_file],
530                 [have_acl=yes],
531                 [if test "x$have_acl" = xyes ; then
532                         AC_MSG_ERROR([*** libacl not found.])
533                 fi])
534
535         if test "x$have_acl" = xyes ; then
536                 ACL_LIBS="-lacl"
537                 AC_DEFINE(HAVE_ACL, 1, [ACL available])
538         else
539                 have_acl=no
540         fi
541 else
542         ACL_LIBS=
543 fi
544 AC_SUBST(ACL_LIBS)
545 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
546
547 # ------------------------------------------------------------------------------
548 AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack],[Disable optional SMACK support]),
549                 [case "${enableval}" in
550                         yes) have_smack=yes ;;
551                         no) have_smack=no ;;
552                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
553                 esac],
554                 [have_smack=auto])
555
556 if test "x${have_smack}" = xauto; then
557         M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
558         have_smack=yes
559 fi
560
561 AC_ARG_WITH(smack-run-label,
562 AS_HELP_STRING([--with-smack-run-label=STRING],
563         [run systemd --system with a specific SMACK label]),
564         [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run with a smack label])],
565         [])
566
567 if test "x${have_smack}" = xyes ; then
568         AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
569 fi
570
571 # ------------------------------------------------------------------------------
572 AC_ARG_ENABLE([gcrypt],
573         AS_HELP_STRING([--disable-gcrypt],[Disable optional GCRYPT support]),
574                 [case "${enableval}" in
575                         yes) have_gcrypt=yes ;;
576                         no) have_gcrypt=no ;;
577                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
578                 esac],
579                 [have_gcrypt=auto])
580
581 if test "x${have_gcrypt}" != xno ; then
582         AM_PATH_LIBGCRYPT(
583                 [1.4.5],
584                 [have_gcrypt=yes],
585                 [if test "x$have_gcrypt" = xyes ; then
586                         AC_MSG_ERROR([*** GCRYPT headers not found.])
587                 fi])
588
589         if test "x$have_gcrypt" = xyes ; then
590                 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
591                 GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS"
592                 AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
593         else
594                 have_gcrypt=no
595         fi
596 else
597         GCRYPT_LIBS=
598         GCRYPT_CFLAGS=
599 fi
600 AC_SUBST(GCRYPT_LIBS)
601 AC_SUBST(GCRYPT_CFLAGS)
602 AM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
603
604 # ------------------------------------------------------------------------------
605 AC_ARG_ENABLE([audit],
606         AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
607                 [case "${enableval}" in
608                         yes) have_audit=yes ;;
609                         no) have_audit=no ;;
610                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
611                 esac],
612                 [have_audit=auto])
613
614 if test "x${have_audit}" != xno ; then
615         AC_CHECK_HEADERS(
616                 [libaudit.h],
617                 [have_audit=yes],
618                 [if test "x$have_audit" = xyes ; then
619                         AC_MSG_ERROR([*** AUDIT headers not found.])
620                 fi])
621
622         AC_CHECK_LIB(
623                 [audit],
624                 [audit_open],
625                 [have_audit=yes],
626                 [if test "x$have_audit" = xyes ; then
627                         AC_MSG_ERROR([*** libaudit not found.])
628                 fi])
629
630         if test "x$have_audit" = xyes ; then
631                 AUDIT_LIBS="-laudit"
632                 AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
633         else
634                 have_audit=no
635         fi
636 else
637         AUDIT_LIBS=
638 fi
639 AC_SUBST(AUDIT_LIBS)
640
641 # ------------------------------------------------------------------------------
642 AC_ARG_ENABLE([elfutils],
643         AS_HELP_STRING([--disable-elfutils],[Disable optional ELFUTILS support]),
644                 [case "${enableval}" in
645                         yes) have_elfutils=yes ;;
646                         no) have_elfutils=no ;;
647                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-elfutils) ;;
648                 esac],
649                 [have_elfutils=auto])
650
651 if test "x${have_elfutils}" != xno ; then
652         AC_CHECK_HEADERS(
653                 [elfutils/libdwfl.h],
654                 [have_elfutils=yes],
655                 [if test "x$have_elfutils" = xyes ; then
656                         AC_MSG_ERROR([*** ELFUTILS headers not found.])
657                 fi])
658
659         AC_CHECK_LIB(
660                 [dw],
661                 [dwfl_begin],
662                 [have_elfutils=yes],
663                 [if test "x$have_elfutils" = xyes ; then
664                         AC_MSG_ERROR([*** ELFUTILS libs not found.])
665                 fi])
666
667         if test "x$have_elfutils" = xyes ; then
668                 ELFUTILS_LIBS="-lelf -ldw"
669                 AC_DEFINE(HAVE_ELFUTILS, 1, [ELFUTILS available])
670         else
671                 have_elfutils=no
672         fi
673 else
674         ELFUTILS_LIBS=
675 fi
676 AC_SUBST(ELFUTILS_LIBS)
677 AM_CONDITIONAL(HAVE_ELFUTILS, [test "$have_elfutils" = "yes"])
678
679 # ------------------------------------------------------------------------------
680 have_libcryptsetup=no
681 AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
682 if test "x$enable_libcryptsetup" != "xno"; then
683         PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.6.0 ],
684                 [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
685         if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
686                 AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
687         fi
688 fi
689 AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
690
691 # ------------------------------------------------------------------------------
692 have_qrencode=no
693 AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
694 if test "x$enable_qrencode" != "xno"; then
695         PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
696                 [AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
697         if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
698                 AC_MSG_ERROR([*** qrencode support requested but libraries not found])
699         fi
700 fi
701 AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
702
703 # ------------------------------------------------------------------------------
704 have_microhttpd=no
705 AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
706 if test "x$enable_microhttpd" != "xno"; then
707         PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.33],
708                 [AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available]) have_microhttpd=yes], have_microhttpd=no)
709         if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
710                 AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
711         fi
712 fi
713 AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
714
715 # ------------------------------------------------------------------------------
716 have_gnutls=no
717 AC_ARG_ENABLE(gnutls, AS_HELP_STRING([--disable-gnutls], [disable gnutls support]))
718 if test "x$enable_gnutls" != "xno"; then
719         PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.1.4],
720                 [AC_DEFINE(HAVE_GNUTLS, 1, [Define if gnutls is available]) have_gnutls=yes], have_gnutls=no)
721         if test "x$have_gnutls" = xno -a "x$enable_gnutls" = xyes; then
722                 AC_MSG_ERROR([*** gnutls support requested but libraries not found])
723         fi
724 fi
725 AM_CONDITIONAL(HAVE_GNUTLS, [test "$have_gnutls" = "yes"])
726
727 # ------------------------------------------------------------------------------
728 have_binfmt=no
729 AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
730 if test "x$enable_binfmt" != "xno"; then
731         have_binfmt=yes
732 fi
733 AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
734
735 # ------------------------------------------------------------------------------
736 have_vconsole=no
737 AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
738 if test "x$enable_vconsole" != "xno"; then
739         have_vconsole=yes
740 fi
741 AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
742
743 # ------------------------------------------------------------------------------
744 have_readahead=no
745 AC_ARG_ENABLE(readahead, AS_HELP_STRING([--disable-readahead], [disable readahead tools]))
746 if test "x$enable_readahead" != "xno"; then
747         have_readahead=yes
748 fi
749 AM_CONDITIONAL(ENABLE_READAHEAD, [test "$have_readahead" = "yes"])
750
751 # ------------------------------------------------------------------------------
752 have_bootchart=no
753 AC_ARG_ENABLE(bootchart, AS_HELP_STRING([--disable-bootchart], [disable bootchart tool]))
754 if test "x$enable_bootchart" != "xno"; then
755         have_bootchart=yes
756 fi
757 AM_CONDITIONAL(ENABLE_BOOTCHART, [test "$have_bootchart" = "yes"])
758
759 # ------------------------------------------------------------------------------
760 have_quotacheck=no
761 AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
762 if test "x$enable_quotacheck" != "xno"; then
763         have_quotacheck=yes
764 fi
765 AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
766
767 # ------------------------------------------------------------------------------
768 have_tmpfiles=no
769 AC_ARG_ENABLE(tmpfiles, AS_HELP_STRING([--disable-tmpfiles], [disable tmpfiles support]))
770 if test "x$enable_tmpfiles" != "xno"; then
771         have_tmpfiles=yes
772 fi
773 AM_CONDITIONAL(ENABLE_TMPFILES, [test "$have_tmpfiles" = "yes"])
774
775 # ------------------------------------------------------------------------------
776 have_sysusers=no
777 AC_ARG_ENABLE(sysusers, AS_HELP_STRING([--disable-sysusers], [disable sysusers support]))
778 if test "x$enable_sysusers" != "xno"; then
779         have_sysusers=yes
780 fi
781 AM_CONDITIONAL(ENABLE_SYSUSERS, [test "$have_sysusers" = "yes"])
782
783 # ------------------------------------------------------------------------------
784 have_randomseed=no
785 AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
786 if test "x$enable_randomseed" != "xno"; then
787         have_randomseed=yes
788 fi
789 AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
790
791 # ------------------------------------------------------------------------------
792 have_backlight=no
793 AC_ARG_ENABLE(backlight, AS_HELP_STRING([--disable-backlight], [disable backlight tools]))
794 if test "x$enable_backlight" != "xno"; then
795         have_backlight=yes
796 fi
797 AM_CONDITIONAL(ENABLE_BACKLIGHT, [test "$have_backlight" = "yes"])
798
799 # ------------------------------------------------------------------------------
800 have_rfkill=no
801 AC_ARG_ENABLE(rfkill, AS_HELP_STRING([--disable-rfkill], [disable rfkill tools]))
802 if test "x$enable_rfkill" != "xno"; then
803         have_rfkill=yes
804 fi
805 AM_CONDITIONAL(ENABLE_RFKILL, [test "$have_rfkill" = "yes"])
806
807 # ------------------------------------------------------------------------------
808 have_logind=no
809 AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
810 if test "x$enable_logind" != "xno"; then
811         have_logind=yes
812 fi
813 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
814 AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
815
816 # ------------------------------------------------------------------------------
817 have_machined=no
818 AC_ARG_ENABLE(machined, AS_HELP_STRING([--disable-machined], [disable machine daemon]))
819 if test "x$enable_machined" != "xno"; then
820         have_machined=yes
821 fi
822 AM_CONDITIONAL(ENABLE_MACHINED, [test "$have_machined" = "yes"])
823 AS_IF([test "$have_machined" = "yes"], [ AC_DEFINE(HAVE_MACHINED, [1], [Machined support available]) ])
824
825 # ------------------------------------------------------------------------------
826 have_hostnamed=no
827 AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
828 if test "x$enable_hostnamed" != "xno"; then
829         have_hostnamed=yes
830 fi
831 AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
832
833 # ------------------------------------------------------------------------------
834 have_timedated=no
835 AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
836 if test "x$enable_timedated" != "xno"; then
837         have_timedated=yes
838 fi
839 AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
840
841 # ------------------------------------------------------------------------------
842 have_timesyncd=no
843 AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon]))
844 if test "x$enable_timesyncd" != "xno"; then
845         have_timesyncd=yes
846 fi
847 AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"])
848
849 AC_ARG_WITH(ntp-servers,
850         AS_HELP_STRING([--with-ntp-servers=NTPSERVERS],
851                 [Space-separated list of default NTP servers]),
852         [NTP_SERVERS="$withval"],
853         [NTP_SERVERS="time1.google.com time2.google.com time3.google.com time4.google.com"])
854
855 AC_DEFINE_UNQUOTED(NTP_SERVERS, ["$NTP_SERVERS"], [Default NTP Servers])
856 AC_SUBST(NTP_SERVERS)
857
858 AC_ARG_WITH(time-epoch,
859         AS_HELP_STRING([--with-time-epoch=SECONDS],
860                 [Time epoch for time clients]),
861         [TIME_EPOCH="$withval"],
862         [TIME_EPOCH="`stat -c %Y ${srcdir}/NEWS 2>/dev/null || echo 0`"])
863
864 AC_DEFINE_UNQUOTED(TIME_EPOCH, [$TIME_EPOCH], [Time Epoch])
865
866 # ------------------------------------------------------------------------------
867 AC_ARG_WITH(system-uid-max,
868         AS_HELP_STRING([--with-system-uid-max=UID]
869                 [Maximum UID for system users]),
870         [SYSTEM_UID_MAX="$withval"],
871         [SYSTEM_UID_MAX="`awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' /etc/login.defs 2>/dev/null || echo 999`"])
872
873 AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
874 AC_SUBST(SYSTEM_UID_MAX)
875
876 # ------------------------------------------------------------------------------
877 AC_ARG_WITH(system-gid-max,
878         AS_HELP_STRING([--with-system-gid-max=GID]
879                 [Maximum GID for system groups]),
880         [SYSTEM_GID_MAX="$withval"],
881         [SYSTEM_GID_MAX="`awk 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }' /etc/login.defs 2>/dev/null || echo 999`"])
882
883 AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
884 AC_SUBST(SYSTEM_GID_MAX)
885
886 # ------------------------------------------------------------------------------
887 have_localed=no
888 AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
889 if test "x$enable_localed" != "xno"; then
890         have_localed=yes
891 fi
892 AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
893
894 # ------------------------------------------------------------------------------
895 have_coredump=no
896 AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
897 if test "x$enable_coredump" != "xno"; then
898         have_coredump=yes
899 fi
900 AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
901
902 # ------------------------------------------------------------------------------
903 have_polkit=no
904 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
905 if test "x$enable_polkit" != "xno"; then
906         AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
907         have_polkit=yes
908 fi
909 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
910
911 # ------------------------------------------------------------------------------
912 have_resolved=no
913 AC_ARG_ENABLE(resolved, AS_HELP_STRING([--disable-resolved], [disable resolve daemon]))
914 if test "x$enable_resolved" != "xno"; then
915         have_resolved=yes
916 fi
917 AM_CONDITIONAL(ENABLE_RESOLVED, [test "$have_resolved" = "yes"])
918
919 AC_ARG_WITH(dns-servers,
920         AS_HELP_STRING([--with-dns-servers=DNSSERVERS],
921                 [Space-separated list of default DNS servers]),
922         [DNS_SERVERS="$withval"],
923         [DNS_SERVERS="8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844"])
924
925 AC_DEFINE_UNQUOTED(DNS_SERVERS, ["$DNS_SERVERS"], [Default DNS Servers])
926 AC_SUBST(DNS_SERVERS)
927
928 # ------------------------------------------------------------------------------
929 have_networkd=no
930 AC_ARG_ENABLE(networkd, AS_HELP_STRING([--disable-networkd], [disable networkd]))
931 if test "x$enable_networkd" != "xno"; then
932         AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled])
933         have_networkd=yes
934 fi
935 AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"])
936
937 # ------------------------------------------------------------------------------
938 have_efi=no
939 AC_ARG_ENABLE(efi, AS_HELP_STRING([--disable-efi], [disable EFI support]))
940 if test "x$enable_efi" != "xno"; then
941         AC_DEFINE(ENABLE_EFI, 1, [Define if EFI support is to be enabled])
942         have_efi=yes
943 fi
944 AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
945
946 # ------------------------------------------------------------------------------
947 have_multi_seat_x=no
948 AC_ARG_ENABLE(multi_seat_x, AS_HELP_STRING([--disable-multi-seat-x], [do not build multi-seat-x]))
949 if test "x$enable_multi_seat_x" != "xno"; then
950         have_multi_seat_x=yes
951 fi
952 AM_CONDITIONAL(ENABLE_MULTI_SEAT_X, [test "$have_multi_seat_x" = "yes"])
953
954 # ------------------------------------------------------------------------------
955 have_kdbus=no
956 AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--enable-kdbus], [do connect to kdbus by default]))
957 if test "x$enable_kdbus" = "xyes"; then
958         AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus support is to be enabled])
959         have_kdbus=yes
960         M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
961 fi
962 AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
963
964 # ------------------------------------------------------------------------------
965 AC_ARG_WITH(rc-local-script-path-start,
966         AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
967                 [Path to /etc/rc.local]),
968         [RC_LOCAL_SCRIPT_PATH_START="$withval"],
969         [RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
970
971 AC_ARG_WITH(rc-local-script-path-stop,
972         AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
973                 [Path to /usr/sbin/halt.local]),
974         [RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
975         [RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
976
977 AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
978 AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
979
980 AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
981 AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
982
983 # ------------------------------------------------------------------------------
984 AC_ARG_WITH(kbd-loadkeys,
985         AS_HELP_STRING([--with-kbd-loadkeys=PATH],
986                 [Path to loadkeys]),
987         [KBD_LOADKEYS="$withval"],
988         [KBD_LOADKEYS="/usr/bin/loadkeys"])
989
990 AC_ARG_WITH(kbd-setfont,
991         AS_HELP_STRING([--with-kbd-setfont=PATH],
992                 [Path to setfont]),
993         [KBD_SETFONT="$withval"],
994         [KBD_SETFONT="/usr/bin/setfont"])
995
996 AC_DEFINE_UNQUOTED(KBD_LOADKEYS, ["$KBD_LOADKEYS"], [Path of loadkeys])
997 AC_DEFINE_UNQUOTED(KBD_SETFONT, ["$KBD_SETFONT"], [Path of setfont])
998
999 AC_SUBST(KBD_LOADKEYS)
1000 AC_SUBST(KBD_SETFONT)
1001
1002 AC_ARG_WITH(telinit,
1003         AS_HELP_STRING([--with-telinit=PATH],
1004                 [Path to telinit]),
1005         [TELINIT="$withval"],
1006         [TELINIT="/lib/sysvinit/telinit"])
1007
1008 AC_DEFINE_UNQUOTED(TELINIT, ["$TELINIT"], [Path to telinit])
1009
1010 AC_SUBST(TELINIT)
1011
1012 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
1013
1014 # ------------------------------------------------------------------------------
1015 have_myhostname=no
1016 AC_ARG_ENABLE(myhostname, AS_HELP_STRING([--disable-myhostname], [disable nss-myhostname support]))
1017 if test "x$enable_myhostname" != "xno"; then
1018         AC_HEADER_STDC
1019         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])
1020
1021         AC_C_CONST
1022         AC_TYPE_SIZE_T
1023         AC_HEADER_TIME
1024
1025         AC_FUNC_MALLOC
1026         AC_FUNC_SELECT_ARGTYPES
1027         AC_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
1028
1029         have_myhostname=yes
1030 fi
1031 AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
1032
1033 # ------------------------------------------------------------------------------
1034 AC_ARG_WITH(firmware-path,
1035        AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
1036           [Firmware search path (default="")]),
1037        [], [with_firmware_path=""])
1038 OLD_IFS=$IFS
1039 IFS=:
1040 for i in $with_firmware_path; do
1041        if test "x${FIRMWARE_PATH}" = "x"; then
1042               FIRMWARE_PATH="\\\"${i}/\\\""
1043        else
1044               FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
1045        fi
1046 done
1047 IFS=$OLD_IFS
1048 AC_SUBST(FIRMWARE_PATH)
1049 AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
1050 AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
1051
1052 # ------------------------------------------------------------------------------
1053 AC_ARG_ENABLE([gudev],
1054        AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
1055        [], [enable_gudev=yes])
1056 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]) ])
1057 AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
1058 AS_IF([test "x$enable_gudev" = "xyes"], [ AC_DEFINE(HAVE_GLIB, 1, [Define if glib is available]) ])
1059
1060 # ------------------------------------------------------------------------------
1061 have_manpages=no
1062 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
1063 AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
1064 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
1065
1066 # ------------------------------------------------------------------------------
1067
1068 # Location of the init scripts as mandated by LSB
1069 SYSTEM_SYSVINIT_PATH=/etc/init.d
1070 SYSTEM_SYSVRCND_PATH=/etc/rc.d
1071
1072 AC_ARG_WITH([sysvinit-path],
1073         [AS_HELP_STRING([--with-sysvinit-path=PATH],
1074                 [Specify the path to where the SysV init scripts are located])],
1075         [SYSTEM_SYSVINIT_PATH="$withval"],
1076         [])
1077
1078 AC_ARG_WITH([sysvrcnd-path],
1079         [AS_HELP_STRING([--with-sysvrcnd-path=PATH],
1080                 [Specify the path to the base directory for the SysV rcN.d directories])],
1081         [SYSTEM_SYSVRCND_PATH="$withval"],
1082         [])
1083
1084 if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
1085         AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
1086         SYSTEM_SYSV_COMPAT="yes"
1087         M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
1088 elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
1089         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.])
1090 else
1091         SYSTEM_SYSV_COMPAT="no"
1092 fi
1093
1094 AC_SUBST(SYSTEM_SYSVINIT_PATH)
1095 AC_SUBST(SYSTEM_SYSVRCND_PATH)
1096 AC_SUBST(M4_DEFINES)
1097
1098 AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
1099
1100 AC_ARG_WITH([tty-gid],
1101         [AS_HELP_STRING([--with-tty-gid=GID],
1102                 [Specify the numeric GID of the 'tty' group])],
1103         [TTY_GID="$withval"],
1104         [TTY_GID="5"])
1105
1106 AC_DEFINE_UNQUOTED(TTY_GID, [$TTY_GID], [GID of the 'tty' group])
1107 AC_SUBST(TTY_GID)
1108
1109 AC_ARG_WITH([dbuspolicydir],
1110         AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
1111         [],
1112         [with_dbuspolicydir=$($PKG_CONFIG --variable=sysconfdir dbus-1)/dbus-1/system.d])
1113
1114 AC_ARG_WITH([dbussessionservicedir],
1115         AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
1116         [],
1117         [with_dbussessionservicedir=$($PKG_CONFIG --variable=session_bus_services_dir dbus-1)])
1118
1119 AC_ARG_WITH([dbussystemservicedir],
1120         AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
1121         [],
1122         [with_dbussystemservicedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../system-services)])
1123
1124 AC_ARG_WITH([dbusinterfacedir],
1125         AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
1126         [],
1127         [with_dbusinterfacedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../interfaces)])
1128
1129 AC_ARG_WITH([bashcompletiondir],
1130         AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
1131         [],
1132         [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
1133                 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
1134         ] , [
1135                 with_bashcompletiondir=${datadir}/bash-completion/completions
1136         ])])
1137
1138 AC_ARG_WITH([zshcompletiondir],
1139         AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
1140         [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
1141
1142 AC_ARG_WITH([rootprefix],
1143         AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
1144         [], [with_rootprefix=${ac_default_prefix}])
1145
1146 AC_ARG_WITH([rootlibdir],
1147         AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
1148         [],
1149         [with_rootlibdir=${libdir}])
1150
1151 AC_ARG_WITH([pamlibdir],
1152         AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
1153         [],
1154         [with_pamlibdir=${with_rootlibdir}/security])
1155
1156 AC_ARG_WITH([pamconfdir],
1157         AS_HELP_STRING([--with-pamconfdir=DIR], [Directory for PAM configuration]),
1158         [],
1159         [with_pamconfdir=${sysconfdir}/pam.d])
1160
1161 AC_ARG_ENABLE([split-usr],
1162         AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
1163         [],
1164         [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
1165                 enable_split_usr=yes
1166         ], [
1167                 enable_split_usr=no
1168         ])])
1169
1170 AS_IF([test "x${enable_split_usr}" = "xyes"], [
1171         AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
1172 ])
1173
1174 # Work around intltoolize and gtk-doc problems in VPATH builds
1175 AM_CONDITIONAL([ENABLE_GTK_DOC_TESTS], [test "x$0" = "x./configure"],
1176                                        [Define to do gtk-doc tests])
1177 AS_IF([test "x$0" != "x./configure"], [
1178         AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
1179 ])
1180
1181 AC_ARG_ENABLE(tests,
1182        [AC_HELP_STRING([--disable-tests], [disable tests])],
1183        enable_tests=$enableval, enable_tests=yes)
1184 AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
1185
1186 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
1187 AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
1188 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
1189 AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir])
1190 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
1191 AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
1192 AC_SUBST([pamlibdir], [$with_pamlibdir])
1193 AC_SUBST([pamconfdir], [$with_pamconfdir])
1194 AC_SUBST([rootprefix], [$with_rootprefix])
1195 AC_SUBST([rootlibdir], [$with_rootlibdir])
1196
1197 AC_CONFIG_FILES([
1198         Makefile po/Makefile.in
1199         docs/libudev/Makefile
1200         docs/libudev/version.xml
1201         docs/gudev/Makefile
1202         docs/gudev/version.xml
1203 ])
1204
1205 AC_OUTPUT
1206 AC_MSG_RESULT([
1207         $PACKAGE_NAME $VERSION
1208
1209         libcryptsetup:           ${have_libcryptsetup}
1210         PAM:                     ${have_pam}
1211         AUDIT:                   ${have_audit}
1212         IMA:                     ${have_ima}
1213         AppArmor:                ${have_apparmor}
1214         SELinux:                 ${have_selinux}
1215         SECCOMP:                 ${have_seccomp}
1216         SMACK:                   ${have_smack}
1217         XZ:                      ${have_xz}
1218         ACL:                     ${have_acl}
1219         GCRYPT:                  ${have_gcrypt}
1220         QRENCODE:                ${have_qrencode}
1221         MICROHTTPD:              ${have_microhttpd}
1222         CHKCONFIG:               ${have_chkconfig}
1223         GNUTLS:                  ${have_gnutls}
1224         ELFUTILS:                ${have_elfutils}
1225         binfmt:                  ${have_binfmt}
1226         vconsole:                ${have_vconsole}
1227         readahead:               ${have_readahead}
1228         bootchart:               ${have_bootchart}
1229         quotacheck:              ${have_quotacheck}
1230         tmpfiles:                ${have_tmpfiles}
1231         sysusers:                ${have_sysusers}
1232         randomseed:              ${have_randomseed}
1233         backlight:               ${have_backlight}
1234         rfkill:                  ${have_rfkill}
1235         logind:                  ${have_logind}
1236         machined:                ${have_machined}
1237         hostnamed:               ${have_hostnamed}
1238         timedated:               ${have_timedated}
1239         timesyncd:               ${have_timesyncd}
1240         default NTP servers:     ${NTP_SERVERS}
1241         time epoch:              ${TIME_EPOCH}
1242         localed:                 ${have_localed}
1243         networkd:                ${have_networkd}
1244         resolved:                ${have_resolved}
1245         default DNS servers:     ${DNS_SERVERS}
1246         coredump:                ${have_coredump}
1247         polkit:                  ${have_polkit}
1248         efi:                     ${have_efi}
1249         kmod:                    ${have_kmod}
1250         blkid:                   ${have_blkid}
1251         dbus:                    ${have_dbus}
1252         nss-myhostname:          ${have_myhostname}
1253         gudev:                   ${enable_gudev}
1254         gintrospection:          ${enable_introspection}
1255         multi-seat-x:            ${have_multi_seat_x}
1256         kdbus:                   ${have_kdbus}
1257         Python:                  ${have_python}
1258         Python Headers:          ${have_python_devel}
1259         man pages:               ${have_manpages}
1260         gtk-doc:                 ${enable_gtk_doc}
1261         test coverage:           ${have_coverage}
1262         Split /usr:              ${enable_split_usr}
1263         SysV compatibility:      ${SYSTEM_SYSV_COMPAT}
1264         compatibility libraries: ${have_compat_libs}
1265
1266         prefix:                  ${prefix}
1267         rootprefix:              ${with_rootprefix}
1268         sysconf dir:             ${sysconfdir}
1269         datarootdir:             ${datarootdir}
1270         includedir:              ${includedir}
1271         include_prefix:          ${INCLUDE_PREFIX}
1272         lib dir:                 ${libdir}
1273         rootlib dir:             ${with_rootlibdir}
1274         SysV init scripts:       ${SYSTEM_SYSVINIT_PATH}
1275         SysV rc?.d directories:  ${SYSTEM_SYSVRCND_PATH}
1276         Build Python:            ${PYTHON}
1277         Installation Python:     ${PYTHON_BINARY}
1278         sphinx binary:           ${SPHINX_BUILD}
1279         firmware path:           ${FIRMWARE_PATH}
1280         PAM modules dir:         ${with_pamlibdir}
1281         PAM configuration dir:   ${with_pamconfdir}
1282         D-Bus policy dir:        ${with_dbuspolicydir}
1283         D-Bus session dir:       ${with_dbussessionservicedir}
1284         D-Bus system dir:        ${with_dbussystemservicedir}
1285         D-Bus interfaces dir:    ${with_dbusinterfacedir}
1286         Bash completions dir:    ${with_bashcompletiondir}
1287         Zsh completions dir:     ${with_zshcompletiondir}
1288         Extra start script:      ${RC_LOCAL_SCRIPT_PATH_START}
1289         Extra stop script:       ${RC_LOCAL_SCRIPT_PATH_STOP}
1290         Debug shell:             ${SUSHELL} @ ${DEBUGTTY}
1291         TTY GID:                 ${TTY_GID}
1292         Maximum System UID:      ${SYSTEM_UID_MAX}
1293         Maximum System GID:      ${SYSTEM_GID_MAX}
1294
1295         CFLAGS:                  ${OUR_CFLAGS} ${CFLAGS}
1296         CPPFLAGS:                ${OUR_CPPFLAGS} ${CPPFLAGS}
1297         LDFLAGS:                 ${OUR_LDFLAGS} ${LDFLAGS}
1298         PYTHON_CFLAGS:           ${PYTHON_DEVEL_CFLAGS}
1299         PYTHON_LIBS:             ${PYTHON_DEVEL_LIBS}
1300 ])