chiark / gitweb /
libudev: enumerate - scan /sys/module
[elogind.git] / configure.ac
1 AC_PREREQ(2.60)
2 AC_INIT([udev],
3         [171],
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 # usb/pci-db - read vendor/device string database
91 # ------------------------------------------------------------------------------
92 AC_ARG_ENABLE([hwdb],
93         AS_HELP_STRING([--disable-hwdb], [disable hardware database support]),
94         [], [enable_hwdb=yes])
95 if test "x$enable_hwdb" = xyes; then
96         if test "x$cross_compiling" = "xno" ; then
97                 AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
98                 AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
99                 AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
100         fi
101
102         AC_ARG_WITH(usb-ids-path,
103                 [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
104                 [USB_DATABASE=${withval}],
105                 [if test -n "$usbids" ; then
106                         USB_DATABASE="$usbids"
107                 else
108                         PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
109                         AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
110                 fi])
111         AC_MSG_CHECKING([for USB database location])
112         AC_MSG_RESULT([$USB_DATABASE])
113         AC_SUBST(USB_DATABASE)
114
115         AC_ARG_WITH(pci-ids-path,
116                 [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
117                 [PCI_DATABASE=${withval}],
118                 [if test -n "$pciids" ; then
119                         PCI_DATABASE="$pciids"
120                 else
121                         AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
122                 fi])
123         AC_MSG_CHECKING([for PCI database location])
124         AC_MSG_RESULT([$PCI_DATABASE])
125         AC_SUBST(PCI_DATABASE)
126 fi
127 AM_CONDITIONAL([ENABLE_HWDB], [test "x$enable_hwdb" = xyes])
128
129 # ------------------------------------------------------------------------------
130 # udev_acl - apply ACLs for users with local forground sessions
131 # ------------------------------------------------------------------------------
132 AC_ARG_ENABLE([udev_acl],
133         AS_HELP_STRING([--disable-udev_acl], [disable local user acl permissions support]),
134         [], [enable_udev_acl=yes])
135 if test "x$enable_udev_acl" = xyes; then
136         AC_CHECK_LIB([acl], [acl_init], [:], AC_MSG_ERROR([libacl not found]))
137         AC_CHECK_HEADER([acl/libacl.h], [:], AC_MSG_ERROR([libacl header not found]))
138
139         PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0])
140 fi
141 AM_CONDITIONAL([ENABLE_UDEV_ACL], [test "x$enable_udev_acl" = xyes])
142
143 # ------------------------------------------------------------------------------
144 # GUdev - libudev gobject interface
145 # ------------------------------------------------------------------------------
146 AC_ARG_ENABLE([gudev],
147         AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support]),
148         [], [enable_gudev=yes])
149 if test "x$enable_gudev" = xyes; then
150         PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0])
151 fi
152
153 AC_ARG_ENABLE([introspection],
154         AS_HELP_STRING([--disable-introspection], [disable GObject introspection]),
155         [], [enable_introspection=yes])
156 if test "x$enable_introspection" = xyes; then
157         PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
158         AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support])
159         AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
160         AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
161         AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
162         AC_SUBST([GIRDIR], [$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)])
163         AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)])
164 fi
165 AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes])
166
167 AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = xyes])
168
169 # ------------------------------------------------------------------------------
170 # keymap - map custom hardware's multimedia keys
171 # ------------------------------------------------------------------------------
172 AC_ARG_ENABLE([keymap],
173         AS_HELP_STRING([--disable-keymap], [disable keymap fixup support]),
174         [], [enable_keymap=yes])
175 if test "x$enable_keymap" = xyes; then
176         AC_PATH_PROG([GPERF], [gperf])
177         if test -z "$GPERF"; then
178                 AC_MSG_ERROR([gperf is needed])
179         fi
180
181         AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
182         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}')])
183 fi
184 AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = xyes])
185
186 # ------------------------------------------------------------------------------
187 # create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
188 # ------------------------------------------------------------------------------
189 AC_ARG_ENABLE([floppy],
190         AS_HELP_STRING([--enable-floppy], [enable legacy floppy support]),
191         [], [enable_floppy=no])
192 AM_CONDITIONAL([ENABLE_FLOPPY], [test "x$enable_floppy" = xyes])
193
194 # ------------------------------------------------------------------------------
195 # edd_id - create /dev/disk/by-id/edd-* links for BIOS EDD data
196 # ------------------------------------------------------------------------------
197 AC_ARG_ENABLE([edd],
198         AS_HELP_STRING([--enable-edd], [enable disk edd support]),
199         [], [enable_edd=no])
200 AM_CONDITIONAL([ENABLE_EDD], [test "x$enable_edd" = xyes])
201
202 AC_CONFIG_HEADERS(config.h)
203 AC_CONFIG_FILES([
204         Makefile
205         udev/udev.pc
206         init/udev.service
207         init/udev-trigger.service
208         init/udev-settle.service
209         libudev/libudev.pc
210         libudev/docs/Makefile
211         libudev/docs/version.xml
212         extras/gudev/gudev-1.0.pc
213         extras/gudev/docs/Makefile
214         extras/gudev/docs/version.xml
215 ])
216
217 AC_OUTPUT
218 AC_MSG_RESULT([
219         udev $VERSION
220         ========
221
222         prefix:                 ${prefix}
223         sysconfdir:             ${sysconfdir}
224         sbindir:                ${sbindir}
225         libdir:                 ${libdir}
226         rootlibdir:             ${rootlib_execdir}
227         libexecdir:             ${libexecdir}
228
229         datarootdir:            ${datarootdir}
230         mandir:                 ${mandir}
231         includedir:             ${includedir}
232
233         include_prefix:         ${INCLUDE_PREFIX}
234
235         systemdsystemunitdir:   ${systemdsystemunitdir}
236
237         logging:                ${enable_logging}
238         debug:                  ${enable_debug}
239         selinux:                ${with_selinux}
240
241         compiler:               ${CC}
242         cflags:                 ${CFLAGS}
243         ldflags:                ${LDFLAGS}
244
245         rule_generator:         ${enable_rule_generator}
246         hwdb:                   ${enable_hwdb}
247         udev_acl:               ${enable_udev_acl}
248         gudev:                  ${enable_gudev}
249         gintrospection:         ${enable_introspection}
250         keymap:                 ${enable_keymap}
251         floppy:                 ${enable_floppy}
252         edd:                    ${enable_edd}
253
254         usb.ids:                ${USB_DATABASE}
255         pci.ids:                ${PCI_DATABASE}
256         firmware path:          ${FIRMWARE_PATH}
257
258         xsltproc:               ${XSLTPROC}
259         gperf:                  ${GPERF}
260 ])