]> git.ipfire.org Git - thirdparty/systemd.git/blob - configure.ac
build-sys: prepare release 202
[thirdparty/systemd.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 [202],
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_CHECK_TOOL(OBJCOPY, objcopy)
90 AC_CHECK_TOOL(STRINGS, strings)
91 AC_CHECK_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[[12345g\ ]]*], [
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 AC_PATH_PROGS(SPHINX_BUILD, sphinx-build-${PYTHON_VERSION} sphinx-build)
180 ])
181 ])
182 AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
183
184 # ------------------------------------------------------------------------------
185
186 AC_SEARCH_LIBS([mq_open], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
187 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
188
189 save_LIBS="$LIBS"
190 LIBS=
191 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
192 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
193 CAP_LIBS="$LIBS"
194 LIBS="$save_LIBS"
195 AC_SUBST(CAP_LIBS)
196
197 AC_CHECK_FUNCS([fanotify_init fanotify_mark])
198 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
199 AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include <sys/types.h>
200 #include <unistd.h>
201 #include <sys/mount.h>
202 #include <fcntl.h>]])
203
204 # This makes sure pkg.m4 is available.
205 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
206
207 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2])
208
209 # ------------------------------------------------------------------------------
210 have_kmod=no
211 AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
212 if test "x$enable_kmod" != "xno"; then
213 PKG_CHECK_MODULES(KMOD, [ libkmod >= 5 ],
214 [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available]) have_kmod=yes], have_kmod=no)
215 if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
216 AC_MSG_ERROR([*** kmod support requested but libraries not found])
217 fi
218 fi
219 AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
220
221 # ------------------------------------------------------------------------------
222 have_blkid=no
223 AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
224 if test "x$enable_blkid" != "xno"; then
225 PKG_CHECK_MODULES(BLKID, [ blkid >= 2.20 ],
226 [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
227 if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
228 AC_MSG_ERROR([*** blkid support requested but libraries not found])
229 fi
230 fi
231 AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
232
233 # ------------------------------------------------------------------------------
234 have_ima=yes
235 AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]),
236 [case "${enableval}" in
237 yes) have_ima=yes ;;
238 no) have_ima=no ;;
239 *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
240 esac],
241 [have_ima=yes])
242
243 if test "x${have_ima}" != xno ; then
244 AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
245 fi
246
247 # ------------------------------------------------------------------------------
248 have_chkconfig=yes
249 AC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optional chkconfig support]),
250 [case "${enableval}" in
251 yes) have_chkconfig=yes ;;
252 no) have_chkconfig=no ;;
253 *) AC_MSG_ERROR(bad value ${enableval} for --disable-chkconfig) ;;
254 esac],
255 [AC_PATH_PROG(CHKCONFIG, chkconfig)
256 if test -z "$CHKCONFIG"; then
257 have_chkconfig=no
258 else
259 have_chkconfig=yes
260 fi])
261
262 if test "x${have_chkconfig}" != xno ; then
263 AC_DEFINE(HAVE_CHKCONFIG, 1, [Define if CHKCONFIG is available])
264 fi
265
266 # ------------------------------------------------------------------------------
267 have_selinux=no
268 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
269 if test "x$enable_selinux" != "xno"; then
270 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
271 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no)
272 if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
273 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
274 fi
275 fi
276 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
277 if test "x${have_selinux}" != xno ; then
278 SUSHELL=/sbin/sushell
279 else
280 SUSHELL=/bin/sh
281 fi
282 AC_SUBST(SUSHELL)
283
284 # ------------------------------------------------------------------------------
285 have_xz=no
286 AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
287 if test "x$enable_xz" != "xno"; then
288 PKG_CHECK_MODULES(XZ, [ liblzma ],
289 [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no)
290 if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then
291 AC_MSG_ERROR([*** Xz support requested but libraries not found])
292 fi
293 fi
294 AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
295
296 # ------------------------------------------------------------------------------
297 AC_ARG_ENABLE([tcpwrap],
298 AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]),
299 [case "${enableval}" in
300 yes) have_tcpwrap=yes ;;
301 no) have_tcpwrap=no ;;
302 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
303 esac],
304 [have_tcpwrap=auto])
305
306 if test "x${have_tcpwrap}" != xno ; then
307 ACX_LIBWRAP
308 if test "x${LIBWRAP_LIBS}" = x ; then
309 if test "x$have_tcpwrap" = xyes ; then
310 AC_MSG_ERROR([*** TCP wrappers support not found.])
311 fi
312 have_tcpwrap=no
313 else
314 have_tcpwrap=yes
315 fi
316 else
317 LIBWRAP_LIBS=
318 fi
319 AC_SUBST(LIBWRAP_LIBS)
320
321 # ------------------------------------------------------------------------------
322 AC_ARG_ENABLE([pam],
323 AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
324 [case "${enableval}" in
325 yes) have_pam=yes ;;
326 no) have_pam=no ;;
327 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
328 esac],
329 [have_pam=auto])
330
331 if test "x${have_pam}" != xno ; then
332 AC_CHECK_HEADERS(
333 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
334 [have_pam=yes],
335 [if test "x$have_pam" = xyes ; then
336 AC_MSG_ERROR([*** PAM headers not found.])
337 fi])
338
339 AC_CHECK_LIB(
340 [pam],
341 [pam_syslog],
342 [have_pam=yes],
343 [if test "x$have_pam" = xyes ; then
344 AC_MSG_ERROR([*** libpam not found.])
345 fi])
346
347 if test "x$have_pam" = xyes ; then
348 PAM_LIBS="-lpam -lpam_misc"
349 AC_DEFINE(HAVE_PAM, 1, [PAM available])
350 else
351 have_pam=no
352 fi
353 else
354 PAM_LIBS=
355 fi
356 AC_SUBST(PAM_LIBS)
357 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
358
359 # ------------------------------------------------------------------------------
360 AC_ARG_ENABLE([acl],
361 AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
362 [case "${enableval}" in
363 yes) have_acl=yes ;;
364 no) have_acl=no ;;
365 *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
366 esac],
367 [have_acl=auto])
368
369 if test "x${have_acl}" != xno ; then
370 AC_CHECK_HEADERS(
371 [sys/acl.h acl/libacl.h],
372 [have_acl=yes],
373 [if test "x$have_acl" = xyes ; then
374 AC_MSG_ERROR([*** ACL headers not found.])
375 fi])
376
377 AC_CHECK_LIB(
378 [acl],
379 [acl_get_file],
380 [have_acl=yes],
381 [if test "x$have_acl" = xyes ; then
382 AC_MSG_ERROR([*** libacl not found.])
383 fi])
384
385 if test "x$have_acl" = xyes ; then
386 ACL_LIBS="-lacl"
387 AC_DEFINE(HAVE_ACL, 1, [ACL available])
388 else
389 have_acl=no
390 fi
391 else
392 ACL_LIBS=
393 fi
394 AC_SUBST(ACL_LIBS)
395 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
396
397 # ------------------------------------------------------------------------------
398 AC_ARG_ENABLE([xattr],
399 AS_HELP_STRING([--disable-xattr],[Disable optional XATTR support]),
400 [case "${enableval}" in
401 yes) have_xattr=yes ;;
402 no) have_xattr=no ;;
403 *) AC_MSG_ERROR(bad value ${enableval} for --disable-xattr) ;;
404 esac],
405 [have_xattr=auto])
406
407 if test "x${have_xattr}" != xno ; then
408 AC_CHECK_HEADERS(
409 [attr/xattr.h],
410 [have_xattr=yes],
411 [if test "x$have_xattr" = xyes ; then
412 AC_MSG_ERROR([*** XATTR headers not found.])
413 fi])
414
415 AC_CHECK_LIB(
416 [attr],
417 [fsetxattr],
418 [have_xattr=yes],
419 [if test "x$have_xattr" = xyes ; then
420 AC_MSG_ERROR([*** libattr not found.])
421 fi])
422
423 if test "x$have_xattr" = xyes ; then
424 XATTR_LIBS="-lattr"
425 AC_DEFINE(HAVE_XATTR, 1, [XATTR available])
426 else
427 have_xattr=no
428 fi
429 else
430 XATTR_LIBS=
431 fi
432 AC_SUBST(XATTR_LIBS)
433 AM_CONDITIONAL([HAVE_XATTR], [test "x$have_xattr" != xno])
434
435 # ------------------------------------------------------------------------------
436 AC_ARG_ENABLE([gcrypt],
437 AS_HELP_STRING([--disable-gcrypt],[Disable optional GCRYPT support]),
438 [case "${enableval}" in
439 yes) have_gcrypt=yes ;;
440 no) have_gcrypt=no ;;
441 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
442 esac],
443 [have_gcrypt=auto])
444
445 if test "x${have_gcrypt}" != xno ; then
446 AM_PATH_LIBGCRYPT(
447 [1.4.5],
448 [have_gcrypt=yes],
449 [if test "x$have_gcrypt" = xyes ; then
450 AC_MSG_ERROR([*** GCRYPT headers not found.])
451 fi])
452
453 if test "x$have_gcrypt" = xyes ; then
454 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
455 GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS"
456 AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
457 else
458 have_gcrypt=no
459 fi
460 else
461 GCRYPT_LIBS=
462 GCRYPT_CFLAGS=
463 fi
464 AC_SUBST(GCRYPT_LIBS)
465 AC_SUBST(GCRYPT_CFLAGS)
466 AM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
467
468 # ------------------------------------------------------------------------------
469 AC_ARG_ENABLE([audit],
470 AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
471 [case "${enableval}" in
472 yes) have_audit=yes ;;
473 no) have_audit=no ;;
474 *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
475 esac],
476 [have_audit=auto])
477
478 if test "x${have_audit}" != xno ; then
479 AC_CHECK_HEADERS(
480 [libaudit.h],
481 [have_audit=yes],
482 [if test "x$have_audit" = xyes ; then
483 AC_MSG_ERROR([*** AUDIT headers not found.])
484 fi])
485
486 AC_CHECK_LIB(
487 [audit],
488 [audit_open],
489 [have_audit=yes],
490 [if test "x$have_audit" = xyes ; then
491 AC_MSG_ERROR([*** libaudit not found.])
492 fi])
493
494 if test "x$have_audit" = xyes ; then
495 AUDIT_LIBS="-laudit"
496 AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
497 else
498 have_audit=no
499 fi
500 else
501 AUDIT_LIBS=
502 fi
503 AC_SUBST(AUDIT_LIBS)
504
505 # ------------------------------------------------------------------------------
506 have_libcryptsetup=no
507 AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
508 if test "x$enable_libcryptsetup" != "xno"; then
509 PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.4.2 ],
510 [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
511 if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
512 AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
513 fi
514 fi
515 AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
516
517 # ------------------------------------------------------------------------------
518 have_qrencode=no
519 AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
520 if test "x$enable_qrencode" != "xno"; then
521 PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
522 [AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
523 if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
524 AC_MSG_ERROR([*** qrencode support requested but libraries not found])
525 fi
526 fi
527 AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
528
529 # ------------------------------------------------------------------------------
530 have_microhttpd=no
531 AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
532 if test "x$enable_microhttpd" != "xno"; then
533 PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.5],
534 [AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available]) have_microhttpd=yes], have_microhttpd=no)
535 if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
536 AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
537 fi
538 fi
539 AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
540
541 # ------------------------------------------------------------------------------
542 have_binfmt=no
543 AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
544 if test "x$enable_binfmt" != "xno"; then
545 have_binfmt=yes
546 fi
547 AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
548
549 # ------------------------------------------------------------------------------
550 have_vconsole=no
551 AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
552 if test "x$enable_vconsole" != "xno"; then
553 have_vconsole=yes
554 fi
555 AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
556
557 # ------------------------------------------------------------------------------
558 have_readahead=no
559 AC_ARG_ENABLE(readahead, AS_HELP_STRING([--disable-readahead], [disable readahead tools]))
560 if test "x$enable_readahead" != "xno"; then
561 have_readahead=yes
562 fi
563 AM_CONDITIONAL(ENABLE_READAHEAD, [test "$have_readahead" = "yes"])
564
565 # ------------------------------------------------------------------------------
566 have_bootchart=no
567 AC_ARG_ENABLE(bootchart, AS_HELP_STRING([--disable-bootchart], [disable bootchart tool]))
568 if test "x$enable_bootchart" != "xno"; then
569 have_bootchart=yes
570 fi
571 AM_CONDITIONAL(ENABLE_BOOTCHART, [test "$have_bootchart" = "yes"])
572
573 # ------------------------------------------------------------------------------
574 have_quotacheck=no
575 AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
576 if test "x$enable_quotacheck" != "xno"; then
577 have_quotacheck=yes
578 fi
579 AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
580
581 # ------------------------------------------------------------------------------
582 have_randomseed=no
583 AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
584 if test "x$enable_randomseed" != "xno"; then
585 have_randomseed=yes
586 fi
587 AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
588
589 # ------------------------------------------------------------------------------
590 have_logind=no
591 AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
592 if test "x$enable_logind" != "xno"; then
593 have_logind=yes
594 fi
595 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
596 AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
597
598 # ------------------------------------------------------------------------------
599 have_hostnamed=no
600 AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
601 if test "x$enable_hostnamed" != "xno"; then
602 have_hostnamed=yes
603 fi
604 AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
605
606 # ------------------------------------------------------------------------------
607 have_timedated=no
608 AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
609 if test "x$enable_timedated" != "xno"; then
610 have_timedated=yes
611 fi
612 AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
613
614 # ------------------------------------------------------------------------------
615 have_localed=no
616 AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
617 if test "x$enable_localed" != "xno"; then
618 have_localed=yes
619 fi
620 AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
621
622 # ------------------------------------------------------------------------------
623 have_coredump=no
624 AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
625 if test "x$enable_coredump" != "xno"; then
626 have_coredump=yes
627 fi
628 AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
629
630 # ------------------------------------------------------------------------------
631 have_polkit=no
632 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
633 if test "x$enable_polkit" != "xno"; then
634 AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
635 have_polkit=yes
636 fi
637 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
638
639 # ------------------------------------------------------------------------------
640 have_efi=no
641 AC_ARG_ENABLE(efi, AS_HELP_STRING([--disable-efi], [disable EFI support]))
642 if test "x$enable_efi" != "xno"; then
643 AC_DEFINE(ENABLE_EFI, 1, [Define if EFI support is to be enabled])
644 have_efi=yes
645 fi
646 AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
647
648 # ------------------------------------------------------------------------------
649 AC_ARG_WITH(rc-local-script-path-start,
650 AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
651 [Path to /etc/rc.local]),
652 [RC_LOCAL_SCRIPT_PATH_START="$withval"],
653 [RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
654
655 AC_ARG_WITH(rc-local-script-path-stop,
656 AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
657 [Path to /usr/sbin/halt.local]),
658 [RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
659 [RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
660
661 AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
662 AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
663
664 AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
665 AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
666
667 # ------------------------------------------------------------------------------
668 AC_ARG_WITH(kbd-loadkeys,
669 AS_HELP_STRING([--with-kbd-loadkeys=PATH],
670 [Path to loadkeys]),
671 [KBD_LOADKEYS="$withval"],
672 [KBD_LOADKEYS="/usr/bin/loadkeys"])
673
674 AC_ARG_WITH(kbd-setfont,
675 AS_HELP_STRING([--with-kbd-setfont=PATH],
676 [Path to setfont]),
677 [KBD_SETFONT="$withval"],
678 [KBD_SETFONT="/usr/bin/setfont"])
679
680 AC_DEFINE_UNQUOTED(KBD_LOADKEYS, ["$KBD_LOADKEYS"], [Path of loadkeys])
681 AC_DEFINE_UNQUOTED(KBD_SETFONT, ["$KBD_SETFONT"], [Path of setfont])
682
683 AC_SUBST(KBD_LOADKEYS)
684 AC_SUBST(KBD_SETFONT)
685
686 AC_ARG_WITH(telinit,
687 AS_HELP_STRING([--with-telinit=PATH],
688 [Path to telinit]),
689 [TELINIT="$withval"],
690 [TELINIT="/lib/upstart/telinit"])
691
692 AC_DEFINE_UNQUOTED(TELINIT, ["$TELINIT"], [Path to telinit])
693
694 AC_SUBST(TELINIT)
695
696 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h])
697
698 # ------------------------------------------------------------------------------
699 have_myhostname=no
700 AC_ARG_ENABLE(myhostname, AS_HELP_STRING([--disable-myhostname], [disable nss-myhostname support]))
701 if test "x$enable_myhostname" != "xno"; then
702 AC_HEADER_STDC
703 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])
704
705 AC_C_CONST
706 AC_TYPE_SIZE_T
707 AC_HEADER_TIME
708
709 AC_FUNC_MALLOC
710 AC_FUNC_SELECT_ARGTYPES
711 AC_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
712
713 have_myhostname=yes
714 fi
715 AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
716
717 # ------------------------------------------------------------------------------
718 AC_ARG_WITH(firmware-path,
719 AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
720 [Firmware search path (default="")]),
721 [], [with_firmware_path=""])
722 OLD_IFS=$IFS
723 IFS=:
724 for i in $with_firmware_path; do
725 if test "x${FIRMWARE_PATH}" = "x"; then
726 FIRMWARE_PATH="\\\"${i}/\\\""
727 else
728 FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
729 fi
730 done
731 IFS=$OLD_IFS
732 AC_SUBST(FIRMWARE_PATH)
733 AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
734 AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
735
736 # ------------------------------------------------------------------------------
737 AC_ARG_ENABLE([gudev],
738 AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
739 [], [enable_gudev=yes])
740 AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0]) ])
741 AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
742 AS_IF([test "x$enable_gudev" = "xyes"], [ AC_DEFINE(HAVE_GLIB, 1, [Define if glib is available]) ])
743
744 # ------------------------------------------------------------------------------
745 AC_ARG_ENABLE([keymap],
746 AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]),
747 [], [enable_keymap=yes])
748 AS_IF([test "x$enable_keymap" = "xyes"], [
749 AC_PATH_PROG([GPERF], [gperf])
750 if test -z "$GPERF"; then
751 AC_MSG_ERROR([gperf is needed])
752 fi
753
754 AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
755 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}')])
756 ])
757 AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = "xyes"])
758
759 # ------------------------------------------------------------------------------
760 DEBUGTTY=/dev/tty9
761 AC_ARG_WITH([debugshelltty],
762 [AS_HELP_STRING([--with-debugshelltty=PATH],
763 [Specify the tty device for debug shell])],
764 [DEBUGTTY="$withval"],
765 [])
766 AC_SUBST(DEBUGTTY)
767
768 # ------------------------------------------------------------------------------
769 have_manpages=no
770 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
771 AS_IF([test "x$enable_manpages" != xno], [
772 AS_IF([test "x$enable_manpages" = xyes -a "x$XSLTPROC" = x], [
773 AC_MSG_ERROR([*** Manpages requested but xsltproc not found])
774 ])
775 AS_IF([test "x$XSLTPROC" != x], [have_manpages=yes])
776 ])
777 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
778
779 # ------------------------------------------------------------------------------
780
781 # Location of the init scripts as mandated by LSB
782 SYSTEM_SYSVINIT_PATH=/etc/init.d
783 SYSTEM_SYSVRCND_PATH=/etc/rc.d
784 M4_DEFINES=
785
786 AC_ARG_WITH([sysvinit-path],
787 [AS_HELP_STRING([--with-sysvinit-path=PATH],
788 [Specify the path to where the SysV init scripts are located])],
789 [SYSTEM_SYSVINIT_PATH="$withval"],
790 [])
791
792 AC_ARG_WITH([sysvrcnd-path],
793 [AS_HELP_STRING([--with-sysvrcnd-path=PATH],
794 [Specify the path to the base directory for the SysV rcN.d directories])],
795 [SYSTEM_SYSVRCND_PATH="$withval"],
796 [])
797
798 if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
799 AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
800 SYSTEM_SYSV_COMPAT="yes"
801 M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
802 elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
803 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.])
804 else
805 SYSTEM_SYSV_COMPAT="no"
806 fi
807
808 AC_SUBST(SYSTEM_SYSVINIT_PATH)
809 AC_SUBST(SYSTEM_SYSVRCND_PATH)
810 AC_SUBST(M4_DEFINES)
811
812 AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
813
814 AC_ARG_WITH([tty-gid],
815 [AS_HELP_STRING([--with-tty-gid=GID],
816 [Specify the numeric GID of the 'tty' group])],
817 [AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])],
818 [])
819
820 AC_ARG_WITH([dbuspolicydir],
821 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
822 [],
823 [with_dbuspolicydir=$($PKG_CONFIG --variable=sysconfdir dbus-1)/dbus-1/system.d])
824
825 AC_ARG_WITH([dbussessionservicedir],
826 AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
827 [],
828 [with_dbussessionservicedir=$($PKG_CONFIG --variable=session_bus_services_dir dbus-1)])
829
830 AC_ARG_WITH([dbussystemservicedir],
831 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
832 [],
833 [with_dbussystemservicedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../system-services)])
834
835 AC_ARG_WITH([dbusinterfacedir],
836 AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
837 [],
838 [with_dbusinterfacedir=$(readlink -m $($PKG_CONFIG --variable=session_bus_services_dir dbus-1)/../interfaces)])
839
840 AC_ARG_WITH([bashcompletiondir],
841 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
842 [],
843 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
844 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
845 ] , [
846 with_bashcompletiondir=${datadir}/bash-completion/completions
847 ])])
848
849 AC_ARG_WITH([rootprefix],
850 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
851 [], [with_rootprefix=${ac_default_prefix}])
852
853 AC_ARG_WITH([rootlibdir],
854 AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
855 [],
856 [with_rootlibdir=${libdir}])
857
858 AC_ARG_WITH([pamlibdir],
859 AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
860 [],
861 [with_pamlibdir=${with_rootlibdir}/security])
862
863 AC_ARG_ENABLE([split-usr],
864 AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
865 [],
866 [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
867 enable_split_usr=yes
868 ], [
869 enable_split_usr=no
870 ])])
871
872 AS_IF([test "x${enable_split_usr}" = "xyes"], [
873 AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
874 ])
875
876 # Work around intltoolize and gtk-doc problems in VPATH builds
877 AM_CONDITIONAL([ENABLE_GTK_DOC_TESTS], [test "x$0" = "x./configure"],
878 [Define to do gtk-doc tests])
879 AS_IF([test "x$0" != "x./configure"], [
880 AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
881 ])
882
883 AC_ARG_ENABLE(tests,
884 [AC_HELP_STRING([--disable-tests], [disable tests])],
885 enable_tests=$enableval, enable_tests=yes)
886 AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
887
888 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
889 AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
890 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
891 AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir])
892 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
893 AC_SUBST([pamlibdir], [$with_pamlibdir])
894 AC_SUBST([rootprefix], [$with_rootprefix])
895 AC_SUBST([rootlibdir], [$with_rootlibdir])
896
897 AC_CONFIG_FILES([
898 Makefile po/Makefile.in
899 docs/libudev/Makefile
900 docs/libudev/version.xml
901 docs/gudev/Makefile
902 docs/gudev/version.xml
903 ])
904
905 AC_OUTPUT
906 AC_MSG_RESULT([
907 $PACKAGE_NAME $VERSION
908
909 libcryptsetup: ${have_libcryptsetup}
910 tcpwrap: ${have_tcpwrap}
911 PAM: ${have_pam}
912 AUDIT: ${have_audit}
913 IMA: ${have_ima}
914 SELinux: ${have_selinux}
915 XZ: ${have_xz}
916 ACL: ${have_acl}
917 XATTR: ${have_xattr}
918 GCRYPT: ${have_gcrypt}
919 QRENCODE: ${have_qrencode}
920 MICROHTTPD: ${have_microhttpd}
921 CHKCONFIG: ${have_chkconfig}
922 binfmt: ${have_binfmt}
923 vconsole: ${have_vconsole}
924 readahead: ${have_readahead}
925 bootchart: ${have_bootchart}
926 quotacheck: ${have_quotacheck}
927 randomseed: ${have_randomseed}
928 logind: ${have_logind}
929 hostnamed: ${have_hostnamed}
930 timedated: ${have_timedated}
931 localed: ${have_localed}
932 coredump: ${have_coredump}
933 polkit: ${have_polkit}
934 efi: ${have_efi}
935 kmod: ${have_kmod}
936 blkid: ${have_blkid}
937 nss-myhostname: ${have_myhostname}
938 gudev: ${enable_gudev}
939 gintrospection: ${enable_introspection}
940 keymap: ${enable_keymap}
941 Python: ${have_python}
942 Python Headers: ${have_python_devel}
943 man pages: ${have_manpages}
944 gtk-doc: ${enable_gtk_doc}
945 Split /usr: ${enable_split_usr}
946 SysV compatibility: ${SYSTEM_SYSV_COMPAT}
947
948 prefix: ${prefix}
949 rootprefix: ${with_rootprefix}
950 sysconf dir: ${sysconfdir}
951 datarootdir: ${datarootdir}
952 includedir: ${includedir}
953 include_prefix: ${INCLUDE_PREFIX}
954 lib dir: ${libdir}
955 rootlib dir: ${with_rootlibdir}
956 SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
957 SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
958 Build Python: ${PYTHON}
959 Installation Python: ${PYTHON_BINARY}
960 firmware path: ${FIRMWARE_PATH}
961 PAM modules dir: ${with_pamlibdir}
962 D-Bus policy dir: ${with_dbuspolicydir}
963 D-Bus session dir: ${with_dbussessionservicedir}
964 D-Bus system dir: ${with_dbussystemservicedir}
965 D-Bus interfaces dir: ${with_dbusinterfacedir}
966 Bash completions dir: ${with_bashcompletiondir}
967 Extra start script: ${RC_LOCAL_SCRIPT_PATH_START}
968 Extra stop script: ${RC_LOCAL_SCRIPT_PATH_STOP}
969
970 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
971 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
972 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
973 PYTHON_CFLAGS: ${PYTHON_CFLAGS}
974 PYTHON_LIBS: ${PYTHON_LIBS}
975 ])