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