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