chiark / gitweb /
rule_generator: fix to install rules in rules.d/
[elogind.git] / configure.ac
1 AC_PREREQ(2.60)
2 AC_INIT([udev],
3        [176],
4        [linux-hotplug@vger.kernel.org],
5        [udev],
6        [http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html])
7 AC_CONFIG_SRCDIR([src/udevd.c])
8 AC_CONFIG_AUX_DIR([build-aux])
9 AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
10 AC_USE_SYSTEM_EXTENSIONS
11 AC_SYS_LARGEFILE
12 AC_CONFIG_MACRO_DIR([m4])
13 AM_SILENT_RULES([yes])
14 LT_INIT([disable-static])
15 AC_PROG_AWK
16 AC_PROG_SED
17 AC_PROG_MKDIR_P
18 GTK_DOC_CHECK(1.10)
19 AC_PREFIX_DEFAULT([/usr])
20
21 AC_PATH_PROG([XSLTPROC], [xsltproc])
22 AM_CONDITIONAL(HAVE_XSLTPROC, test x"$XSLTPROC" != x)
23
24 AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([POSIX RT library not found])])
25
26 PKG_CHECK_MODULES(BLKID, blkid >= 2.20)
27
28 PKG_CHECK_MODULES(KMOD, libkmod >= 3)
29
30 if test "x$cross_compiling" = "xno" ; then
31        AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
32        AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
33        AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
34 fi
35
36 AC_ARG_WITH(usb-ids-path,
37        [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
38        [USB_DATABASE=${withval}],
39        [if test -n "$usbids" ; then
40               USB_DATABASE="$usbids"
41        else
42               PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
43               AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
44        fi])
45 AC_MSG_CHECKING([for USB database location])
46 AC_MSG_RESULT([$USB_DATABASE])
47 AC_SUBST(USB_DATABASE)
48
49 AC_ARG_WITH(pci-ids-path,
50        [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
51        [PCI_DATABASE=${withval}],
52        [if test -n "$pciids" ; then
53               PCI_DATABASE="$pciids"
54        else
55               AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
56        fi])
57 AC_MSG_CHECKING([for PCI database location])
58 AC_MSG_RESULT([$PCI_DATABASE])
59 AC_SUBST(PCI_DATABASE)
60
61 AC_ARG_WITH([rootprefix],
62        AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
63        [], [with_rootprefix=${ac_default_prefix}])
64 AC_SUBST([rootprefix], [$with_rootprefix])
65
66 AC_ARG_WITH([rootlibdir],
67        AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
68        [], [with_rootlibdir=$libdir])
69 AC_SUBST([rootlib_execdir], [$with_rootlibdir])
70
71 AC_ARG_WITH([selinux],
72        AS_HELP_STRING([--with-selinux], [enable SELinux support]),
73        [], [with_selinux=no])
74 AS_IF([test "x$with_selinux" = "xyes"], [
75        LIBS_save=$LIBS
76        AC_CHECK_LIB(selinux, getprevcon,
77               [],
78               AC_MSG_ERROR([SELinux selected but libselinux not found]))
79        LIBS=$LIBS_save
80        SELINUX_LIBS="-lselinux -lsepol"
81        AC_DEFINE(WITH_SELINUX, [1] ,[SELinux support.])
82 ])
83 AC_SUBST([SELINUX_LIBS])
84 AM_CONDITIONAL(WITH_SELINUX, [test "x$with_selinux" = "xyes"])
85
86 AC_ARG_ENABLE([debug],
87        AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
88        [], [enable_debug=no])
89 AS_IF([test "x$enable_debug" = "xyes"], [ AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) ])
90
91 AC_ARG_ENABLE([logging],
92        AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
93        [], enable_logging=yes)
94 AS_IF([test "x$enable_logging" = "xyes"], [ AC_DEFINE(ENABLE_LOGGING, [1], [System logging.]) ])
95
96 AC_ARG_WITH(firmware-path,
97        AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
98           [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]),
99        [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
100 OLD_IFS=$IFS
101 IFS=:
102 for i in $with_firmware_path; do
103        if test "x${FIRMWARE_PATH}" = "x"; then
104               FIRMWARE_PATH="\\\"${i}/\\\""
105        else
106               FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
107        fi
108 done
109 IFS=$OLD_IFS
110 AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH])
111
112 AC_ARG_WITH([systemdsystemunitdir],
113        AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
114        [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
115 AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) ])
116 AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != "xno" ])
117
118 # ------------------------------------------------------------------------------
119 # GUdev - libudev gobject interface
120 # ------------------------------------------------------------------------------
121 AC_ARG_ENABLE([gudev],
122        AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
123        [], [enable_gudev=yes])
124 AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ])
125
126 AC_ARG_ENABLE([introspection],
127        AS_HELP_STRING([--disable-introspection], [disable GObject introspection @<:@default=enabled@:>@]),
128        [], [enable_introspection=yes])
129 AS_IF([test "x$enable_introspection" = "xyes"], [
130        PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
131        AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support])
132        AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
133        AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
134        AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
135        AC_SUBST([GIRDIR], [$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)])
136        AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)])
137 ])
138 AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
139 AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
140
141 # ------------------------------------------------------------------------------
142 # keymap - map custom hardware's multimedia keys
143 # ------------------------------------------------------------------------------
144 AC_ARG_ENABLE([keymap],
145        AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]),
146        [], [enable_keymap=yes])
147 AS_IF([test "x$enable_keymap" = "xyes"], [
148        AC_PATH_PROG([GPERF], [gperf])
149        if test -z "$GPERF"; then
150               AC_MSG_ERROR([gperf is needed])
151        fi
152
153        AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
154        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}')])
155 ])
156 AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = "xyes"])
157
158 # ------------------------------------------------------------------------------
159 # mtd_probe - autoloads FTL module for mtd devices
160 # ------------------------------------------------------------------------------
161 AC_ARG_ENABLE([mtd_probe],
162        AS_HELP_STRING([--disable-mtd_probe], [disable MTD support @<:@default=enabled@:>@]),
163        [], [enable_mtd_probe=yes])
164 AM_CONDITIONAL([ENABLE_MTD_PROBE], [test "x$enable_mtd_probe" = "xyes"])
165
166 # ------------------------------------------------------------------------------
167 # rule_generator - persistent network and optical device rule generator
168 # ------------------------------------------------------------------------------
169 AC_ARG_ENABLE([rule_generator],
170        AS_HELP_STRING([--enable-rule_generator], [enable persistent network + cdrom links support @<:@default=disabled@:>@]),
171        [], [enable_rule_generator=no])
172 AM_CONDITIONAL([ENABLE_RULE_GENERATOR], [test "x$enable_rule_generator" = "xyes"])
173
174 # ------------------------------------------------------------------------------
175 # udev_acl - apply ACLs for users with local forground sessions
176 # ------------------------------------------------------------------------------
177 AC_ARG_ENABLE([udev_acl],
178        AS_HELP_STRING([--enable-udev_acl], [enable local user acl permissions support @<:@default=disabled@:>@]),
179        [], [enable_udev_acl=no])
180 AS_IF([test "x$enable_udev_acl" = "xyes"], [
181        AC_CHECK_LIB([acl], [acl_init], [:], AC_MSG_ERROR([libacl not found]))
182        AC_CHECK_HEADER([acl/libacl.h], [:], AC_MSG_ERROR([libacl header not found]))
183
184        PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0])
185 ])
186 AM_CONDITIONAL([ENABLE_UDEV_ACL], [test "x$enable_udev_acl" = "xyes"])
187
188 # ------------------------------------------------------------------------------
189 # create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
190 # ------------------------------------------------------------------------------
191 AC_ARG_ENABLE([floppy],
192        AS_HELP_STRING([--enable-floppy], [enable legacy floppy support @<:@default=disabled@:>@]),
193        [], [enable_floppy=no])
194 AM_CONDITIONAL([ENABLE_FLOPPY], [test "x$enable_floppy" = "xyes"])
195
196 # ------------------------------------------------------------------------------
197 # edd_id - create /dev/disk/by-id/edd-* links for BIOS EDD data
198 # ------------------------------------------------------------------------------
199 AC_ARG_ENABLE([edd],
200        AS_HELP_STRING([--enable-edd], [enable disk edd support @<:@default=disabled@:>@]),
201        [], [enable_edd=no])
202 AM_CONDITIONAL([ENABLE_EDD], [test "x$enable_edd" = "xyes"])
203
204 my_CFLAGS="-Wall \
205 -Wmissing-declarations -Wmissing-prototypes \
206 -Wnested-externs -Wpointer-arith \
207 -Wpointer-arith -Wsign-compare -Wchar-subscripts \
208 -Wstrict-prototypes -Wshadow \
209 -Wformat-security -Wtype-limits"
210 AC_SUBST([my_CFLAGS])
211
212 AC_CONFIG_HEADERS(config.h)
213 AC_CONFIG_FILES([
214        Makefile
215        src/docs/Makefile
216        src/docs/version.xml
217        src/extras/gudev/docs/Makefile
218        src/extras/gudev/docs/version.xml
219 ])
220
221 AC_OUTPUT
222 AC_MSG_RESULT([
223        $PACKAGE $VERSION
224        ========
225
226        prefix:                  ${prefix}
227        rootprefix:              ${rootprefix}
228        sysconfdir:              ${sysconfdir}
229        bindir:                  ${bindir}
230        libdir:                  ${libdir}
231        rootlibdir:              ${rootlib_execdir}
232        libexecdir:              ${libexecdir}
233        datarootdir:             ${datarootdir}
234        mandir:                  ${mandir}
235        includedir:              ${includedir}
236        include_prefix:          ${INCLUDE_PREFIX}
237        systemdsystemunitdir:    ${systemdsystemunitdir}
238        firmware path:           ${FIRMWARE_PATH}
239        usb.ids:                 ${USB_DATABASE}
240        pci.ids:                 ${PCI_DATABASE}
241
242        compiler:                ${CC}
243        cflags:                  ${CFLAGS}
244        ldflags:                 ${LDFLAGS}
245        xsltproc:                ${XSLTPROC}
246        gperf:                   ${GPERF}
247
248        logging:                 ${enable_logging}
249        debug:                   ${enable_debug}
250        selinux:                 ${with_selinux}
251
252        gudev:                   ${enable_gudev}
253        gintrospection:          ${enable_introspection}
254        keymap:                  ${enable_keymap}
255        mtd_probe:               ${enable_mtd_probe}
256        rule_generator:          ${enable_rule_generator}
257        udev_acl:                ${enable_udev_acl}
258        floppy:                  ${enable_floppy}
259        edd:                     ${enable_edd}
260 ])