chiark / gitweb /
watchdog: make watchdog dbus properties writable
[elogind.git] / configure.ac
1 #  This file is part of systemd.
2 #
3 #  Copyright 2010-2012 Lennart Poettering
4 #  Copyright 2010-2012 Kay Sievers
5 #
6 #  systemd is free software; you can redistribute it and/or modify it
7 #  under the terms of the GNU Lesser General Public License as published by
8 #  the Free Software Foundation; either version 2.1 of the License, or
9 #  (at your option) any later version.
10 #
11 #  systemd is distributed in the hope that it will be useful, but
12 #  WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public License
17 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
18
19 AC_PREREQ(2.63)
20
21 AC_INIT([systemd],[182],[systemd-devel@lists.freedesktop.org])
22 AC_SUBST(PACKAGE_URL, [http://www.freedesktop.org/wiki/Software/systemd])
23 AC_CONFIG_SRCDIR([src/core/main.c])
24 AC_CONFIG_MACRO_DIR([m4])
25 AC_CONFIG_HEADERS([config.h])
26 AC_USE_SYSTEM_EXTENSIONS
27 AC_SYS_LARGEFILE
28 AC_PREFIX_DEFAULT([/usr])
29 AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects check-news])
30 AM_SILENT_RULES([yes])
31 AC_CANONICAL_HOST
32 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
33 AS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" ||
34        test "x$host_cpu" = "xmips64" || test "x$host_cpu" = "xmips64el"],
35       [AC_DEFINE(ARCH_MIPS, [], [Whether on mips arch])])
36
37 LT_PREREQ(2.2)
38 LT_INIT
39
40 # i18n stuff for the PolicyKit policy files
41 IT_PROG_INTLTOOL([0.40.0])
42
43 GETTEXT_PACKAGE=systemd
44 AC_SUBST(GETTEXT_PACKAGE)
45
46 AC_PROG_MKDIR_P
47 AC_PROG_LN_S
48 AC_PROG_SED
49 AC_PROG_GREP
50 AC_PROG_AWK
51
52 AC_PROG_CC
53 AC_PROG_CC_C99
54 AM_PROG_CC_C_O
55 AC_PROG_GCC_TRADITIONAL
56
57 AC_PATH_PROG([M4], [m4])
58 GTK_DOC_CHECK(1.10)
59 GOBJECT_INTROSPECTION_CHECK([1.31.1])
60
61 AC_CHECK_TOOL(OBJCOPY, objcopy)
62 AC_CHECK_TOOL(STRINGS, strings)
63 AC_CHECK_TOOL(GPERF, gperf)
64 if test -z "$GPERF" ; then
65         AC_MSG_ERROR([*** gperf not found])
66 fi
67
68 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
69         -pipe \
70         -Wall \
71         -W \
72         -Wextra \
73         -Wno-inline \
74         -Wvla \
75         -Wundef \
76         -Wformat=2 \
77         -Wlogical-op \
78         -Wsign-compare \
79         -Wformat-security \
80         -Wmissing-include-dirs \
81         -Wformat-nonliteral \
82         -Wold-style-definition \
83         -Wpointer-arith \
84         -Winit-self \
85         -Wdeclaration-after-statement \
86         -Wfloat-equal \
87         -Wmissing-prototypes \
88         -Wstrict-prototypes \
89         -Wredundant-decls \
90         -Wmissing-declarations \
91         -Wmissing-noreturn \
92         -Wshadow \
93         -Wendif-labels \
94         -Wcast-align \
95         -Wstrict-aliasing=2 \
96         -Wwrite-strings \
97         -Wno-long-long \
98         -Wno-overlength-strings \
99         -Wno-unused-parameter \
100         -Wno-missing-field-initializers \
101         -Wno-unused-result \
102         -Werror=overflow \
103         -Wp,-D_FORTIFY_SOURCE=2 \
104         -ffast-math \
105         -fno-common \
106         -fdiagnostics-show-option \
107         -fno-strict-aliasing \
108         -fvisibility=hidden \
109         -ffunction-sections \
110         -fdata-sections])
111 AC_SUBST([WARNINGFLAGS], $with_cflags)
112
113 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
114         -Wl,--as-needed \
115         -Wl,--gc-sections])
116 AC_SUBST([GCLDFLAGS], $with_ldflags)
117
118 AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
119 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
120
121 save_LIBS="$LIBS"
122 LIBS=
123 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
124 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
125 CAP_LIBS="$LIBS"
126 LIBS="$save_LIBS"
127 AC_SUBST(CAP_LIBS)
128
129 # This makes sure pkg.m4 is available.
130 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
131
132 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2])
133 PKG_CHECK_MODULES(KMOD, [libkmod >= 5])
134 PKG_CHECK_MODULES(BLKID,[blkid >= 2.20])
135
136 # ------------------------------------------------------------------------------
137 have_ima=yes
138 AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]),
139                 [case "${enableval}" in
140                         yes) have_ima=yes ;;
141                         no) have_ima=no ;;
142                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
143                 esac],
144                 [have_ima=yes])
145
146 if test "x${have_ima}" != xno ; then
147         AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
148 fi
149
150 # ------------------------------------------------------------------------------
151 have_selinux=no
152 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
153 if test "x$enable_selinux" != "xno"; then
154         PKG_CHECK_MODULES(SELINUX, [ libselinux ],
155                 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no)
156         if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
157                 AC_MSG_ERROR([*** SELinux support requested but libraries not found])
158         fi
159 fi
160 AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
161
162 # ------------------------------------------------------------------------------
163 have_xz=no
164 AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
165 if test "x$enable_xz" != "xno"; then
166         PKG_CHECK_MODULES(XZ, [ liblzma ],
167                 [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no)
168         if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then
169                 AC_MSG_ERROR([*** Xz support requested but libraries not found])
170         fi
171 fi
172 AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
173
174 # ------------------------------------------------------------------------------
175 AC_ARG_ENABLE([tcpwrap],
176         AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]),
177                 [case "${enableval}" in
178                         yes) have_tcpwrap=yes ;;
179                         no) have_tcpwrap=no ;;
180                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;;
181                 esac],
182                 [have_tcpwrap=auto])
183
184 if test "x${have_tcpwrap}" != xno ; then
185         ACX_LIBWRAP
186         if test "x${LIBWRAP_LIBS}" = x ; then
187                 if test "x$have_tcpwrap" = xyes ; then
188                         AC_MSG_ERROR([*** TCP wrappers support not found.])
189                 fi
190                 have_tcpwrap=no
191         else
192                 have_tcpwrap=yes
193         fi
194 else
195         LIBWRAP_LIBS=
196 fi
197 AC_SUBST(LIBWRAP_LIBS)
198
199 # ------------------------------------------------------------------------------
200 AC_ARG_ENABLE([pam],
201         AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
202                 [case "${enableval}" in
203                         yes) have_pam=yes ;;
204                         no) have_pam=no ;;
205                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
206                 esac],
207                 [have_pam=auto])
208
209 if test "x${have_pam}" != xno ; then
210         AC_CHECK_HEADERS(
211                 [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
212                 [have_pam=yes],
213                 [if test "x$have_pam" = xyes ; then
214                         AC_MSG_ERROR([*** PAM headers not found.])
215                 fi])
216
217         AC_CHECK_LIB(
218                 [pam],
219                 [pam_syslog],
220                 [have_pam=yes],
221                 [if test "x$have_pam" = xyes ; then
222                         AC_MSG_ERROR([*** libpam not found.])
223                 fi])
224
225         if test "x$have_pam" = xyes ; then
226                 PAM_LIBS="-lpam -lpam_misc"
227                 AC_DEFINE(HAVE_PAM, 1, [PAM available])
228         else
229                 have_pam=no
230         fi
231 else
232         PAM_LIBS=
233 fi
234 AC_SUBST(PAM_LIBS)
235 AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
236
237 # ------------------------------------------------------------------------------
238 AC_ARG_ENABLE([acl],
239         AS_HELP_STRING([--disable-acl],[Disable optional ACL support]),
240                 [case "${enableval}" in
241                         yes) have_acl=yes ;;
242                         no) have_acl=no ;;
243                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
244                 esac],
245                 [have_acl=auto])
246
247 if test "x${have_acl}" != xno ; then
248         AC_CHECK_HEADERS(
249                 [sys/acl.h acl/libacl.h],
250                 [have_acl=yes],
251                 [if test "x$have_acl" = xyes ; then
252                         AC_MSG_ERROR([*** ACL headers not found.])
253                 fi])
254
255         AC_CHECK_LIB(
256                 [acl],
257                 [acl_get_file],
258                 [have_acl=yes],
259                 [if test "x$have_acl" = xyes ; then
260                         AC_MSG_ERROR([*** libacl not found.])
261                 fi])
262
263         if test "x$have_acl" = xyes ; then
264                 ACL_LIBS="-lacl"
265                 AC_DEFINE(HAVE_ACL, 1, [ACL available])
266         else
267                 have_acl=no
268         fi
269 else
270         ACL_LIBS=
271 fi
272 AC_SUBST(ACL_LIBS)
273 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
274
275 # ------------------------------------------------------------------------------
276 AC_ARG_ENABLE([audit],
277         AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
278                 [case "${enableval}" in
279                         yes) have_audit=yes ;;
280                         no) have_audit=no ;;
281                         *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
282                 esac],
283                 [have_audit=auto])
284
285 if test "x${have_audit}" != xno ; then
286         AC_CHECK_HEADERS(
287                 [libaudit.h],
288                 [have_audit=yes],
289                 [if test "x$have_audit" = xyes ; then
290                         AC_MSG_ERROR([*** AUDIT headers not found.])
291                 fi])
292
293         AC_CHECK_LIB(
294                 [audit],
295                 [audit_open],
296                 [have_audit=yes],
297                 [if test "x$have_audit" = xyes ; then
298                         AC_MSG_ERROR([*** libaudit not found.])
299                 fi])
300
301         if test "x$have_audit" = xyes ; then
302                 AUDIT_LIBS="-laudit"
303                 AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
304         else
305                 have_audit=no
306         fi
307 else
308         AUDIT_LIBS=
309 fi
310 AC_SUBST(AUDIT_LIBS)
311
312 # ------------------------------------------------------------------------------
313 have_libcryptsetup=no
314 AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
315 if test "x$enable_libcryptsetup" != "xno"; then
316         PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup ],
317                 [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
318         if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
319                 AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
320         fi
321 fi
322 AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
323
324 # ------------------------------------------------------------------------------
325 have_binfmt=no
326 AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
327 if test "x$enable_binfmt" != "xno"; then
328         have_binfmt=yes
329 fi
330 AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
331
332 # ------------------------------------------------------------------------------
333 have_vconsole=no
334 AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
335 if test "x$enable_vconsole" != "xno"; then
336         have_vconsole=yes
337 fi
338 AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
339
340 # ------------------------------------------------------------------------------
341 have_readahead=no
342 AC_ARG_ENABLE(readahead, AS_HELP_STRING([--disable-readahead], [disable readahead tools]))
343 if test "x$enable_readahead" != "xno"; then
344         have_readahead=yes
345 fi
346 AM_CONDITIONAL(ENABLE_READAHEAD, [test "$have_readahead" = "yes"])
347
348 # ------------------------------------------------------------------------------
349 have_quotacheck=no
350 AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
351 if test "x$enable_quotacheck" != "xno"; then
352         have_quotacheck=yes
353 fi
354 AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
355
356 # ------------------------------------------------------------------------------
357 have_randomseed=no
358 AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
359 if test "x$enable_randomseed" != "xno"; then
360         have_randomseed=yes
361 fi
362 AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
363
364 # ------------------------------------------------------------------------------
365 have_logind=no
366 AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
367 if test "x$enable_logind" != "xno"; then
368         have_logind=yes
369 fi
370 AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
371 AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ])
372
373 # ------------------------------------------------------------------------------
374 have_hostnamed=no
375 AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
376 if test "x$enable_hostnamed" != "xno"; then
377         have_hostnamed=yes
378 fi
379 AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
380
381 # ------------------------------------------------------------------------------
382 have_timedated=no
383 AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
384 if test "x$enable_timedated" != "xno"; then
385         have_timedated=yes
386 fi
387 AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
388
389 # ------------------------------------------------------------------------------
390 have_localed=no
391 AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
392 if test "x$enable_localed" != "xno"; then
393         have_localed=yes
394 fi
395 AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
396
397 # ------------------------------------------------------------------------------
398 have_coredump=no
399 AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
400 if test "x$enable_coredump" != "xno"; then
401         have_coredump=yes
402 fi
403 AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
404
405 # ------------------------------------------------------------------------------
406 if test "x$cross_compiling" = "xno" ; then
407        AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
408        AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
409        AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
410 fi
411
412 AC_ARG_WITH(usb-ids-path,
413        [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
414        [USB_DATABASE=${withval}],
415        [if test -n "$usbids" ; then
416               USB_DATABASE="$usbids"
417        else
418               PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
419               AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
420        fi])
421 AC_MSG_CHECKING([for USB database location])
422 AC_MSG_RESULT([$USB_DATABASE])
423 AC_SUBST(USB_DATABASE)
424
425 AC_ARG_WITH(pci-ids-path,
426        [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
427        [PCI_DATABASE=${withval}],
428        [if test -n "$pciids" ; then
429               PCI_DATABASE="$pciids"
430        else
431               AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
432        fi])
433 AC_MSG_CHECKING([for PCI database location])
434 AC_MSG_RESULT([$PCI_DATABASE])
435 AC_SUBST(PCI_DATABASE)
436
437 # ------------------------------------------------------------------------------
438 AC_ARG_WITH(firmware-path,
439        AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
440           [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]),
441        [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
442 OLD_IFS=$IFS
443 IFS=:
444 for i in $with_firmware_path; do
445        if test "x${FIRMWARE_PATH}" = "x"; then
446               FIRMWARE_PATH="\\\"${i}/\\\""
447        else
448               FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
449        fi
450 done
451 IFS=$OLD_IFS
452 AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH])
453
454 # ------------------------------------------------------------------------------
455 AC_ARG_ENABLE([gudev],
456        AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
457        [], [enable_gudev=yes])
458 AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ])
459 AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
460
461 # ------------------------------------------------------------------------------
462 AC_ARG_ENABLE([keymap],
463        AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]),
464        [], [enable_keymap=yes])
465 AS_IF([test "x$enable_keymap" = "xyes"], [
466        AC_PATH_PROG([GPERF], [gperf])
467        if test -z "$GPERF"; then
468               AC_MSG_ERROR([gperf is needed])
469        fi
470
471        AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
472        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}')])
473 ])
474 AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = "xyes"])
475
476 # ------------------------------------------------------------------------------
477 have_manpages=no
478 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
479 if test "x$enable_manpages" != "xno"; then
480         have_manpages=yes
481 fi
482 AM_CONDITIONAL(ENABLE_MANPAGES, [test "$have_manpages" = "yes"])
483
484 # ------------------------------------------------------------------------------
485 AC_PATH_PROG([XSLTPROC], [xsltproc])
486 AM_CONDITIONAL(HAVE_XSLTPROC, test x"$XSLTPROC" != x)
487
488 AC_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]))
489 if test "z$with_distro" = "z"; then
490         if test "$cross_compiling" = yes; then
491                 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)])
492         else
493                 with_distro=$($GREP '^ID=' /etc/os-release | $SED 's/ID=//');
494         fi
495         if test "z$with_distro" = "z"; then
496                 with_distro=other
497         fi
498 fi
499 with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
500 AC_DEFINE_UNQUOTED(DISTRIBUTION, ["${with_distro}"], [Target Distribution])
501
502 # Location of the init scripts as mandated by LSB
503 SYSTEM_SYSVINIT_PATH=/etc/init.d
504 SYSTEM_SYSVRCND_PATH=/etc/rc.d
505
506 M4_DEFINES=
507 have_plymouth=no
508
509 case $with_distro in
510         fedora)
511                 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
512                 AC_DEFINE(TARGET_FEDORA, [], [Target is Fedora/RHEL])
513                 M4_DEFINES=-DTARGET_FEDORA=1
514                 have_plymouth=yes
515                 ;;
516         opensuse|suse)
517                 SYSTEM_SYSVRCND_PATH=/etc/init.d
518                 AC_DEFINE(TARGET_SUSE, [], [Target is openSUSE/SLE])
519                 M4_DEFINES=-DTARGET_SUSE=1
520                 have_plymouth=yes
521                 ;;
522         debian)
523                 SYSTEM_SYSVRCND_PATH=/etc
524                 AC_DEFINE(TARGET_DEBIAN, [], [Target is Debian])
525                 M4_DEFINES=-DTARGET_DEBIAN=1
526                 ;;
527         ubuntu)
528                 SYSTEM_SYSVRCND_PATH=/etc
529                 AC_DEFINE(TARGET_UBUNTU, [], [Target is Ubuntu])
530                 M4_DEFINES=-DTARGET_UBUNTU=1
531                 ;;
532         arch)
533                 SYSTEM_SYSVINIT_PATH=/etc/rc.d
534                 SYSTEM_SYSVRCND_PATH=/etc
535                 AC_DEFINE(TARGET_ARCH, [], [Target is ArchLinux])
536                 M4_DEFINES=-DTARGET_ARCH=1
537                 ;;
538         gentoo)
539                 SYSTEM_SYSVINIT_PATH=
540                 SYSTEM_SYSVRCND_PATH=
541                 AC_DEFINE(TARGET_GENTOO, [], [Target is Gentoo])
542                 M4_DEFINES=-DTARGET_GENTOO=1
543                 ;;
544         slackware)
545                 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
546                 AC_DEFINE(TARGET_SLACKWARE, [], [Target is Slackware])
547                 M4_DEFINES=-DTARGET_SLACKWARE=1
548                 ;;
549         frugalware)
550                 SYSTEM_SYSVINIT_PATH=/etc/rc.d
551                 AC_DEFINE(TARGET_FRUGALWARE, [], [Target is Frugalware])
552                 M4_DEFINES=-DTARGET_FRUGALWARE=1
553                 have_plymouth=yes
554                 ;;
555         altlinux)
556                 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
557                 AC_DEFINE(TARGET_ALTLINUX, [], [Target is ALTLinux])
558                 M4_DEFINES=-DTARGET_ALTLINUX=1
559                 have_plymouth=yes
560                 ;;
561         mandriva)
562                 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
563                 AC_DEFINE(TARGET_MANDRIVA, [], [Target is Mandriva])
564                 M4_DEFINES=-DTARGET_MANDRIVA=1
565                 have_plymouth=yes
566                 ;;
567         meego)
568                 SYSTEM_SYSVINIT_PATH=
569                 SYSTEM_SYSVRCND_PATH=
570                 AC_DEFINE(TARGET_MEEGO, [], [Target is MeeGo])
571                 M4_DEFINES=-DTARGET_MEEGO=1
572                 ;;
573         angstrom)
574                 SYSTEM_SYSVRCND_PATH=/etc
575                 AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström])
576                 M4_DEFINES=-DTARGET_ANGSTROM=1
577                 ;;
578         mageia)
579                 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
580                 AC_DEFINE(TARGET_MAGEIA, [], [Target is Mageia])
581                 M4_DISTRO_FLAG=-DTARGET_MAGEIA=1
582                 have_plymouth=yes
583                 ;;
584         other)
585                 ;;
586         *)
587                 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])
588                 ;;
589 esac
590
591 AC_ARG_WITH([sysvinit-path],
592         [AS_HELP_STRING([--with-sysvinit-path=PATH],
593                 [Specify the path to where the SysV init scripts are located @<:@default=based on distro@:>@])],
594         [SYSTEM_SYSVINIT_PATH="$withval"],
595         [])
596
597 AC_ARG_WITH([sysvrcd-path],
598         [AS_HELP_STRING([--with-sysvrcd-path=PATH],
599                 [Specify the path to the base directory for the SysV rcN.d directories @<:@default=based on distro@:>@])],
600         [SYSTEM_SYSVRCND_PATH="$withval"],
601         [])
602
603 AC_SUBST(SYSTEM_SYSVINIT_PATH)
604 AC_SUBST(SYSTEM_SYSVRCND_PATH)
605 AC_SUBST(M4_DEFINES)
606
607 if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
608         AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
609         SYSTEM_SYSV_COMPAT="yes"
610         M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
611 elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
612         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.])
613 else
614         SYSTEM_SYSV_COMPAT="no"
615 fi
616
617 AC_ARG_WITH([tty-gid],
618         [AS_HELP_STRING([--with-tty-gid=GID],
619                 [Specify the numeric GID of the 'tty' group])],
620         [AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])],
621         [])
622
623 AC_ARG_ENABLE(plymouth, AS_HELP_STRING([--enable-plymouth], [enable plymouth support]))
624 if test -n "$enable_plymouth"; then
625         have_plymouth="$enable_plymouth"
626 fi
627
628 AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
629 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
630 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
631 AM_CONDITIONAL(TARGET_UBUNTU, test x"$with_distro" = xubuntu)
632 AM_CONDITIONAL(TARGET_DEBIAN_OR_UBUNTU, test x"$with_distro" = xdebian -o x"$with_distro" = xubuntu)
633 AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
634 AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
635 AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
636 AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
637 AM_CONDITIONAL(TARGET_ALTLINUX, test x"$with_distro" = xaltlinux)
638 AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
639 AM_CONDITIONAL(TARGET_MEEGO, test x"$with_distro" = xmeego)
640 AM_CONDITIONAL(TARGET_ANGSTROM, test x"$with_distro" = xangstrom)
641 AM_CONDITIONAL(TARGET_MAGEIA, test x"$with_distro" = xmageia)
642
643 AM_CONDITIONAL(HAVE_PLYMOUTH, test "$have_plymouth" = "yes")
644 AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
645
646 AC_ARG_WITH([dbuspolicydir],
647         AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
648         [],
649         [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])
650
651 AC_ARG_WITH([dbussessionservicedir],
652         AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
653         [],
654         [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])
655
656 AC_ARG_WITH([dbussystemservicedir],
657         AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
658         [],
659         [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])
660
661 AC_ARG_WITH([dbusinterfacedir],
662         AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
663         [],
664         [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])
665
666 AC_ARG_WITH([rootprefix],
667         AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
668         [], [with_rootprefix=${ac_default_prefix}])
669
670 AC_ARG_WITH([rootlibdir],
671         AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]),
672         [],
673         [with_rootlibdir=${libdir}])
674
675 AC_ARG_WITH([pamlibdir],
676         AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
677         [],
678         [with_pamlibdir=${with_rootlibdir}/security])
679
680 AC_ARG_ENABLE([split-usr],
681         AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),
682         [],
683         [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
684                 enable_split_usr=yes
685         ], [
686                 enable_split_usr=no
687         ])])
688
689 AS_IF([test "x${enable_split_usr}" = "xyes"], [
690         AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
691 ])
692
693 AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
694 AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
695 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
696 AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir])
697 AC_SUBST([pamlibdir], [$with_pamlibdir])
698 AC_SUBST([rootprefix], [$with_rootprefix])
699 AC_SUBST([rootlibdir], [$with_rootlibdir])
700
701 AC_CONFIG_FILES([
702         Makefile po/Makefile.in
703         docs/libudev/Makefile
704         docs/libudev/version.xml
705         docs/gudev/Makefile
706         docs/gudev/version.xml
707 ])
708
709 AC_OUTPUT
710 AC_MSG_RESULT([
711         $PACKAGE_NAME $VERSION
712
713         Distribution:            ${with_distro}
714         SysV compatibility:      ${SYSTEM_SYSV_COMPAT}
715         SysV init scripts:       ${SYSTEM_SYSVINIT_PATH}
716         SysV rc?.d directories:  ${SYSTEM_SYSVRCND_PATH}
717         libcryptsetup:           ${have_libcryptsetup}
718         tcpwrap:                 ${have_tcpwrap}
719         PAM:                     ${have_pam}
720         AUDIT:                   ${have_audit}
721         IMA:                     ${have_ima}
722         SELinux:                 ${have_selinux}
723         XZ:                      ${have_xz}
724         ACL:                     ${have_acl}
725         binfmt:                  ${have_binfmt}
726         vconsole:                ${have_vconsole}
727         readahead:               ${have_readahead}
728         quotacheck:              ${have_quotacheck}
729         randomseed:              ${have_randomseed}
730         logind:                  ${have_logind}
731         hostnamed:               ${have_hostnamed}
732         timedated:               ${have_timedated}
733         localed:                 ${have_localed}
734         coredump:                ${have_coredump}
735         plymouth:                ${have_plymouth}
736         firmware path:           ${FIRMWARE_PATH}
737         usb.ids:                 ${USB_DATABASE}
738         pci.ids:                 ${PCI_DATABASE}
739         gudev:                   ${enable_gudev}
740         gintrospection:          ${enable_introspection}
741         keymap:                  ${enable_keymap}
742
743         prefix:                  ${prefix}
744         rootprefix:              ${with_rootprefix}
745         sysconf dir:             ${sysconfdir}
746         datarootdir:             ${datarootdir}
747         includedir:              ${includedir}
748         include_prefix:          ${INCLUDE_PREFIX}
749         libexec dir:             ${libexecdir}
750         lib dir:                 ${libdir}
751         rootlib dir:             ${with_rootlibdir}
752         PAM modules dir:         ${with_pamlibdir}
753         D-Bus policy dir:        ${with_dbuspolicydir}
754         D-Bus session dir:       ${with_dbussessionservicedir}
755         D-Bus system dir:        ${with_dbussystemservicedir}
756         D-Bus interfaces dir:    ${with_dbusinterfacedir}
757         Split /usr:              ${enable_split_usr}
758         man pages:               ${have_manpages}
759 ])