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