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