chiark / gitweb /
keymap: Fix stuck keys on BenQ nScreen
[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_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 # GUdev - libudev gobject interface
83 # ------------------------------------------------------------------------------
84 AC_ARG_ENABLE([gudev],
85         AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support]),
86         [], [enable_gudev=yes])
87 if test "x$enable_gudev" = xyes; then
88         PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0])
89 fi
90
91 AC_ARG_ENABLE([introspection],
92         AS_HELP_STRING([--disable-introspection], [disable GObject introspection]),
93         [], [enable_introspection=yes])
94 if test "x$enable_introspection" = xyes; then
95         PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
96         AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support])
97         AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
98         AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
99         AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
100         AC_SUBST([GIRDIR], [$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)])
101         AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)])
102 fi
103 AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes])
104
105 AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = xyes])
106
107 # ------------------------------------------------------------------------------
108 # usb/pci-db - read vendor/device string database
109 # ------------------------------------------------------------------------------
110 AC_ARG_ENABLE([hwdb],
111         AS_HELP_STRING([--disable-hwdb], [disable hardware database support]),
112         [], [enable_hwdb=yes])
113 if test "x$enable_hwdb" = xyes; then
114         if test "x$cross_compiling" = "xno" ; then
115                 AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
116                 AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
117                 AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
118         fi
119
120         AC_ARG_WITH(usb-ids-path,
121                 [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
122                 [USB_DATABASE=${withval}],
123                 [if test -n "$usbids" ; then
124                         USB_DATABASE="$usbids"
125                 else
126                         PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
127                         AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
128                 fi])
129         AC_MSG_CHECKING([for USB database location])
130         AC_MSG_RESULT([$USB_DATABASE])
131         AC_SUBST(USB_DATABASE)
132
133         AC_ARG_WITH(pci-ids-path,
134                 [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
135                 [PCI_DATABASE=${withval}],
136                 [if test -n "$pciids" ; then
137                         PCI_DATABASE="$pciids"
138                 else
139                         AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
140                 fi])
141         AC_MSG_CHECKING([for PCI database location])
142         AC_MSG_RESULT([$PCI_DATABASE])
143         AC_SUBST(PCI_DATABASE)
144 fi
145 AM_CONDITIONAL([ENABLE_HWDB], [test "x$enable_hwdb" = xyes])
146
147 # ------------------------------------------------------------------------------
148 # keymap - map custom hardware's multimedia keys
149 # ------------------------------------------------------------------------------
150 AC_ARG_ENABLE([keymap],
151         AS_HELP_STRING([--disable-keymap], [disable keymap fixup support]),
152         [], [enable_keymap=yes])
153 if test "x$enable_keymap" = xyes; then
154         AC_PATH_PROG([GPERF], [gperf])
155         if test -z "$GPERF"; then
156                 AC_MSG_ERROR([gperf is needed])
157         fi
158
159         AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
160         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}')])
161 fi
162 AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = xyes])
163
164 # ------------------------------------------------------------------------------
165 # mtd_probe - autoloads FTL module for mtd devices
166 # ------------------------------------------------------------------------------
167 AC_ARG_ENABLE([mtd_probe],
168         AS_HELP_STRING([--disable-mtd_probe], [disable MTD support]),
169         [], [enable_mtd_probe=yes])
170 AM_CONDITIONAL([ENABLE_MTD_PROBE], [test "x$enable_mtd_probe" = xyes])
171
172 # ------------------------------------------------------------------------------
173 # rule_generator - persistent network and optical device rule generator
174 # ------------------------------------------------------------------------------
175 AC_ARG_ENABLE([rule_generator],
176         AS_HELP_STRING([--enable-rule_generator], [enable persistent network + cdrom links support]),
177         [], [enable_rule_generator=no])
178 AM_CONDITIONAL([ENABLE_RULE_GENERATOR], [test "x$enable_rule_generator" = 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         datarootdir:            ${datarootdir}
237         mandir:                 ${mandir}
238         includedir:             ${includedir}
239         include_prefix:         ${INCLUDE_PREFIX}
240         systemdsystemunitdir:   ${systemdsystemunitdir}
241         firmware path:          ${FIRMWARE_PATH}
242
243         compiler:               ${CC}
244         cflags:                 ${CFLAGS}
245         ldflags:                ${LDFLAGS}
246         xsltproc:               ${XSLTPROC}
247         gperf:                  ${GPERF}
248
249         logging:                ${enable_logging}
250         debug:                  ${enable_debug}
251         selinux:                ${with_selinux}
252
253         gudev:                  ${enable_gudev}
254         gintrospection:         ${enable_introspection}
255         keymap:                 ${enable_keymap}
256         hwdb:                   ${enable_hwdb}
257           usb.ids:              ${USB_DATABASE}
258           pci.ids:              ${PCI_DATABASE}
259         mtd_probe:              ${enable_mtd_probe}
260         rule_generator:         ${enable_rule_generator}
261         udev_acl:               ${enable_udev_acl}
262         floppy:                 ${enable_floppy}
263         edd:                    ${enable_edd}
264 ])