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