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