chiark / gitweb /
systemctl: make shutdown operations use irreversible jobs
[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         [197],
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_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects check-news])
37 AM_SILENT_RULES([yes])
38 AC_CANONICAL_HOST
39 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
40 AS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" ||
41        test "x$host_cpu" = "xmips64" || test "x$host_cpu" = "xmips64el"],
42       [AC_DEFINE(ARCH_MIPS, [], [Whether on mips arch])])
43
44 LT_PREREQ(2.2)
45 LT_INIT([disable-static])
46
47 # i18n stuff for the PolicyKit policy files
48 IT_PROG_INTLTOOL([0.40.0])
49
50 GETTEXT_PACKAGE=systemd
51 AC_SUBST(GETTEXT_PACKAGE)
52
53 AC_PROG_MKDIR_P
54 AC_PROG_LN_S
55 AC_PROG_SED
56 AC_PROG_GREP
57 AC_PROG_AWK
58
59 AC_PROG_CC
60 AC_PROG_CC_C99
61 AM_PROG_CC_C_O
62 AC_PROG_GCC_TRADITIONAL
63
64 AC_PATH_PROG([M4], [m4])
65 AC_PATH_PROG([XSLTPROC], [xsltproc])
66
67 AC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon])
68 AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck])
69
70 AC_PATH_PROG([SETCAP], [setcap], [/usr/sbin/setcap])
71
72 AC_PATH_PROG([KILL], [kill], [/usr/bin/kill])
73
74 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
75 m4_ifdef([GTK_DOC_CHECK], [
76 GTK_DOC_CHECK([1.18],[--flavour no-tmpl])
77 ], [AM_CONDITIONAL([ENABLE_GTK_DOC], [false])])
78
79 AS_IF([test "x$enable_gtk_doc" = "xyes" -a "x$XSLTPROC" = x], [
80         AC_MSG_ERROR([*** GTK doc requested but xsltproc not found])
81 ])
82
83 m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
84 GOBJECT_INTROSPECTION_CHECK([1.31.1])
85 ], [
86    AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
87    enable_introspection=no])
88
89 AC_PATH_TOOL(OBJCOPY, objcopy)
90 AC_PATH_TOOL(STRINGS, strings)
91 AC_PATH_TOOL(GPERF, gperf)
92 if test -z "$GPERF" ; then
93         AC_MSG_ERROR([*** gperf not found])
94 fi
95
96 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
97         -pipe \
98         -Wall \
99         -Wextra \
100         -Wno-inline \
101         -Wundef \
102         "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
103         -Wlogical-op \
104         -Wsign-compare \
105         -Wmissing-include-dirs \
106         -Wold-style-definition \
107         -Wpointer-arith \
108         -Winit-self \
109         -Wdeclaration-after-statement \
110         -Wfloat-equal \
111         -Wmissing-prototypes \
112         -Wstrict-prototypes \
113         -Wredundant-decls \
114         -Wmissing-declarations \
115         -Wmissing-noreturn \
116         -Wshadow \
117         -Wendif-labels \
118         -Wcast-align \
119         -Wstrict-aliasing=2 \
120         -Wwrite-strings \
121         -Wno-long-long \
122         -Wno-overlength-strings \
123         -Wno-unused-parameter \
124         -Wno-missing-field-initializers \
125         -Wno-unused-result \
126         -Werror=overflow \
127         -ffast-math \
128         -fno-common \
129         -fdiagnostics-show-option \
130         -fno-strict-aliasing \
131         -fvisibility=hidden \
132         -ffunction-sections \
133         -fdata-sections \
134         -fstack-protector \
135         --param=ssp-buffer-size=4])
136 AC_SUBST([OUR_CFLAGS], $with_cflags)
137
138 AS_CASE([$CFLAGS], [*-O[[12345\ ]]*], [
139         CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
140                -Wp,-D_FORTIFY_SOURCE=2])], [
141         python_extra_cflags=-Wp,-U_FORTIFY_SOURCE
142         AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
143 AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
144
145 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
146         -Wl,--as-needed \
147         -Wl,--gc-sections \
148         -Wl,-z,relro \
149         -Wl,-z,now])
150 AC_SUBST([OUR_LDFLAGS], $with_ldflags)
151
152 # ------------------------------------------------------------------------------
153 # we use python to build the man page index, and for systemd-python
154 have_python=no
155 have_python_devel=no
156
157 AC_ARG_WITH([python],
158         [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
159
160 AS_IF([test "x$with_python" != "xno"], [
161         AM_PATH_PYTHON(,, [:])
162         AS_IF([test "$PYTHON" != :], [have_python=yes])
163 ])
164 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
165 AS_IF([test "x$PYTHON_BINARY" = "x"],
166       [AS_IF([test "x$have_python" = "xyes"],
167              [PYTHON_BINARY="`which "$PYTHON"`"],
168              [PYTHON_BINARY=/usr/bin/python])])
169 AC_ARG_VAR(PYTHON_BINARY, [Python binary used to launch installed scripts])
170
171 AS_IF([test "x$with_python" != "xno"], [
172         AC_PATH_PROG(PYTHON_CONFIG, python${PYTHON_VERSION}-config)
173         AS_IF([test -n "$PYTHON_CONFIG"], [
174               have_python_devel=yes
175               PYTHON_CFLAGS="`$PYTHON_CONFIG --cflags` $python_extra_cflags"
176               PYTHON_LIBS="`$PYTHON_CONFIG --ldflags`"
177               AC_SUBST(PYTHON_CFLAGS)
178               AC_SUBST(PYTHON_LIBS)
179         ])
180 ])
181 AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
182
183 # ------------------------------------------------------------------------------
184
185 AC_SEARCH_LIBS([mq_open], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
186 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
187
188 save_LIBS="$LIBS"
189 LIBS=
190 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
191 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
192 CAP_LIBS="$LIBS"
193 LIBS="$save_LIBS"
194 AC_SUBST(CAP_LIBS)
195
196 AC_CHECK_FUNCS([fanotify_init fanotify_mark])
197 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
198 AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include <sys/types.h>
199 #include <unistd.h>
200 #include <sys/mount.h>
201 #include <fcntl.h>]])
202
203 # This makes sure pkg.m4 is available.
204 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
205
206 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2])
207
208 # ------------------------------------------------------------------------------
209 have_kmod=no
210 AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
211 if test "x$enable_kmod" != "xno"; then
212         PKG_CHECK_MODULES(KMOD, [ libkmod >= 5 ],
213                 [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available]) have_kmod=yes], have_kmod=no)
214         if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
215                 AC_MSG_ERROR([*** kmod support requested but libraries not found])
216         fi
217 fi
218 AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
219
220 # ------------------------------------------------------------------------------
221 have_blkid=no
222 AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
223 if test "x$enable_blkid" != "xno"; then
224         PKG_CHECK_MODULES(BLKID, [ blkid >= 2.20 ],
225                 [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
226         if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
227                 AC_MSG_ERROR([*** blkid support requested but libraries not found])
228         fi
229 fi
230 AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
231
232 # ------------------------------------------------------------------------------
233 have_ima=yes
234 AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]),
235                 [case "${enableval}" in
236                         yes) have_ima=yes ;;
237                         no) have_ima=no ;;
238                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
239                 esac],
240                 [have_ima=yes])
241
242 if test "x${have_ima}" != xno ; then
243         AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
244 fi
245
246 # ------------------------------------------------------------------------------
247 have_chkconfig=yes
248 AC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optional chkconfig support]),
249                 [case "${enableval}" in
250                         yes) have_chkconfig=yes ;;
251                         no) have_chkconfig=no ;;
252                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-chkconfig) ;;
253                 esac],
254                 [AC_PATH_PROG(CHKCONFIG, chkconfig)
255                 if test -z "$CHKCONFIG"; then
256                         have_chkconfig=no
257                 else
258                         have_chkconfig=yes
259                 fi])
260
261 if test "x${have_chkconfig}" != xno ; then
262         AC_DEFINE(HAVE_CHKCONFIG, 1, [Define if CHKCONFIG is available])
263 fi
264
265 # ------------------------------------------------------------------------------
266 have_selinux=no
267 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
268 if test "x$enable_selinux" != "xno"; then
269         PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
270                 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no)
271         if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
272                 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
273         fi
274 fi
275 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
276 if test "x${have_selinux}" != xno ; then
277         sushell=/sbin/sushell
278 else
279         sushell=/bin/bash
280 fi
281 AC_SUBST(sushell)
282
283 # ------------------------------------------------------------------------------
284 have_xz=no
285 AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
286 if test "x$enable_xz" != "xno"; then
287         PKG_CHECK_MODULES(XZ, [ liblzma ],
288                 [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no)
289         if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then
290                 AC_MSG_ERROR([*** Xz support requested but libraries not found])
291         fi
292 fi
293 AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
294
295 # ------------------------------------------------------------------------------
296 AC_ARG_ENABLE([tcpwrap],
297         AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]),
298                 [case "${enableval}" in
299                         yes) have_tcpwrap=yes ;;
300                         no) have_tcpwrap=no ;;
301                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
302                 esac],
303                 [have_tcpwrap=auto])
304
305 if test "x${have_tcpwrap}" != xno ; then
306         ACX_LIBWRAP
307         if test "x${LIBWRAP_LIBS}" = x ; then
308                 if test "x$have_tcpwrap" = xyes ; then
309                         AC_MSG_ERROR([*** TCP wrappers support not found.])
310                 fi
311                 have_tcpwrap=no
312         else
313                 have_tcpwrap=yes
314         fi
315 else
316         LIBWRAP_LIBS=
317 fi
318 AC_SUBST(LIBWRAP_LIBS)
319
320 # ------------------------------------------------------------------------------
321 AC_ARG_ENABLE([pam],
322         AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
323                 [case "${enableval}" in
324                         yes) have_pam=yes ;;
325                         no) have_pam=no ;;
326                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
327                 esac],
328                 [have_pam=auto])
329
330 if test "x${have_pam}" != xno ; then
331         AC_CHECK_HEADERS(
332                 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
333                 [have_pam=yes],
334                 [if test "x$have_pam" = xyes ; then
335                         AC_MSG_ERROR([*** PAM headers not found.])
336                 fi])
337
338         AC_CHECK_LIB(
339                 [pam],
340                 [pam_syslog],
341                 [have_pam=yes],
342                 [if test "x$have_pam" = xyes ; then
343                         AC_MSG_ERROR([*** libpam not found.])
344                 fi])
345
346         if test "x$have_pam" = xyes ; then
347                 PAM_LIBS="-lpam -lpam_misc"
348                 AC_DEFINE(HAVE_PAM, 1, [PAM available])
349         else
350                 have_pam=no
351         fi
352 else
353         PAM_LIBS=
354 fi
355 AC_SUBST(PAM_LIBS)
356 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
357
358 # ------------------------------------------------------------------------------
359 AC_ARG_ENABLE([acl],
360         AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
361                 [case "${enableval}" in
362                         yes) have_acl=yes ;;
363                         no) have_acl=no ;;
364                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
365                 esac],
366                 [have_acl=auto])
367
368 if test "x${have_acl}" != xno ; then
369         AC_CHECK_HEADERS(
370                 [sys/acl.h acl/libacl.h],
371                 [have_acl=yes],
372                 [if test "x$have_acl" = xyes ; then
373                         AC_MSG_ERROR([*** ACL headers not found.])
374                 fi])
375
376         AC_CHECK_LIB(
377                 [acl],
378                 [acl_get_file],
379                 [have_acl=yes],
380                 [if test "x$have_acl" = xyes ; then
381                         AC_MSG_ERROR([*** libacl not found.])
382                 fi])
383
384         if test "x$have_acl" = xyes ; then
385                 ACL_LIBS="-lacl"
386                 AC_DEFINE(HAVE_ACL, 1, [ACL available])
387         else
388                 have_acl=no
389         fi
390 else
391         ACL_LIBS=
392 fi
393 AC_SUBST(ACL_LIBS)
394 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
395
396 # ------------------------------------------------------------------------------
397 AC_ARG_ENABLE([xattr],
398         AS_HELP_STRING([--disable-xattr],[Disable optional XATTR support]),
399                 [case "${enableval}" in
400                         yes) have_xattr=yes ;;
401                         no) have_xattr=no ;;
402                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-xattr) ;;
403                 esac],
404                 [have_xattr=auto])
405
406 if test "x${have_xattr}" != xno ; then
407         AC_CHECK_HEADERS(
408                 [attr/xattr.h],
409                 [have_xattr=yes],
410                 [if test "x$have_xattr" = xyes ; then
411                         AC_MSG_ERROR([*** XATTR headers not found.])
412                 fi])
413
414         AC_CHECK_LIB(
415                 [attr],
416                 [fsetxattr],
417                 [have_xattr=yes],
418                 [if test "x$have_xattr" = xyes ; then
419                         AC_MSG_ERROR([*** libattr not found.])
420                 fi])
421
422         if test "x$have_xattr" = xyes ; then
423                 XATTR_LIBS="-lattr"
424                 AC_DEFINE(HAVE_XATTR, 1, [XATTR available])
425         else
426                 have_xattr=no
427         fi
428 else
429         XATTR_LIBS=
430 fi
431 AC_SUBST(XATTR_LIBS)
432 AM_CONDITIONAL([HAVE_XATTR], [test "x$have_xattr" != xno])
433
434 # ------------------------------------------------------------------------------
435 AC_ARG_ENABLE([gcrypt],
436         AS_HELP_STRING([--disable-gcrypt],[Disable optional GCRYPT support]),
437                 [case "${enableval}" in
438                         yes) have_gcrypt=yes ;;
439                         no) have_gcrypt=no ;;
440                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
441                 esac],
442                 [have_gcrypt=auto])
443
444 if test "x${have_gcrypt}" != xno ; then
445         AM_PATH_LIBGCRYPT(
446                 [1.4.5],
447                 [have_gcrypt=yes],
448                 [if test "x$have_gcrypt" = xyes ; then
449                         AC_MSG_ERROR([*** GCRYPT headers not found.])
450                 fi])
451
452         if test "x$have_gcrypt" = xyes ; then
453                 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
454                 GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS"
455                 AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
456         else
457                 have_gcrypt=no
458         fi
459 else
460         GCRYPT_LIBS=
461         GCRYPT_CFLAGS=
462 fi
463 AC_SUBST(GCRYPT_LIBS)
464 AC_SUBST(GCRYPT_CFLAGS)
465 AM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
466
467 # ------------------------------------------------------------------------------
468 AC_ARG_ENABLE([audit],
469         AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
470                 [case "${enableval}" in
471                         yes) have_audit=yes ;;
472                         no) have_audit=no ;;
473                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
474                 esac],
475                 [have_audit=auto])
476
477 if test "x${have_audit}" != xno ; then
478         AC_CHECK_HEADERS(
479                 [libaudit.h],
480                 [have_audit=yes],
481                 [if test "x$have_audit" = xyes ; then
482                         AC_MSG_ERROR([*** AUDIT headers not found.])
483                 fi])
484
485         AC_CHECK_LIB(
486                 [audit],
487                 [audit_open],
488                 [have_audit=yes],
489                 [if test "x$have_audit" = xyes ; then
490                         AC_MSG_ERROR([*** libaudit not found.])
491                 fi])
492
493         if test "x$have_audit" = xyes ; then
494                 AUDIT_LIBS="-laudit"
495                 AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
496         else
497                 have_audit=no
498         fi
499 else
500         AUDIT_LIBS=
501 fi
502 AC_SUBST(AUDIT_LIBS)
503
504 # ------------------------------------------------------------------------------
505 have_libcryptsetup=no
506 AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
507 if test "x$enable_libcryptsetup" != "xno"; then
508         PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.4.2 ],
509                 [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
510         if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
511                 AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
512         fi
513 fi
514 AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
515
516 # ------------------------------------------------------------------------------
517 have_qrencode=no
518 AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
519 if test "x$enable_qrencode" != "xno"; then
520         PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
521                 [AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
522         if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
523                 AC_MSG_ERROR([*** qrencode support requested but libraries not found])
524         fi
525 fi
526 AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
527
528 # ------------------------------------------------------------------------------
529 have_microhttpd=no
530 AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
531 if test "x$enable_microhttpd" != "xno"; then
532         PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.5],
533                 [AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available]) have_microhttpd=yes], have_microhttpd=no)
534         if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
535                 AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
536         fi
537 fi
538 AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
539
540 # ------------------------------------------------------------------------------
541 have_binfmt=no
542 AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
543 if test "x$enable_binfmt" != "xno"; then
544         have_binfmt=yes
545 fi
546 AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
547
548 # ------------------------------------------------------------------------------
549 have_vconsole=no
550 AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
551 if test "x$enable_vconsole" != "xno"; then
552         have_vconsole=yes
553 fi
554 AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
555
556 # ------------------------------------------------------------------------------
557 have_readahead=no
558 AC_ARG_ENABLE(readahead, AS_HELP_STRING([--disable-readahead], [disable readahead tools]))
559 if test "x$enable_readahead" != "xno"; then
560         have_readahead=yes
561 fi
562 AM_CONDITIONAL(ENABLE_READAHEAD, [test "$have_readahead" = "yes"])
563
564 # ------------------------------------------------------------------------------
565 have_bootchart=no
566 AC_ARG_ENABLE(bootchart, AS_HELP_STRING([--disable-bootchart], [disable bootchart tool]))
567 if test "x$enable_bootchart" != "xno"; then
568         have_bootchart=yes
569 fi
570 AM_CONDITIONAL(ENABLE_BOOTCHART, [test "$have_bootchart" = "yes"])
571
572 # ------------------------------------------------------------------------------
573 have_quotacheck=no
574 AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
575 if test "x$enable_quotacheck" != "xno"; then
576         have_quotacheck=yes
577 fi
578 AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
579
580 # ------------------------------------------------------------------------------
581 have_randomseed=no
582 AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
583 if test "x$enable_randomseed" != "xno"; then
584         have_randomseed=yes
585 fi
586 AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
587
588 # ------------------------------------------------------------------------------
589 have_logind=no
590 AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
591 if test "x$enable_logind" != "xno"; then
592         have_logind=yes
593 fi
594 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
595 AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
596
597 # ------------------------------------------------------------------------------
598 have_hostnamed=no
599 AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
600 if test "x$enable_hostnamed" != "xno"; then
601         have_hostnamed=yes
602 fi
603 AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
604
605 # ------------------------------------------------------------------------------
606 have_timedated=no
607 AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
608 if test "x$enable_timedated" != "xno"; then
609         have_timedated=yes
610 fi
611 AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
612
613 # ------------------------------------------------------------------------------
614 have_localed=no
615 AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
616 if test "x$enable_localed" != "xno"; then
617         have_localed=yes
618 fi
619 AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
620
621 # ------------------------------------------------------------------------------
622 have_coredump=no
623 AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
624 if test "x$enable_coredump" != "xno"; then
625         have_coredump=yes
626 fi
627 AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
628
629 # ------------------------------------------------------------------------------
630 have_polkit=no
631 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
632 if test "x$enable_polkit" != "xno"; then
633         AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
634         have_polkit=yes
635 fi
636 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
637
638 # ------------------------------------------------------------------------------
639 have_efi=no
640 AC_ARG_ENABLE(efi, AS_HELP_STRING([--disable-efi], [disable EFI support]))
641 if test "x$enable_efi" != "xno"; then
642         AC_DEFINE(ENABLE_EFI, 1, [Define if EFI support is to be enabled])
643         have_efi=yes
644 fi
645 AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
646
647 # ------------------------------------------------------------------------------
648 AC_ARG_WITH(rc-local-script-path-start,
649         AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
650                 [Path to /etc/rc.local]),
651         [RC_LOCAL_SCRIPT_PATH_START="$withval"],
652         [RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
653
654 AC_ARG_WITH(rc-local-script-path-stop,
655         AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
656                 [Path to /usr/sbin/halt.local]),
657         [RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
658         [RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
659
660 AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
661 AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
662
663 AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
664 AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
665
666 # ------------------------------------------------------------------------------
667 AC_ARG_WITH(kbd-loadkeys,
668         AS_HELP_STRING([--with-kbd-loadkeys=PATH],
669                 [Path to loadkeys]),
670         [KBD_LOADKEYS="$withval"],
671         [KBD_LOADKEYS="/usr/bin/loadkeys"])
672
673 AC_ARG_WITH(kbd-setfont,
674         AS_HELP_STRING([--with-kbd-setfont=PATH],
675                 [Path to setfont]),
676         [KBD_SETFONT="$withval"],
677         [KBD_SETFONT="/usr/bin/setfont"])
678
679 AC_DEFINE_UNQUOTED(KBD_LOADKEYS, ["$KBD_LOADKEYS"], [Path of loadkeys])
680 AC_DEFINE_UNQUOTED(KBD_SETFONT, ["$KBD_SETFONT"], [Path of setfont])
681
682 AC_SUBST(KBD_LOADKEYS)
683 AC_SUBST(KBD_SETFONT)
684
685 # ------------------------------------------------------------------------------
686 have_myhostname=no
687 AC_ARG_ENABLE(myhostname, AS_HELP_STRING([--disable-myhostname], [disable nss-myhostname support]))
688 if test "x$enable_myhostname" != "xno"; then
689         AC_HEADER_STDC
690         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])
691
692         AC_C_CONST
693         AC_TYPE_SIZE_T
694         AC_HEADER_TIME
695
696         AC_FUNC_MALLOC
697         AC_FUNC_SELECT_ARGTYPES
698         AC_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
699
700         have_myhostname=yes
701 fi
702 AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
703
704 # ------------------------------------------------------------------------------
705 AC_ARG_WITH(firmware-path,
706        AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
707           [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]),
708        [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
709 OLD_IFS=$IFS
710 IFS=:
711 for i in $with_firmware_path; do
712        if test "x${FIRMWARE_PATH}" = "x"; then
713               FIRMWARE_PATH="\\\"${i}/\\\""
714        else
715               FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
716        fi
717 done
718 IFS=$OLD_IFS
719 AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH])
720
721 # ------------------------------------------------------------------------------
722 AC_ARG_ENABLE([gudev],
723        AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
724        [], [enable_gudev=yes])
725 AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ])
726 AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
727
728 # ------------------------------------------------------------------------------
729 AC_ARG_ENABLE([keymap],
730        AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]),
731        [], [enable_keymap=yes])
732 AS_IF([test "x$enable_keymap" = "xyes"], [
733        AC_PATH_PROG([GPERF], [gperf])
734        if test -z "$GPERF"; then
735               AC_MSG_ERROR([gperf is needed])
736        fi
737
738        AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
739        AC_SUBST([INCLUDE_PREFIX], [$(echo '#include <linux/input.h>' | eval $ac_cpp -E - | sed -n '/linux\/input.h/ {s:.*"\(.*\)/linux/input.h".*:\1:; p; q}')])
740 ])
741 AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = "xyes"])
742
743 # ------------------------------------------------------------------------------
744 have_manpages=no
745 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
746 AS_IF([test "x$enable_manpages" != xno], [
747         AS_IF([test "x$enable_manpages" = xyes -a "x$XSLTPROC" = x], [
748                 AC_MSG_ERROR([*** Manpages requested but xsltproc not found])
749         ])
750         AS_IF([test "x$XSLTPROC" != x], [have_manpages=yes])
751 ])
752 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
753
754 # ------------------------------------------------------------------------------
755
756 # Location of the init scripts as mandated by LSB
757 SYSTEM_SYSVINIT_PATH=/etc/init.d
758 SYSTEM_SYSVRCND_PATH=/etc/rc.d
759 M4_DEFINES=
760
761 AC_ARG_WITH([sysvinit-path],
762         [AS_HELP_STRING([--with-sysvinit-path=PATH],
763                 [Specify the path to where the SysV init scripts are located])],
764         [SYSTEM_SYSVINIT_PATH="$withval"],
765         [])
766
767 AC_ARG_WITH([sysvrcnd-path],
768         [AS_HELP_STRING([--with-sysvrcnd-path=PATH],
769                 [Specify the path to the base directory for the SysV rcN.d directories])],
770         [SYSTEM_SYSVRCND_PATH="$withval"],
771         [])
772
773 if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
774         AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
775         SYSTEM_SYSV_COMPAT="yes"
776         M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
777 elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
778         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.])
779 else
780         SYSTEM_SYSV_COMPAT="no"
781 fi
782
783 AC_SUBST(SYSTEM_SYSVINIT_PATH)
784 AC_SUBST(SYSTEM_SYSVRCND_PATH)
785 AC_SUBST(M4_DEFINES)
786
787 AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
788
789 AC_ARG_WITH([tty-gid],
790         [AS_HELP_STRING([--with-tty-gid=GID],
791                 [Specify the numeric GID of the 'tty' group])],
792         [AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])],
793         [])
794
795 AC_ARG_WITH([dbuspolicydir],
796         AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
797         [],
798         [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])
799
800 AC_ARG_WITH([dbussessionservicedir],
801         AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
802         [],
803         [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])
804
805 AC_ARG_WITH([dbussystemservicedir],
806         AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
807         [],
808         [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])
809
810 AC_ARG_WITH([dbusinterfacedir],
811         AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
812         [],
813         [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])
814
815 AC_ARG_WITH([rootprefix],
816         AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
817         [], [with_rootprefix=${ac_default_prefix}])
818
819 AC_ARG_WITH([rootlibdir],
820         AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
821         [],
822         [with_rootlibdir=${libdir}])
823
824 AC_ARG_WITH([pamlibdir],
825         AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
826         [],
827         [with_pamlibdir=${with_rootlibdir}/security])
828
829 AC_ARG_ENABLE([split-usr],
830         AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
831         [],
832         [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
833                 enable_split_usr=yes
834         ], [
835                 enable_split_usr=no
836         ])])
837
838 AS_IF([test "x${enable_split_usr}" = "xyes"], [
839         AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
840 ])
841
842 # Work around intltoolize and gtk-doc problems in VPATH builds
843 AM_CONDITIONAL([ENABLE_GTK_DOC_TESTS], [test "x$0" = "x./configure"],
844                                        [Define to do gtk-doc tests])
845 AS_IF([test "x$0" != "x./configure"], [
846         AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
847 ])
848
849 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
850 AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
851 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
852 AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir])
853 AC_SUBST([pamlibdir], [$with_pamlibdir])
854 AC_SUBST([rootprefix], [$with_rootprefix])
855 AC_SUBST([rootlibdir], [$with_rootlibdir])
856
857 AC_CONFIG_FILES([
858         Makefile po/Makefile.in
859         docs/libudev/Makefile
860         docs/libudev/version.xml
861         docs/gudev/Makefile
862         docs/gudev/version.xml
863 ])
864
865 AC_OUTPUT
866 AC_MSG_RESULT([
867         $PACKAGE_NAME $VERSION
868
869         libcryptsetup:           ${have_libcryptsetup}
870         tcpwrap:                 ${have_tcpwrap}
871         PAM:                     ${have_pam}
872         AUDIT:                   ${have_audit}
873         IMA:                     ${have_ima}
874         SELinux:                 ${have_selinux}
875         XZ:                      ${have_xz}
876         ACL:                     ${have_acl}
877         XATTR:                   ${have_xattr}
878         GCRYPT:                  ${have_gcrypt}
879         QRENCODE:                ${have_qrencode}
880         MICROHTTPD:              ${have_microhttpd}
881         CHKCONFIG:               ${have_chkconfig}
882         binfmt:                  ${have_binfmt}
883         vconsole:                ${have_vconsole}
884         readahead:               ${have_readahead}
885         bootchart:               ${have_bootchart}
886         quotacheck:              ${have_quotacheck}
887         randomseed:              ${have_randomseed}
888         logind:                  ${have_logind}
889         hostnamed:               ${have_hostnamed}
890         timedated:               ${have_timedated}
891         localed:                 ${have_localed}
892         coredump:                ${have_coredump}
893         polkit:                  ${have_polkit}
894         efi:                     ${have_efi}
895         kmod:                    ${have_kmod}
896         blkid:                   ${have_blkid}
897         nss-myhostname:          ${have_myhostname}
898         gudev:                   ${enable_gudev}
899         gintrospection:          ${enable_introspection}
900         keymap:                  ${enable_keymap}
901         Python:                  ${have_python}
902         Python Headers:          ${have_python_devel}
903         man pages:               ${have_manpages}
904         gtk-doc:                 ${enable_gtk_doc}
905         Split /usr:              ${enable_split_usr}
906         SysV compatibility:      ${SYSTEM_SYSV_COMPAT}
907
908         prefix:                  ${prefix}
909         rootprefix:              ${with_rootprefix}
910         sysconf dir:             ${sysconfdir}
911         datarootdir:             ${datarootdir}
912         includedir:              ${includedir}
913         include_prefix:          ${INCLUDE_PREFIX}
914         lib dir:                 ${libdir}
915         rootlib dir:             ${with_rootlibdir}
916         SysV init scripts:       ${SYSTEM_SYSVINIT_PATH}
917         SysV rc?.d directories:  ${SYSTEM_SYSVRCND_PATH}
918         Build Python:            ${PYTHON}
919         Installation Python:     ${PYTHON_BINARY}
920         firmware path:           ${FIRMWARE_PATH}
921         PAM modules dir:         ${with_pamlibdir}
922         D-Bus policy dir:        ${with_dbuspolicydir}
923         D-Bus session dir:       ${with_dbussessionservicedir}
924         D-Bus system dir:        ${with_dbussystemservicedir}
925         D-Bus interfaces dir:    ${with_dbusinterfacedir}
926         Extra start script:      ${RC_LOCAL_SCRIPT_PATH_START}
927         Extra stop script:       ${RC_LOCAL_SCRIPT_PATH_STOP}
928
929         CFLAGS:                  ${OUR_CFLAGS} ${CFLAGS}
930         CPPLAGS:                 ${OUR_CPPFLAGS} ${CPPFLAGS}
931         LDFLAGS:                 ${OUR_LDFLAGS} ${LDFLAGS}
932         PYTHON_CFLAGS:           ${PYTHON_CFLAGS}
933         PYTHON_LIBS:             ${PYTHON_LIBS}
934 ])