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