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