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