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