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