1 AC_INIT([udev], [165], [linux-hotplug@vger.kernel.org])
3 AM_INIT_AUTOMAKE([check-news foreign 1.10 dist-bzip2 subdir-objects])
4 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
6 AC_USE_SYSTEM_EXTENSIONS
8 AC_CONFIG_MACRO_DIR([m4])
12 AC_PREFIX_DEFAULT([/usr])
13 AC_PATH_PROG([XSLTPROC], [xsltproc])
15 AC_ARG_WITH([rootlibdir],
16 AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
17 [], [with_rootlibdir=$libdir])
18 AC_SUBST([rootlib_execdir], [$with_rootlibdir])
20 AC_ARG_WITH([selinux],
21 AS_HELP_STRING([--with-selinux], [enable SELinux support]),
22 [], [with_selinux=no])
23 if test "x$with_selinux" = xyes; then
25 AC_CHECK_LIB(selinux, getprevcon,
27 AC_MSG_ERROR([SELinux selected but libselinux not found]))
29 SELINUX_LIBS="-lselinux -lsepol"
30 AC_DEFINE(WITH_SELINUX, [1] ,[SELinux support.])
32 AC_SUBST([SELINUX_LIBS])
33 AM_CONDITIONAL(WITH_SELINUX, [test "x$with_selinux" = xyes])
35 AC_ARG_ENABLE([debug],
36 AS_HELP_STRING([--enable-debug], [enable debug messages]),
37 [], [enable_debug=no])
38 if test "x$enable_debug" = "xyes"; then
39 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
42 AC_ARG_ENABLE([logging],
43 AS_HELP_STRING([--disable-logging], [disable system logging]),
44 [], enable_logging=yes)
45 if test "x$enable_logging" = "xyes"; then
46 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
49 AC_ARG_WITH(firmware-path,
50 AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
51 [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]),
52 [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"])
55 for i in $with_firmware_path
57 if test "x${FIRMWARE_PATH}" = "x"; then
58 FIRMWARE_PATH="\\\"${i}/\\\""
60 FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
64 AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH])
66 AC_ARG_WITH([systemdsystemunitdir],
67 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
68 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
69 if test "x$with_systemdsystemunitdir" != xno; then
70 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
72 AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
74 AC_ARG_ENABLE([extras],
75 AS_HELP_STRING([--disable-extras], [disable extras with external dependencies]),
76 [], [enable_extras=yes])
77 if test "x$enable_extras" = xyes; then
78 AC_PATH_PROG([GPERF], [gperf])
79 if test -z "$GPERF"; then
80 AC_MSG_ERROR([gperf is needed])
83 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0])
84 AC_SUBST([GLIB_CFLAGS])
87 AC_CHECK_LIB([acl], [acl_init], [:], AC_MSG_ERROR([libacl not found]))
88 AC_CHECK_HEADER([acl/libacl.h], [:], AC_MSG_ERROR([libacl header not found]))
90 PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12)
91 AC_SUBST(LIBUSB_CFLAGS)
94 PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
95 AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
97 if test "x$cross_compiling" = "xno" ; then
98 AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
99 AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
100 AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
102 AC_ARG_WITH(pci-ids-path,
103 [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
104 [PCI_DATABASE=${withval}],
105 [if test -n "$pciids" ; then
106 PCI_DATABASE="$pciids"
108 AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
110 AC_MSG_CHECKING([for PCI database location])
111 AC_MSG_RESULT([$PCI_DATABASE])
112 AC_SUBST(PCI_DATABASE)
114 AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
115 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}')])
117 AM_CONDITIONAL([ENABLE_EXTRAS], [test "x$enable_extras" = xyes])
119 AC_ARG_ENABLE([introspection],
120 AS_HELP_STRING([--disable-introspection], [disable GObject introspection]),
121 [], [enable_introspection=yes])
122 if test "x$enable_introspection" = xyes; then
123 PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
124 AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support])
125 AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
126 AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
127 AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
128 AC_SUBST([GIRDIR], [$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)])
129 AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)])
131 AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes])
133 AC_CONFIG_HEADERS(config.h)
138 init/udev-settle.service
139 init/udev-retry.service
141 libudev/docs/Makefile
142 libudev/docs/version.xml
143 extras/gudev/gudev-1.0.pc
144 extras/gudev/docs/Makefile
145 extras/gudev/docs/version.xml
154 sysconfdir: ${sysconfdir}
157 rootlibdir: ${rootlib_execdir}
158 libexecdir: ${libexecdir}
160 datarootdir: ${datarootdir}
162 includedir: ${includedir}
164 include_prefix: ${INCLUDE_PREFIX}
166 systemdsystemunitdir: ${systemdsystemunitdir}
168 logging: ${enable_logging}
169 debug: ${enable_debug}
170 selinux: ${with_selinux}
176 extras: ${enable_extras}
177 gintrospection: ${enable_introspection}
179 usb.ids: ${USB_DATABASE}
180 pci.ids: ${PCI_DATABASE}
181 firmware path: ${FIRMWARE_PATH}
183 xsltproc: ${XSLTPROC}