chiark / gitweb /
update TODO
[elogind.git] / configure.ac
1 AC_PREREQ(2.60)
2 AC_INIT([udev],
3        [181],
4        [linux-hotplug@vger.kernel.org],
5        [udev],
6        [http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html])
7 AC_CONFIG_SRCDIR([src/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 no-dist-gzip 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
21 AC_PATH_PROG([XSLTPROC], [xsltproc])
22 AM_CONDITIONAL(HAVE_XSLTPROC, test x"$XSLTPROC" != x)
23
24 AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([POSIX RT library not found])])
25
26 PKG_CHECK_MODULES(BLKID, blkid >= 2.20)
27
28 PKG_CHECK_MODULES(KMOD, libkmod >= 5)
29
30 AC_ARG_WITH([rootprefix],
31        AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
32        [], [with_rootprefix=${ac_default_prefix}])
33 AC_SUBST([rootprefix], [$with_rootprefix])
34
35 AC_ARG_WITH([rootlibdir],
36        AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
37        [], [with_rootlibdir=$libdir])
38 AC_SUBST([rootlib_execdir], [$with_rootlibdir])
39
40 AC_ARG_WITH([selinux],
41        AS_HELP_STRING([--with-selinux], [enable SELinux support]),
42        [], [with_selinux=no])
43 AS_IF([test "x$with_selinux" = "xyes"], [
44        LIBS_save=$LIBS
45        AC_CHECK_LIB(selinux, getprevcon,
46               [],
47               AC_MSG_ERROR([SELinux selected but libselinux not found]))
48        LIBS=$LIBS_save
49        SELINUX_LIBS="-lselinux -lsepol"
50        AC_DEFINE(WITH_SELINUX, [1] ,[SELinux support.])
51 ])
52 AC_SUBST([SELINUX_LIBS])
53 AM_CONDITIONAL(WITH_SELINUX, [test "x$with_selinux" = "xyes"])
54
55 AC_ARG_ENABLE([debug],
56        AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
57        [], [enable_debug=no])
58 AS_IF([test "x$enable_debug" = "xyes"], [ AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) ])
59
60 AC_ARG_ENABLE([logging],
61        AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
62        [], enable_logging=yes)
63 AS_IF([test "x$enable_logging" = "xyes"], [ AC_DEFINE(ENABLE_LOGGING, [1], [System logging.]) ])
64
65 AC_ARG_ENABLE([manpages],
66         AS_HELP_STRING([--disable-manpages], [disable man pages @<:@default=enabled@:>@]),
67         [], enable_manpages=yes)
68 AM_CONDITIONAL([ENABLE_MANPAGES], [test "x$enable_manpages" = "xyes"])
69
70 if test "x$cross_compiling" = "xno" ; then
71        AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
72        AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
73        AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
74 fi
75
76 AC_ARG_WITH(usb-ids-path,
77        [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
78        [USB_DATABASE=${withval}],
79        [if test -n "$usbids" ; then
80               USB_DATABASE="$usbids"
81        else
82               PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
83               AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
84        fi])
85 AC_MSG_CHECKING([for USB database location])
86 AC_MSG_RESULT([$USB_DATABASE])
87 AC_SUBST(USB_DATABASE)
88
89 AC_ARG_WITH(pci-ids-path,
90        [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
91        [PCI_DATABASE=${withval}],
92        [if test -n "$pciids" ; then
93               PCI_DATABASE="$pciids"
94        else
95               AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
96        fi])
97 AC_MSG_CHECKING([for PCI database location])
98 AC_MSG_RESULT([$PCI_DATABASE])
99 AC_SUBST(PCI_DATABASE)
100
101 AC_ARG_WITH(firmware-path,
102        AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
103           [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]),
104        [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
105 OLD_IFS=$IFS
106 IFS=:
107 for i in $with_firmware_path; do
108        if test "x${FIRMWARE_PATH}" = "x"; then
109               FIRMWARE_PATH="\\\"${i}/\\\""
110        else
111               FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
112        fi
113 done
114 IFS=$OLD_IFS
115 AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH])
116
117 AC_ARG_WITH([systemdsystemunitdir],
118        AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
119        [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
120 AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) ])
121 AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != "xno" ])
122
123 # ------------------------------------------------------------------------------
124 # GUdev - libudev gobject interface
125 # ------------------------------------------------------------------------------
126 AC_ARG_ENABLE([gudev],
127        AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
128        [], [enable_gudev=yes])
129 AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ])
130
131 AC_ARG_ENABLE([introspection],
132        AS_HELP_STRING([--disable-introspection], [disable GObject introspection @<:@default=enabled@:>@]),
133        [], [enable_introspection=yes])
134 AS_IF([test "x$enable_introspection" = "xyes"], [
135        PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
136        AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support])
137        AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
138        AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
139        AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
140        AC_SUBST([GIRDIR], [$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)])
141        AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)])
142 ])
143 AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
144 AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
145
146 # ------------------------------------------------------------------------------
147 # keymap - map custom hardware's multimedia keys
148 # ------------------------------------------------------------------------------
149 AC_ARG_ENABLE([keymap],
150        AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]),
151        [], [enable_keymap=yes])
152 AS_IF([test "x$enable_keymap" = "xyes"], [
153        AC_PATH_PROG([GPERF], [gperf])
154        if test -z "$GPERF"; then
155               AC_MSG_ERROR([gperf is needed])
156        fi
157
158        AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
159        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}')])
160 ])
161 AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = "xyes"])
162
163 # ------------------------------------------------------------------------------
164 # mtd_probe - autoloads FTL module for mtd devices
165 # ------------------------------------------------------------------------------
166 AC_ARG_ENABLE([mtd_probe],
167        AS_HELP_STRING([--disable-mtd_probe], [disable MTD support @<:@default=enabled@:>@]),
168        [], [enable_mtd_probe=yes])
169 AM_CONDITIONAL([ENABLE_MTD_PROBE], [test "x$enable_mtd_probe" = "xyes"])
170
171 # ------------------------------------------------------------------------------
172 # rule_generator - persistent network and optical device rule generator
173 # ------------------------------------------------------------------------------
174 AC_ARG_ENABLE([rule_generator],
175        AS_HELP_STRING([--enable-rule_generator], [enable persistent network + cdrom links support @<:@default=disabled@:>@]),
176        [], [enable_rule_generator=no])
177 AM_CONDITIONAL([ENABLE_RULE_GENERATOR], [test "x$enable_rule_generator" = "xyes"])
178
179 # ------------------------------------------------------------------------------
180 # create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
181 # ------------------------------------------------------------------------------
182 AC_ARG_ENABLE([floppy],
183        AS_HELP_STRING([--enable-floppy], [enable legacy floppy support @<:@default=disabled@:>@]),
184        [], [enable_floppy=no])
185 AM_CONDITIONAL([ENABLE_FLOPPY], [test "x$enable_floppy" = "xyes"])
186
187 my_CFLAGS="-Wall \
188 -Wmissing-declarations -Wmissing-prototypes \
189 -Wnested-externs -Wpointer-arith \
190 -Wpointer-arith -Wsign-compare -Wchar-subscripts \
191 -Wstrict-prototypes -Wshadow \
192 -Wformat-security -Wtype-limits"
193 AC_SUBST([my_CFLAGS])
194
195 AC_CONFIG_HEADERS(config.h)
196 AC_CONFIG_FILES([
197        Makefile
198        src/docs/Makefile
199        src/docs/version.xml
200        src/gudev/docs/Makefile
201        src/gudev/docs/version.xml
202 ])
203
204 AC_OUTPUT
205 AC_MSG_RESULT([
206         $PACKAGE $VERSION
207         ========
208
209         prefix:                  ${prefix}
210         rootprefix:              ${rootprefix}
211         sysconfdir:              ${sysconfdir}
212         bindir:                  ${bindir}
213         libdir:                  ${libdir}
214         rootlibdir:              ${rootlib_execdir}
215         libexecdir:              ${libexecdir}
216         datarootdir:             ${datarootdir}
217         mandir:                  ${mandir}
218         includedir:              ${includedir}
219         include_prefix:          ${INCLUDE_PREFIX}
220         systemdsystemunitdir:    ${systemdsystemunitdir}
221         firmware path:           ${FIRMWARE_PATH}
222         usb.ids:                 ${USB_DATABASE}
223         pci.ids:                 ${PCI_DATABASE}
224
225         compiler:                ${CC}
226         cflags:                  ${CFLAGS}
227         ldflags:                 ${LDFLAGS}
228         xsltproc:                ${XSLTPROC}
229         gperf:                   ${GPERF}
230
231         logging:                 ${enable_logging}
232         debug:                   ${enable_debug}
233         selinux:                 ${with_selinux}
234
235         man pages                ${enable_manpages}
236         gudev:                   ${enable_gudev}
237         gintrospection:          ${enable_introspection}
238         keymap:                  ${enable_keymap}
239         mtd_probe:               ${enable_mtd_probe}
240         rule_generator:          ${enable_rule_generator}
241         floppy:                  ${enable_floppy}
242 ])