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