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