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