]> git.ipfire.org Git - thirdparty/systemd.git/blame - configure.ac
configure: allow to enable/disable extras individually
[thirdparty/systemd.git] / configure.ac
CommitLineData
a138cd07 1AC_INIT([udev], [168], [linux-hotplug@vger.kernel.org])
01618658 2AC_PREREQ(2.60)
b4110275 3AM_INIT_AUTOMAKE([check-news foreign 1.10 dist-bzip2 subdir-objects])
a6c06e57 4m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
01618658 5AC_DISABLE_STATIC
45a1dbba 6AC_USE_SYSTEM_EXTENSIONS
01618658 7AC_SYS_LARGEFILE
03733b04 8AC_CONFIG_MACRO_DIR([m4])
09b9a97e 9LT_INIT
2417dc20 10AC_PROG_AWK
26812f0a 11GTK_DOC_CHECK(1.10)
109d1145 12AC_PREFIX_DEFAULT([/usr])
01618658
KS
13AC_PATH_PROG([XSLTPROC], [xsltproc])
14
9c6a11b1
KS
15AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([POSIX RT library not found])])
16
6133f343
KS
17AC_ARG_WITH([rootlibdir],
18 AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
19 [], [with_rootlibdir=$libdir])
182c9b15 20AC_SUBST([rootlib_execdir], [$with_rootlibdir])
01618658 21
6133f343 22AC_ARG_WITH([selinux],
045a3bc8 23 AS_HELP_STRING([--with-selinux], [enable SELinux support]),
6133f343 24 [], [with_selinux=no])
01618658
KS
25if 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
b6626d09 31 SELINUX_LIBS="-lselinux -lsepol"
045a3bc8 32 AC_DEFINE(WITH_SELINUX, [1] ,[SELinux support.])
01618658
KS
33fi
34AC_SUBST([SELINUX_LIBS])
045a3bc8 35AM_CONDITIONAL(WITH_SELINUX, [test "x$with_selinux" = xyes])
01618658 36
6133f343 37AC_ARG_ENABLE([debug],
045a3bc8 38 AS_HELP_STRING([--enable-debug], [enable debug messages]),
6133f343 39 [], [enable_debug=no])
01618658 40if test "x$enable_debug" = "xyes"; then
045a3bc8 41 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
01618658 42fi
01618658 43
6133f343 44AC_ARG_ENABLE([logging],
045a3bc8 45 AS_HELP_STRING([--disable-logging], [disable system logging]),
01618658 46 [], enable_logging=yes)
045a3bc8
KS
47if test "x$enable_logging" = "xyes"; then
48 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
01618658
KS
49fi
50
0c6a3f48
RW
51AC_ARG_WITH(firmware-path,
52 AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
53 [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]),
08b4c883 54 [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"])
0c6a3f48
RW
55OLD_IFS=$IFS
56IFS=:
d5d6a7f3 57for i in $with_firmware_path; do
0c6a3f48
RW
58 if test "x${FIRMWARE_PATH}" = "x"; then
59 FIRMWARE_PATH="\\\"${i}/\\\""
60 else
61 FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
62 fi
63done
64IFS=$OLD_IFS
65AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH])
66
08b4c883
KS
67AC_ARG_WITH([systemdsystemunitdir],
68 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
69 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
620343dd 70if test "x$with_systemdsystemunitdir" != xno; then
d5d6a7f3 71 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
620343dd
MF
72fi
73AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
08b4c883 74
d5d6a7f3
KS
75# ------------------------------------------------------------------------------
76# rule_generator - persistent network and optical device rule generator
77# ------------------------------------------------------------------------------
78AC_ARG_ENABLE([hwdb],
79 AS_HELP_STRING([--disable-rule_generator], [disable persistent network, cdrom support]),
80 [], [enable_rule_generator=yes])
81AM_CONDITIONAL([ENABLE_RULE_GENERATOR], [test "x$enable_rule_genarator" = xyes])
ccba91c7 82
d5d6a7f3
KS
83# ------------------------------------------------------------------------------
84# usb/pci-db - read vendor/device string database
85# ------------------------------------------------------------------------------
86AC_ARG_ENABLE([hwdb],
87 AS_HELP_STRING([--disable-hwdb], [disable hardware database support]),
88 [], [enable_hwdb=yes])
89if test "x$enable_hwdb" = xyes; then
76e6bc28
PB
90 if test "x$cross_compiling" = "xno" ; then
91 AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
92 AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
93 AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
94 fi
d5d6a7f3
KS
95
96 PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
97 AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
98
ccba91c7 99 AC_ARG_WITH(pci-ids-path,
76e6bc28 100 [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
ccba91c7
LP
101 [PCI_DATABASE=${withval}],
102 [if test -n "$pciids" ; then
103 PCI_DATABASE="$pciids"
104 else
105 AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
106 fi])
76e6bc28
PB
107 AC_MSG_CHECKING([for PCI database location])
108 AC_MSG_RESULT([$PCI_DATABASE])
ccba91c7 109 AC_SUBST(PCI_DATABASE)
d5d6a7f3
KS
110fi
111AM_CONDITIONAL([ENABLE_HWDB], [test "x$enable_hwdb" = xyes])
d8f33f02 112
d5d6a7f3
KS
113# ------------------------------------------------------------------------------
114# udev_acl - apply ACLs for users with local forground sessions
115# ------------------------------------------------------------------------------
116AC_ARG_ENABLE([udev_acl],
117 AS_HELP_STRING([--disable-udev_acl], [disable local user acl permissions support]),
118 [], [enable_udev_acl=yes])
119if test "x$enable_udev_acl" = xyes; then
120 AC_CHECK_LIB([acl], [acl_init], [:], AC_MSG_ERROR([libacl not found]))
121 AC_CHECK_HEADER([acl/libacl.h], [:], AC_MSG_ERROR([libacl header not found]))
122
123 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0])
124 AC_SUBST([GLIB_CFLAGS])
125 AC_SUBST([GLIB_LIBS])
af23b83e 126fi
d5d6a7f3
KS
127AM_CONDITIONAL([ENABLE_UDEV_ACL], [test "x$enable_udev_acl" = xyes])
128
129# ------------------------------------------------------------------------------
130# GUdev - libudev gobject interface
131# ------------------------------------------------------------------------------
132AC_ARG_ENABLE([gudev],
133 AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support]),
134 [], [enable_gudev=yes])
135if test "x$enable_gudev" = xyes; then
136 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0])
137 AC_SUBST([GLIB_CFLAGS])
138 AC_SUBST([GLIB_LIBS])
af23b83e 139
bf05675a 140 PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2])
bf05675a
DZ
141 AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
142 AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
143 AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)])
4e45e1ad 144 AC_SUBST([GIRDIR], [$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)])
882bcd95 145 AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)])
bf05675a 146fi
d5d6a7f3
KS
147AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = xyes])
148
149# ------------------------------------------------------------------------------
150# keymap - map custom hardware's multimedia keys
151# ------------------------------------------------------------------------------
152AC_ARG_ENABLE([keymap],
153 AS_HELP_STRING([--disable-keymap], [disable keymap fixup support]),
154 [], [enable_keymap=yes])
155if test "x$enable_keymap" = xyes; then
156 AC_PATH_PROG([GPERF], [gperf])
157 if test -z "$GPERF"; then
158 AC_MSG_ERROR([gperf is needed])
159 fi
160
161 AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found]))
162 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}')])
163fi
164AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = xyes])
165
166# ------------------------------------------------------------------------------
167# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...)
168# ------------------------------------------------------------------------------
169AC_ARG_ENABLE([floppy],
170 AS_HELP_STRING([--enable-floppy], [enable legacy floppy support]),
171 [], [enable_floppy=no])
172AM_CONDITIONAL([ENABLE_FLOPPY], [test "x$enable_floppy" = xyes])
173
174# ------------------------------------------------------------------------------
175# edd_id - create /dev/disk/by-id/edd-* links for BIOS EDD data
176# ------------------------------------------------------------------------------
177AC_ARG_ENABLE([edd],
178 AS_HELP_STRING([--enable-edd], [enable disk edd support]),
179 [], [enable_edd=no])
180AM_CONDITIONAL([ENABLE_EDD], [test "x$enable_edd" = xyes])
181
182# ------------------------------------------------------------------------------
183# Bluetooth HID devices with special magic to switch the device
184# ------------------------------------------------------------------------------
185AC_ARG_ENABLE([hid2hci],
186 AS_HELP_STRING([--enable-hid2hci], [enable bluetooth hid to hci switch]),
187 [], [enable_hid2hci=no])
188if test "x$enable_hid2hci" = xyes; then
189 PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12)
190 AC_SUBST(LIBUSB_CFLAGS)
191 AC_SUBST(LIBUSB_LIBS)
192fi
193AM_CONDITIONAL([ENABLE_HID2HCI], [test "x$enable_hid2hci" = xyes])
194
195# ------------------------------------------------------------------------------
196# mobile-action-modeswitch - switch Mobile Action cables into serial mode
197# ------------------------------------------------------------------------------
198AC_ARG_ENABLE([ACTION_MODESWITCH],
199 AS_HELP_STRING([--enable-action_modeswitch], [enable action modeswitch support]),
200 [], [enable_action_modeswitch=no])
201if test "x$enable_action_modeswitch" = xyes; then
202 PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12)
203 AC_SUBST(LIBUSB_CFLAGS)
204 AC_SUBST(LIBUSB_LIBS)
205fi
206AM_CONDITIONAL([ENABLE_ACTION_MODESWITCH], [test "x$enable_action_modeswitch" = xyes])
bf05675a 207
01618658
KS
208AC_CONFIG_HEADERS(config.h)
209AC_CONFIG_FILES([
210 Makefile
08b4c883
KS
211 udev/udev.pc
212 init/udev.service
fc1de713 213 init/udev-trigger.service
08b4c883 214 init/udev-settle.service
48a9b173 215 libudev/libudev.pc
26812f0a
KS
216 libudev/docs/Makefile
217 libudev/docs/version.xml
bf05675a
DZ
218 extras/gudev/gudev-1.0.pc
219 extras/gudev/docs/Makefile
220 extras/gudev/docs/version.xml
01618658 221])
01618658 222
cb0237d7
KS
223AC_OUTPUT
224AC_MSG_RESULT([
01618658
KS
225 udev $VERSION
226 ========
227
228 prefix: ${prefix}
6133f343
KS
229 sysconfdir: ${sysconfdir}
230 sbindir: ${sbindir}
bf05675a 231 libdir: ${libdir}
182c9b15 232 rootlibdir: ${rootlib_execdir}
6133f343
KS
233 libexecdir: ${libexecdir}
234
01618658
KS
235 datarootdir: ${datarootdir}
236 mandir: ${mandir}
237 includedir: ${includedir}
238
d8f33f02
KS
239 include_prefix: ${INCLUDE_PREFIX}
240
08b4c883
KS
241 systemdsystemunitdir: ${systemdsystemunitdir}
242
01618658
KS
243 logging: ${enable_logging}
244 debug: ${enable_debug}
245 selinux: ${with_selinux}
246
247 compiler: ${CC}
248 cflags: ${CFLAGS}
249 ldflags: ${LDFLAGS}
250
d5d6a7f3
KS
251 rule_generator: ${enable_rule_generator}
252 hwdb: ${enable_hwdb}
253 udev_acl: ${enable_udev_acl}
254 gudev: ${enable_gudev}
255 keymap: ${enable_keymap}
256 floppy: ${enable_floppy}
257 edd: ${enable_edd}
258 hid2hci: ${enable_hid2hci}
259 action_modeswitch: ${enable_action_modeswitch}
af23b83e 260
ccba91c7
LP
261 usb.ids: ${USB_DATABASE}
262 pci.ids: ${PCI_DATABASE}
4101ce14 263 firmware path: ${FIRMWARE_PATH}
ccba91c7 264
01618658 265 xsltproc: ${XSLTPROC}
2417dc20 266 gperf: ${GPERF}
cb0237d7 267])