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