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