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