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