chiark / gitweb /
keymap: continue reading keymap after invalid scancodes
[elogind.git] / configure.ac
1 AC_INIT([udev], [167], [linux-hotplug@vger.kernel.org])
2 AC_PREREQ(2.60)
3 AM_INIT_AUTOMAKE([check-news foreign 1.10 dist-bzip2 subdir-objects])
4 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
5 AC_DISABLE_STATIC
6 AC_USE_SYSTEM_EXTENSIONS
7 AC_SYS_LARGEFILE
8 AC_CONFIG_MACRO_DIR([m4])
9 LT_INIT
10 AC_PROG_AWK
11 GTK_DOC_CHECK(1.10)
12 AC_PREFIX_DEFAULT([/usr])
13 AC_PATH_PROG([XSLTPROC], [xsltproc])
14
15 AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([POSIX RT library not found])])
16
17 AC_ARG_WITH([rootlibdir],
18         AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
19         [], [with_rootlibdir=$libdir])
20 AC_SUBST([rootlib_execdir], [$with_rootlibdir])
21
22 AC_ARG_WITH([selinux],
23         AS_HELP_STRING([--with-selinux], [enable SELinux support]),
24         [], [with_selinux=no])
25 if test "x$with_selinux" = xyes; then
26         LIBS_save=$LIBS
27         AC_CHECK_LIB(selinux, getprevcon,
28                 [],
29                 AC_MSG_ERROR([SELinux selected but libselinux not found]))
30         LIBS=$LIBS_save
31         SELINUX_LIBS="-lselinux -lsepol"
32         AC_DEFINE(WITH_SELINUX, [1] ,[SELinux support.])
33 fi
34 AC_SUBST([SELINUX_LIBS])
35 AM_CONDITIONAL(WITH_SELINUX, [test "x$with_selinux" = xyes])
36
37 AC_ARG_ENABLE([debug],
38         AS_HELP_STRING([--enable-debug], [enable debug messages]),
39         [], [enable_debug=no])
40 if test "x$enable_debug" = "xyes"; then
41         AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
42 fi
43
44 AC_ARG_ENABLE([logging],
45         AS_HELP_STRING([--disable-logging], [disable system logging]),
46         [], enable_logging=yes)
47 if test "x$enable_logging" = "xyes"; then
48         AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
49 fi
50
51 AC_ARG_WITH(firmware-path,
52         AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
53            [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]),
54         [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"])
55 OLD_IFS=$IFS
56 IFS=:
57 for i in $with_firmware_path
58 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 if test "x$with_systemdsystemunitdir" != xno; then
72     AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
73 fi
74 AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
75
76 AC_ARG_ENABLE([extras],
77         AS_HELP_STRING([--disable-extras], [disable extras with external dependencies]),
78         [], [enable_extras=yes])
79 if test "x$enable_extras" = xyes; then
80         AC_PATH_PROG([GPERF], [gperf])
81         if test -z "$GPERF"; then
82                 AC_MSG_ERROR([gperf is needed])
83         fi
84
85         PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0])
86         AC_SUBST([GLIB_CFLAGS])
87         AC_SUBST([GLIB_LIBS])
88
89         AC_CHECK_LIB([acl], [acl_init], [:], AC_MSG_ERROR([libacl not found]))
90         AC_CHECK_HEADER([acl/libacl.h], [:], AC_MSG_ERROR([libacl header not found]))
91
92         PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12)
93         AC_SUBST(LIBUSB_CFLAGS)
94         AC_SUBST(LIBUSB_LIBS)
95
96         PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
97         AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
98
99         if test "x$cross_compiling" = "xno" ; then
100                 AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
101                 AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
102                 AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
103         fi
104         AC_ARG_WITH(pci-ids-path,
105                 [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
106                 [PCI_DATABASE=${withval}],
107                 [if test -n "$pciids" ; then
108                         PCI_DATABASE="$pciids"
109                 else
110                         AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
111                 fi])
112         AC_MSG_CHECKING([for PCI database location])
113         AC_MSG_RESULT([$PCI_DATABASE])
114         AC_SUBST(PCI_DATABASE)
115
116         AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
117         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}')])
118 fi
119 AM_CONDITIONAL([ENABLE_EXTRAS], [test "x$enable_extras" = xyes])
120
121 AC_ARG_ENABLE([introspection],
122         AS_HELP_STRING([--disable-introspection], [disable GObject introspection]),
123         [], [enable_introspection=yes])
124 if test "x$enable_introspection" = xyes; then
125         PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
126         AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support])
127         AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
128         AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
129         AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
130         AC_SUBST([GIRDIR], [$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)])
131         AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)])
132 fi
133 AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes])
134
135 AC_CONFIG_HEADERS(config.h)
136 AC_CONFIG_FILES([
137         Makefile
138         udev/udev.pc
139         init/udev.service
140         init/udev-trigger.service
141         init/udev-settle.service
142         libudev/libudev.pc
143         libudev/docs/Makefile
144         libudev/docs/version.xml
145         extras/gudev/gudev-1.0.pc
146         extras/gudev/docs/Makefile
147         extras/gudev/docs/version.xml
148 ])
149
150 AC_OUTPUT
151 AC_MSG_RESULT([
152         udev $VERSION
153         ========
154
155         prefix:                 ${prefix}
156         sysconfdir:             ${sysconfdir}
157         sbindir:                ${sbindir}
158         libdir:                 ${libdir}
159         rootlibdir:             ${rootlib_execdir}
160         libexecdir:             ${libexecdir}
161
162         datarootdir:            ${datarootdir}
163         mandir:                 ${mandir}
164         includedir:             ${includedir}
165
166         include_prefix:         ${INCLUDE_PREFIX}
167
168         systemdsystemunitdir:   ${systemdsystemunitdir}
169
170         logging:                ${enable_logging}
171         debug:                  ${enable_debug}
172         selinux:                ${with_selinux}
173
174         compiler:               ${CC}
175         cflags:                 ${CFLAGS}
176         ldflags:                ${LDFLAGS}
177
178         extras:                 ${enable_extras}
179         gintrospection:         ${enable_introspection}
180
181         usb.ids:                ${USB_DATABASE}
182         pci.ids:                ${PCI_DATABASE}
183         firmware path:          ${FIRMWARE_PATH}
184
185         xsltproc:               ${XSLTPROC}
186         gperf:                  ${GPERF}
187 ])