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