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