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