]> git.ipfire.org Git - thirdparty/systemd.git/blame - configure.ac
bash-completion: add 'gdb' verb for coredumpctl
[thirdparty/systemd.git] / configure.ac
CommitLineData
fb0951b0 1#
47be870b
LP
2# This file is part of systemd.
3#
3e214785
KS
4# Copyright 2010-2012 Lennart Poettering
5# Copyright 2010-2012 Kay Sievers
47be870b
LP
6#
7# systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
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
47be870b
LP
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
5430f7f2 15# Lesser General Public License for more details.
47be870b 16#
5430f7f2 17# You should have received a copy of the GNU Lesser General Public License
47be870b
LP
18# along with systemd; If not, see <http://www.gnu.org/licenses/>.
19
4e949c11
JJ
20AC_PREREQ([2.64])
21
22AC_INIT([systemd],
139ee8cc 23 [195],
4e949c11
JJ
24 [http://bugs.freedesktop.org/enter_bug.cgi?product=systemd],
25 [systemd],
26 [http://www.freedesktop.org/wiki/Software/systemd])
47be870b 27
78a825f2 28AC_CONFIG_SRCDIR([src/core/main.c])
47be870b
LP
29AC_CONFIG_MACRO_DIR([m4])
30AC_CONFIG_HEADERS([config.h])
a80db8bd
JJ
31AC_CONFIG_AUX_DIR([build-aux])
32
4db6d587 33AC_USE_SYSTEM_EXTENSIONS
907dd195 34AC_SYS_LARGEFILE
eb7bbee6 35AC_PREFIX_DEFAULT([/usr])
bbd9b8c2 36AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects check-news])
3e214785 37AM_SILENT_RULES([yes])
47be870b 38AC_CANONICAL_HOST
22be093f 39AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
d59d0a2b 40AS_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])])
47be870b 43
3e214785
KS
44LT_PREREQ(2.2)
45LT_INIT
47be870b 46
1c7dde3e
BN
47# i18n stuff for the PolicyKit policy files
48IT_PROG_INTLTOOL([0.40.0])
49
50GETTEXT_PACKAGE=systemd
51AC_SUBST(GETTEXT_PACKAGE)
52
e9da3678
LP
53AC_PROG_MKDIR_P
54AC_PROG_LN_S
55AC_PROG_SED
3ce4fad8 56AC_PROG_GREP
f975e971 57AC_PROG_AWK
e9da3678 58
47be870b
LP
59AC_PROG_CC
60AC_PROG_CC_C99
61AM_PROG_CC_C_O
62AC_PROG_GCC_TRADITIONAL
47be870b 63
3e214785 64AC_PATH_PROG([M4], [m4])
fe1fed02 65AC_PATH_PROG([XSLTPROC], [xsltproc])
92ec4495 66
86b2e20a
LP
67AC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon])
68AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck])
b51fc639 69
86b2e20a
LP
70AC_PATH_PROG([SETCAP], [setcap], [/usr/sbin/setcap])
71
c1c02e07 72AC_PATH_PROG([KILL], [kill], [/usr/bin/kill])
96ede260 73
80a5cbac 74# gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
92ec4495 75m4_ifdef([GTK_DOC_CHECK], [
9e45e7d8 76GTK_DOC_CHECK([1.18],[--flavour no-tmpl])
6e92b23f 77], [AM_CONDITIONAL([ENABLE_GTK_DOC], [false])])
92ec4495 78
fe1fed02
ZJS
79AS_IF([test "x$enable_gtk_doc" = "xyes" -a "x$XSLTPROC" = x], [
80 AC_MSG_ERROR([*** GTK doc requested but xsltproc not found])
81])
82
6e92b23f 83m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
0eaeca1f 84GOBJECT_INTROSPECTION_CHECK([1.31.1])
6e92b23f 85], [AM_CONDITIONAL([HAVE_INTROSPECTION], [false])])
3e214785 86
8d7e170a
LP
87AC_PATH_TOOL(OBJCOPY, objcopy)
88AC_PATH_TOOL(STRINGS, strings)
89AC_PATH_TOOL(GPERF, gperf)
b62cfcea
MB
90if test -z "$GPERF" ; then
91 AC_MSG_ERROR([*** gperf not found])
92fi
9a60da28 93
8d7e170a
LP
94# we use python to build the man page index, and for systemd-python
95have_python=no
96have_python_devel=no
78fbaaca
WK
97
98AC_ARG_WITH([python],
99 [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
100
101AS_IF([test "x$with_python" != "xno"], [
102 AM_PATH_PYTHON(,, [:])
103 if test "$PYTHON" != : ; then
104 have_python=yes
105 AC_PATH_PROG([PYTHON_CONFIG], python-config)
106
107 if test -n "$PYTHON_CONFIG" ; then
108 have_python_devel=yes
109 PYTHON_CFLAGS="`$PYTHON_CONFIG --cflags`"
110 PYTHON_LIBS="`$PYTHON_CONFIG --libs`"
111 AC_SUBST(PYTHON_CFLAGS)
112 AC_SUBST(PYTHON_LIBS)
113 fi
8d7e170a 114 fi
78fbaaca
WK
115])
116
8d7e170a
LP
117AM_CONDITIONAL([HAVE_PYTHON], [test "$have_python" = "yes"])
118AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
9c4fa6ed 119
eb2e280f 120CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
be1a67d9 121 -pipe \
d1ab0ca0 122 -Wall \
d1ab0ca0 123 -Wextra \
27765dfc 124 -Wno-inline \
d1ab0ca0
LP
125 -Wundef \
126 -Wformat=2 \
127 -Wlogical-op \
128 -Wsign-compare \
129 -Wformat-security \
130 -Wmissing-include-dirs \
131 -Wformat-nonliteral \
132 -Wold-style-definition \
133 -Wpointer-arith \
134 -Winit-self \
135 -Wdeclaration-after-statement \
136 -Wfloat-equal \
137 -Wmissing-prototypes \
138 -Wstrict-prototypes \
139 -Wredundant-decls \
140 -Wmissing-declarations \
141 -Wmissing-noreturn \
142 -Wshadow \
143 -Wendif-labels \
144 -Wcast-align \
145 -Wstrict-aliasing=2 \
146 -Wwrite-strings \
be1a67d9
LP
147 -Wno-long-long \
148 -Wno-overlength-strings \
d1ab0ca0 149 -Wno-unused-parameter \
be1a67d9 150 -Wno-missing-field-initializers \
8745297f 151 -Wno-unused-result \
d200735e 152 -Werror=overflow \
be1a67d9 153 -ffast-math \
d1ab0ca0
LP
154 -fno-common \
155 -fdiagnostics-show-option \
9b85fc6a
GSB
156 -fno-strict-aliasing \
157 -fvisibility=hidden \
158 -ffunction-sections \
5a45a936 159 -fdata-sections \
c1663b9d
LP
160 -fstack-protector \
161 --param=ssp-buffer-size=4])
5a45a936
LP
162AC_SUBST([OUR_CFLAGS], $with_cflags)
163
164CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
165 -Wp,-D_FORTIFY_SOURCE=2])
166AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
9e7adc3a
LDM
167
168CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
9b85fc6a 169 -Wl,--as-needed \
5a45a936
LP
170 -Wl,--gc-sections \
171 -Wl,-z,relro \
172 -Wl,-z,now])
173AC_SUBST([OUR_LDFLAGS], $with_ldflags)
47be870b
LP
174
175AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
afea26ad 176AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
85f19d82
MB
177
178save_LIBS="$LIBS"
179LIBS=
47be870b
LP
180AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
181AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
85f19d82
MB
182CAP_LIBS="$LIBS"
183LIBS="$save_LIBS"
184AC_SUBST(CAP_LIBS)
47be870b 185
9388e99e 186AC_CHECK_FUNCS([fanotify_init fanotify_mark])
4db17f29 187AC_CHECK_FUNCS([__secure_getenv secure_getenv])
9388e99e 188AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include <sys/types.h>
a8348796 189#include <unistd.h>
9388e99e
MO
190#include <sys/mount.h>
191#include <fcntl.h>]])
a8348796 192
b237ef2c 193# This makes sure pkg.m4 is available.
a9b5b032 194m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
d1ab0ca0 195
3e214785
KS
196PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2])
197PKG_CHECK_MODULES(KMOD, [libkmod >= 5])
198PKG_CHECK_MODULES(BLKID,[blkid >= 2.20])
728beb28 199
3e214785 200# ------------------------------------------------------------------------------
81611586
RS
201have_ima=yes
202AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]),
203 [case "${enableval}" in
204 yes) have_ima=yes ;;
205 no) have_ima=no ;;
206 *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
207 esac],
208 [have_ima=yes])
209
210if test "x${have_ima}" != xno ; then
211 AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
212fi
213
3e214785 214# ------------------------------------------------------------------------------
591622d7
LP
215have_selinux=no
216AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
217if test "x$enable_selinux" != "xno"; then
3f8cc098 218 PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
591622d7 219 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no)
591622d7
LP
220 if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
221 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
222 fi
56cf987f 223fi
591622d7 224AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
ed061a8d
MS
225if test "x${have_selinux}" != xno ; then
226 sushell=/sbin/sushell
227else
228 sushell=/bin/bash
229fi
230AC_SUBST(sushell)
56cf987f 231
3e214785 232# ------------------------------------------------------------------------------
807e17f0
LP
233have_xz=no
234AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
235if test "x$enable_xz" != "xno"; then
236 PKG_CHECK_MODULES(XZ, [ liblzma ],
237 [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no)
807e17f0
LP
238 if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then
239 AC_MSG_ERROR([*** Xz support requested but libraries not found])
240 fi
241fi
242AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
243
3e214785 244# ------------------------------------------------------------------------------
0213c3f8
LP
245AC_ARG_ENABLE([tcpwrap],
246 AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]),
247 [case "${enableval}" in
5b6319dc
LP
248 yes) have_tcpwrap=yes ;;
249 no) have_tcpwrap=no ;;
0213c3f8
LP
250 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
251 esac],
5b6319dc 252 [have_tcpwrap=auto])
0213c3f8 253
5b6319dc 254if test "x${have_tcpwrap}" != xno ; then
0213c3f8
LP
255 ACX_LIBWRAP
256 if test "x${LIBWRAP_LIBS}" = x ; then
5b6319dc
LP
257 if test "x$have_tcpwrap" = xyes ; then
258 AC_MSG_ERROR([*** TCP wrappers support not found.])
0213c3f8 259 fi
812cce32 260 have_tcpwrap=no
0213c3f8 261 else
5b6319dc 262 have_tcpwrap=yes
0213c3f8
LP
263 fi
264else
5b6319dc 265 LIBWRAP_LIBS=
0213c3f8 266fi
0213c3f8
LP
267AC_SUBST(LIBWRAP_LIBS)
268
3e214785 269# ------------------------------------------------------------------------------
5b6319dc
LP
270AC_ARG_ENABLE([pam],
271 AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
272 [case "${enableval}" in
273 yes) have_pam=yes ;;
274 no) have_pam=no ;;
275 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
276 esac],
277 [have_pam=auto])
278
279if test "x${have_pam}" != xno ; then
280 AC_CHECK_HEADERS(
281 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
282 [have_pam=yes],
283 [if test "x$have_pam" = xyes ; then
284 AC_MSG_ERROR([*** PAM headers not found.])
285 fi])
286
287 AC_CHECK_LIB(
288 [pam],
289 [pam_syslog],
290 [have_pam=yes],
291 [if test "x$have_pam" = xyes ; then
292 AC_MSG_ERROR([*** libpam not found.])
293 fi])
294
295 if test "x$have_pam" = xyes ; then
296 PAM_LIBS="-lpam -lpam_misc"
297 AC_DEFINE(HAVE_PAM, 1, [PAM available])
812cce32
LP
298 else
299 have_pam=no
5b6319dc
LP
300 fi
301else
302 PAM_LIBS=
303fi
304AC_SUBST(PAM_LIBS)
305AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
306
3e214785 307# ------------------------------------------------------------------------------
5eda94dd
LP
308AC_ARG_ENABLE([acl],
309 AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
310 [case "${enableval}" in
311 yes) have_acl=yes ;;
312 no) have_acl=no ;;
313 *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
314 esac],
315 [have_acl=auto])
316
317if test "x${have_acl}" != xno ; then
318 AC_CHECK_HEADERS(
319 [sys/acl.h acl/libacl.h],
320 [have_acl=yes],
321 [if test "x$have_acl" = xyes ; then
322 AC_MSG_ERROR([*** ACL headers not found.])
323 fi])
324
325 AC_CHECK_LIB(
326 [acl],
327 [acl_get_file],
328 [have_acl=yes],
329 [if test "x$have_acl" = xyes ; then
330 AC_MSG_ERROR([*** libacl not found.])
331 fi])
332
333 if test "x$have_acl" = xyes ; then
334 ACL_LIBS="-lacl"
335 AC_DEFINE(HAVE_ACL, 1, [ACL available])
336 else
337 have_acl=no
338 fi
339else
340 ACL_LIBS=
341fi
342AC_SUBST(ACL_LIBS)
343AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
344
fb0951b0
LP
345# ------------------------------------------------------------------------------
346AC_ARG_ENABLE([xattr],
347 AS_HELP_STRING([--disable-xattr],[Disable optional XATTR support]),
348 [case "${enableval}" in
349 yes) have_xattr=yes ;;
350 no) have_xattr=no ;;
351 *) AC_MSG_ERROR(bad value ${enableval} for --disable-xattr) ;;
352 esac],
353 [have_xattr=auto])
354
355if test "x${have_xattr}" != xno ; then
356 AC_CHECK_HEADERS(
357 [attr/xattr.h],
358 [have_xattr=yes],
359 [if test "x$have_xattr" = xyes ; then
360 AC_MSG_ERROR([*** XATTR headers not found.])
361 fi])
362
363 AC_CHECK_LIB(
364 [attr],
365 [fsetxattr],
366 [have_xattr=yes],
367 [if test "x$have_xattr" = xyes ; then
368 AC_MSG_ERROR([*** libattr not found.])
369 fi])
370
371 if test "x$have_xattr" = xyes ; then
372 XATTR_LIBS="-lattr"
373 AC_DEFINE(HAVE_XATTR, 1, [XATTR available])
374 else
375 have_xattr=no
376 fi
377else
378 XATTR_LIBS=
379fi
380AC_SUBST(XATTR_LIBS)
381AM_CONDITIONAL([HAVE_XATTR], [test "x$have_xattr" != xno])
382
7560fffc 383# ------------------------------------------------------------------------------
feb12d3e 384AC_ARG_ENABLE([gcrypt],
7560fffc
LP
385 AS_HELP_STRING([--disable-gcrypt],[Disable optional GCRYPT support]),
386 [case "${enableval}" in
387 yes) have_gcrypt=yes ;;
388 no) have_gcrypt=no ;;
389 *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
390 esac],
391 [have_gcrypt=auto])
392
393if test "x${have_gcrypt}" != xno ; then
394 AM_PATH_LIBGCRYPT(
395 [1.4.5],
396 [have_gcrypt=yes],
397 [if test "x$have_gcrypt" = xyes ; then
398 AC_MSG_ERROR([*** GCRYPT headers not found.])
399 fi])
400
401 if test "x$have_gcrypt" = xyes ; then
402 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
403 GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS"
404 AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
405 else
406 have_gcrypt=no
407 fi
408else
409 GCRYPT_LIBS=
410 GCRYPT_CFLAGS=
411fi
412AC_SUBST(GCRYPT_LIBS)
413AC_SUBST(GCRYPT_CFLAGS)
414AM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
415
3e214785 416# ------------------------------------------------------------------------------
4927fcae
LP
417AC_ARG_ENABLE([audit],
418 AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
419 [case "${enableval}" in
420 yes) have_audit=yes ;;
421 no) have_audit=no ;;
422 *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
423 esac],
424 [have_audit=auto])
425
426if test "x${have_audit}" != xno ; then
427 AC_CHECK_HEADERS(
428 [libaudit.h],
429 [have_audit=yes],
430 [if test "x$have_audit" = xyes ; then
431 AC_MSG_ERROR([*** AUDIT headers not found.])
432 fi])
433
434 AC_CHECK_LIB(
435 [audit],
436 [audit_open],
437 [have_audit=yes],
438 [if test "x$have_audit" = xyes ; then
439 AC_MSG_ERROR([*** libaudit not found.])
440 fi])
441
442 if test "x$have_audit" = xyes ; then
443 AUDIT_LIBS="-laudit"
444 AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
445 else
446 have_audit=no
447 fi
448else
449 AUDIT_LIBS=
450fi
451AC_SUBST(AUDIT_LIBS)
452
3e214785 453# ------------------------------------------------------------------------------
7f4e0805
LP
454have_libcryptsetup=no
455AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
456if test "x$enable_libcryptsetup" != "xno"; then
880a599e 457 PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.4.2 ],
7f4e0805 458 [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
7f4e0805 459 if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
591622d7 460 AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
7f4e0805
LP
461 fi
462fi
463AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
464
f6a971bc
LP
465# ------------------------------------------------------------------------------
466have_qrencode=no
467AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
468if test "x$enable_qrencode" != "xno"; then
469 PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
470 [AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
471 if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
472 AC_MSG_ERROR([*** qrencode support requested but libraries not found])
473 fi
474fi
475AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
476
7b17a7d7
LP
477# ------------------------------------------------------------------------------
478have_microhttpd=no
479AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
480if test "x$enable_microhttpd" != "xno"; then
59bb9d9a 481 PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.5],
7b17a7d7
LP
482 [AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available]) have_microhttpd=yes], have_microhttpd=no)
483 if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
484 AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
485 fi
486fi
487AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
488
3e214785 489# ------------------------------------------------------------------------------
27669061
MV
490have_binfmt=no
491AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
492if test "x$enable_binfmt" != "xno"; then
be31376e 493 have_binfmt=yes
27669061
MV
494fi
495AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
496
3e214785 497# ------------------------------------------------------------------------------
e5e83e83
LP
498have_vconsole=no
499AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
500if test "x$enable_vconsole" != "xno"; then
be31376e 501 have_vconsole=yes
e5e83e83
LP
502fi
503AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
504
3e214785 505# ------------------------------------------------------------------------------
e5e83e83
LP
506have_readahead=no
507AC_ARG_ENABLE(readahead, AS_HELP_STRING([--disable-readahead], [disable readahead tools]))
508if test "x$enable_readahead" != "xno"; then
be31376e 509 have_readahead=yes
e5e83e83
LP
510fi
511AM_CONDITIONAL(ENABLE_READAHEAD, [test "$have_readahead" = "yes"])
512
3e214785 513# ------------------------------------------------------------------------------
4de85612
LP
514have_quotacheck=no
515AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
516if test "x$enable_quotacheck" != "xno"; then
be31376e 517 have_quotacheck=yes
4de85612
LP
518fi
519AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
520
3e214785 521# ------------------------------------------------------------------------------
4de85612
LP
522have_randomseed=no
523AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
524if test "x$enable_randomseed" != "xno"; then
be31376e 525 have_randomseed=yes
4de85612
LP
526fi
527AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
528
3e214785 529# ------------------------------------------------------------------------------
2a018e83
KS
530have_logind=no
531AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
532if test "x$enable_logind" != "xno"; then
be31376e 533 have_logind=yes
2a018e83
KS
534fi
535AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
4c80c73c 536AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
2a018e83 537
3e214785 538# ------------------------------------------------------------------------------
b2e9fb99
MV
539have_hostnamed=no
540AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
541if test "x$enable_hostnamed" != "xno"; then
be31376e 542 have_hostnamed=yes
b2e9fb99
MV
543fi
544AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
545
3e214785 546# ------------------------------------------------------------------------------
f47cd184
MV
547have_timedated=no
548AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
549if test "x$enable_timedated" != "xno"; then
be31376e 550 have_timedated=yes
f47cd184
MV
551fi
552AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
553
3e214785 554# ------------------------------------------------------------------------------
4cd1eaa5
MV
555have_localed=no
556AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
557if test "x$enable_localed" != "xno"; then
be31376e 558 have_localed=yes
4cd1eaa5
MV
559fi
560AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
561
3e214785 562# ------------------------------------------------------------------------------
f5e04665
LP
563have_coredump=no
564AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
565if test "x$enable_coredump" != "xno"; then
be31376e 566 have_coredump=yes
f5e04665
LP
567fi
568AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
569
3e214785
KS
570# ------------------------------------------------------------------------------
571AC_ARG_WITH(firmware-path,
572 AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
573 [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]),
574 [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
575OLD_IFS=$IFS
576IFS=:
577for i in $with_firmware_path; do
578 if test "x${FIRMWARE_PATH}" = "x"; then
579 FIRMWARE_PATH="\\\"${i}/\\\""
580 else
581 FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
582 fi
583done
584IFS=$OLD_IFS
585AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH])
586
587# ------------------------------------------------------------------------------
588AC_ARG_ENABLE([gudev],
589 AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
590 [], [enable_gudev=yes])
591AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ])
3e214785
KS
592AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
593
594# ------------------------------------------------------------------------------
595AC_ARG_ENABLE([keymap],
596 AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]),
597 [], [enable_keymap=yes])
598AS_IF([test "x$enable_keymap" = "xyes"], [
599 AC_PATH_PROG([GPERF], [gperf])
600 if test -z "$GPERF"; then
601 AC_MSG_ERROR([gperf is needed])
602 fi
603
604 AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
605 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}')])
606])
607AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = "xyes"])
608
609# ------------------------------------------------------------------------------
75db9a77 610have_manpages=no
4c2b0e4e 611AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
fe1fed02
ZJS
612AS_IF([test "x$enable_manpages" != xno], [
613 AS_IF([test "x$enable_manpages" = xyes -a "x$XSLTPROC" = x], [
614 AC_MSG_ERROR([*** Manpages requested but xsltproc not found])
615 ])
616 AS_IF([test "x$XSLTPROC" != x], [have_manpages=yes])
617])
618AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
75db9a77 619
3e214785 620# ------------------------------------------------------------------------------
d1ab0ca0 621
8401e9f9 622AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, ubuntu, arch, gentoo, slackware, altlinux, mandriva, mageia, angstrom or other]))
0571e011
LP
623if test "z$with_distro" = "z"; then
624 if test "$cross_compiling" = yes; then
625 AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
626 else
c87f7103 627 with_distro=$($GREP '^ID=' /etc/os-release 2>/dev/null | $SED 's/ID=//');
0571e011
LP
628 fi
629 if test "z$with_distro" = "z"; then
3ce4fad8 630 with_distro=other
0571e011
LP
631 fi
632fi
633with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
7d568925 634AC_DEFINE_UNQUOTED(DISTRIBUTION, ["${with_distro}"], [Target Distribution])
0571e011 635
34eff652
LP
636# Location of the init scripts as mandated by LSB
637SYSTEM_SYSVINIT_PATH=/etc/init.d
f1dd0c3f 638SYSTEM_SYSVRCND_PATH=/etc/rc.d
34eff652 639
f975e971 640M4_DEFINES=
12e84679 641
0571e011
LP
642case $with_distro in
643 fedora)
644 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
2c696a96 645 AC_DEFINE(TARGET_FEDORA, [], [Target is Fedora/RHEL])
f975e971 646 M4_DEFINES=-DTARGET_FEDORA=1
0571e011 647 ;;
3ce4fad8 648 opensuse|suse)
0571e011 649 SYSTEM_SYSVRCND_PATH=/etc/init.d
634826b5 650 AC_DEFINE(TARGET_SUSE, [], [Target is openSUSE/SLE])
f975e971 651 M4_DEFINES=-DTARGET_SUSE=1
0571e011
LP
652 ;;
653 debian)
0571e011 654 SYSTEM_SYSVRCND_PATH=/etc
858dae18 655 AC_DEFINE(TARGET_DEBIAN, [], [Target is Debian])
f975e971 656 M4_DEFINES=-DTARGET_DEBIAN=1
0571e011 657 ;;
858dae18
AE
658 ubuntu)
659 SYSTEM_SYSVRCND_PATH=/etc
858dae18 660 AC_DEFINE(TARGET_UBUNTU, [], [Target is Ubuntu])
f975e971 661 M4_DEFINES=-DTARGET_UBUNTU=1
858dae18 662 ;;
d7c114c0 663 arch)
4bf43a32
TG
664 SYSTEM_SYSVINIT_PATH=
665 SYSTEM_SYSVRCND_PATH=
d7c114c0 666 AC_DEFINE(TARGET_ARCH, [], [Target is ArchLinux])
f975e971 667 M4_DEFINES=-DTARGET_ARCH=1
d7c114c0 668 ;;
f2b4af1c 669 gentoo)
07459bb6
FF
670 SYSTEM_SYSVINIT_PATH=
671 SYSTEM_SYSVRCND_PATH=
f2b4af1c 672 AC_DEFINE(TARGET_GENTOO, [], [Target is Gentoo])
f975e971 673 M4_DEFINES=-DTARGET_GENTOO=1
f2b4af1c 674 ;;
65c8976a
MS
675 slackware)
676 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
65c8976a 677 AC_DEFINE(TARGET_SLACKWARE, [], [Target is Slackware])
f975e971 678 M4_DEFINES=-DTARGET_SLACKWARE=1
65c8976a 679 ;;
f5c88ec1
MV
680 frugalware)
681 SYSTEM_SYSVINIT_PATH=/etc/rc.d
f5c88ec1 682 AC_DEFINE(TARGET_FRUGALWARE, [], [Target is Frugalware])
f975e971 683 M4_DEFINES=-DTARGET_FRUGALWARE=1
f5c88ec1 684 ;;
a338bab5
AS
685 altlinux)
686 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
a338bab5 687 AC_DEFINE(TARGET_ALTLINUX, [], [Target is ALTLinux])
f975e971 688 M4_DEFINES=-DTARGET_ALTLINUX=1
a338bab5 689 ;;
1de4d79b
AB
690 mandriva)
691 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
1de4d79b 692 AC_DEFINE(TARGET_MANDRIVA, [], [Target is Mandriva])
f975e971 693 M4_DEFINES=-DTARGET_MANDRIVA=1
1de4d79b 694 ;;
1bd8b818
KK
695 angstrom)
696 SYSTEM_SYSVRCND_PATH=/etc
697 AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström])
f975e971 698 M4_DEFINES=-DTARGET_ANGSTROM=1
1bd8b818 699 ;;
6fdae8a6
DM
700 mageia)
701 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
702 AC_DEFINE(TARGET_MAGEIA, [], [Target is Mageia])
fbf5b126 703 M4_DEFINES=-DTARGET_MAGEIA=1
6fdae8a6 704 ;;
bf024b02 705 other)
0571e011
LP
706 ;;
707 *)
bf024b02 708 AC_MSG_ERROR([Your distribution (${with_distro}) is not yet supported, SysV init scripts could not be found! (patches welcome); you can specify --with-distro=other to skip this check])
0571e011
LP
709 ;;
710esac
711
136337ff 712AC_ARG_WITH([sysvinit-path],
be31376e
KS
713 [AS_HELP_STRING([--with-sysvinit-path=PATH],
714 [Specify the path to where the SysV init scripts are located @<:@default=based on distro@:>@])],
715 [SYSTEM_SYSVINIT_PATH="$withval"],
716 [])
136337ff
TFH
717
718AC_ARG_WITH([sysvrcd-path],
719 [AS_HELP_STRING([--with-sysvrcd-path=PATH],
720 [Specify the path to the base directory for the SysV rcN.d directories @<:@default=based on distro@:>@])],
721 [SYSTEM_SYSVRCND_PATH="$withval"],
722 [])
723
0571e011 724AC_SUBST(SYSTEM_SYSVINIT_PATH)
d64b723a 725AC_SUBST(SYSTEM_SYSVRCND_PATH)
f975e971 726AC_SUBST(M4_DEFINES)
0571e011 727
07459bb6
FF
728if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
729 AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
730 SYSTEM_SYSV_COMPAT="yes"
f975e971 731 M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
07459bb6
FF
732elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
733 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.])
734else
735 SYSTEM_SYSV_COMPAT="no"
736fi
737
bef2733f 738AC_ARG_WITH([tty-gid],
a05ea46d 739 [AS_HELP_STRING([--with-tty-gid=GID],
bef2733f
LP
740 [Specify the numeric GID of the 'tty' group])],
741 [AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])],
742 [])
743
0571e011
LP
744AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
745AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
746AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
858dae18
AE
747AM_CONDITIONAL(TARGET_UBUNTU, test x"$with_distro" = xubuntu)
748AM_CONDITIONAL(TARGET_DEBIAN_OR_UBUNTU, test x"$with_distro" = xdebian -o x"$with_distro" = xubuntu)
d7c114c0 749AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
f2b4af1c 750AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
65c8976a 751AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
f5c88ec1 752AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
a338bab5 753AM_CONDITIONAL(TARGET_ALTLINUX, test x"$with_distro" = xaltlinux)
1de4d79b 754AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
1bd8b818 755AM_CONDITIONAL(TARGET_ANGSTROM, test x"$with_distro" = xangstrom)
6fdae8a6 756AM_CONDITIONAL(TARGET_MAGEIA, test x"$with_distro" = xmageia)
0571e011 757
cca4aeee 758AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
cd3f8b7d 759
d2d12cd1
LP
760AC_ARG_WITH([dbuspolicydir],
761 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
762 [],
763 [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])
d122948d 764
d2d12cd1
LP
765AC_ARG_WITH([dbussessionservicedir],
766 AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
767 [],
768 [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])
d122948d 769
d2d12cd1
LP
770AC_ARG_WITH([dbussystemservicedir],
771 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
772 [],
773 [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])
d122948d 774
d2d12cd1
LP
775AC_ARG_WITH([dbusinterfacedir],
776 AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
777 [],
778 [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])
d122948d 779
b8079ae1
KS
780AC_ARG_WITH([rootprefix],
781 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
39ad55a9 782 [], [with_rootprefix=${ac_default_prefix}])
d2d12cd1 783
ae446765
KS
784AC_ARG_WITH([rootlibdir],
785 AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
786 [],
787 [with_rootlibdir=${libdir}])
788
9d3203b4 789AC_ARG_WITH([pamlibdir],
b0cca7d8 790 AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
9d3203b4
KS
791 [],
792 [with_pamlibdir=${with_rootlibdir}/security])
793
bc9bdbba
MG
794AC_ARG_ENABLE([split-usr],
795 AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
796 [],
797 [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
798 enable_split_usr=yes
799 ], [
800 enable_split_usr=no
801 ])])
802
803AS_IF([test "x${enable_split_usr}" = "xyes"], [
2c6db6fb 804 AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
bc9bdbba 805])
2c6db6fb 806
d2d12cd1
LP
807AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
808AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
809AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
810AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir])
8c6db833 811AC_SUBST([pamlibdir], [$with_pamlibdir])
b8079ae1 812AC_SUBST([rootprefix], [$with_rootprefix])
ae446765 813AC_SUBST([rootlibdir], [$with_rootlibdir])
8c4a3079 814
3e214785
KS
815AC_CONFIG_FILES([
816 Makefile po/Makefile.in
bb061708
KS
817 docs/libudev/Makefile
818 docs/libudev/version.xml
819 docs/gudev/Makefile
820 docs/gudev/version.xml
3e214785
KS
821])
822
a45a909f 823AC_OUTPUT
ae446765 824AC_MSG_RESULT([
0571e011
LP
825 $PACKAGE_NAME $VERSION
826
2c696a96 827 Distribution: ${with_distro}
07459bb6 828 SysV compatibility: ${SYSTEM_SYSV_COMPAT}
0571e011
LP
829 SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
830 SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
7f4e0805 831 libcryptsetup: ${have_libcryptsetup}
5b6319dc
LP
832 tcpwrap: ${have_tcpwrap}
833 PAM: ${have_pam}
12716238 834 AUDIT: ${have_audit}
81611586 835 IMA: ${have_ima}
12716238 836 SELinux: ${have_selinux}
807e17f0 837 XZ: ${have_xz}
5eda94dd 838 ACL: ${have_acl}
fb0951b0 839 XATTR: ${have_xattr}
7560fffc 840 GCRYPT: ${have_gcrypt}
f6a971bc 841 QRENCODE: ${have_qrencode}
7b17a7d7 842 MICROHTTPD: ${have_microhttpd}
27669061 843 binfmt: ${have_binfmt}
e5e83e83
LP
844 vconsole: ${have_vconsole}
845 readahead: ${have_readahead}
4de85612
LP
846 quotacheck: ${have_quotacheck}
847 randomseed: ${have_randomseed}
2a018e83 848 logind: ${have_logind}
b2e9fb99 849 hostnamed: ${have_hostnamed}
f47cd184 850 timedated: ${have_timedated}
4cd1eaa5 851 localed: ${have_localed}
f5e04665 852 coredump: ${have_coredump}
3e214785 853 firmware path: ${FIRMWARE_PATH}
3e214785
KS
854 gudev: ${enable_gudev}
855 gintrospection: ${enable_introspection}
856 keymap: ${enable_keymap}
8d7e170a
LP
857 Python: ${have_python}
858 Python Headers: ${have_python_devel}
3e214785 859
8c4a3079 860 prefix: ${prefix}
b8079ae1 861 rootprefix: ${with_rootprefix}
3e214785
KS
862 sysconf dir: ${sysconfdir}
863 datarootdir: ${datarootdir}
864 includedir: ${includedir}
865 include_prefix: ${INCLUDE_PREFIX}
ae446765
KS
866 lib dir: ${libdir}
867 rootlib dir: ${with_rootlibdir}
2c6db6fb 868 PAM modules dir: ${with_pamlibdir}
2c6db6fb
LP
869 D-Bus policy dir: ${with_dbuspolicydir}
870 D-Bus session dir: ${with_dbussessionservicedir}
871 D-Bus system dir: ${with_dbussystemservicedir}
872 D-Bus interfaces dir: ${with_dbusinterfacedir}
bc9bdbba 873 Split /usr: ${enable_split_usr}
5ee9f21e 874 man pages: ${have_manpages}
fe1fed02 875 gtk-doc: ${enable_gtk_doc}
66be6554 876
5a45a936
LP
877 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
878 CPPLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
879 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
ae446765 880])