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