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