diff options
-rw-r--r-- | INSTALL | 28 | ||||
-rw-r--r-- | Makefile.am | 220 | ||||
-rw-r--r-- | README | 7 | ||||
-rw-r--r-- | configure.ac | 152 |
4 files changed, 251 insertions, 156 deletions
@@ -27,9 +27,24 @@ All options: --with-selinux Link against SELinux libraries to set the expected context for created files. - --disable-extras - Disable the build of all extras which have larger external - dependencies like glib, libacl, libusb, ... + --disable-rule_generator + Disable persistent network, cdrom naming support. + --disable-hwdb + Disable hardware database support + --disable-udev_acl + Disable local user acl permissions support. + --disable-gudev + Disable Gobject libudev support. + --disable-keymap + Disable keymap fixup support. + --enable-floppy + Enable legacy floppy support. + --enable-edd + Enable disk edd support. + --enable-hid2hci + Enable bluetooth hid to hci switch. + --enable-action_modeswitch + Enable action modeswitch support. The options used in a RPM spec file usually look like: %configure \ @@ -47,13 +62,12 @@ other location will break other packages, who rightfully expect the /lib/udev/ directory, to install their rule helper and udev rule files. -It is recommended to use the /lib/udev/devices/ directory to place +It is possible to use the /lib/udev/devices/ directory to place device nodes, directories and symlinks, which are copied to /dev/ at every bootup. That way, nodes for devices which can not be detected automatically, or are activated on-demand by opening the pre-existing device node, will be available. -Default udev rules and persistent device naming rules are required +Default udev rules and persistent device naming rules may be required by other software that depends on the data udev collects from the -devices, and should therefore be installed by default with every udev -installation. +devices. diff --git a/Makefile.am b/Makefile.am index 5beec94344..9db127038c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,11 +25,12 @@ DISTCHECK_CONFIGURE_FLAGS = \ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) CLEANFILES = - +BUILT_SOURCES = INSTALL_EXEC_HOOKS = INSTALL_DATA_HOOKS = UNINSTALL_EXEC_HOOKS = DISTCHECK_HOOKS = +dist_libexec_SCRIPTS = # ------------------------------------------------------------------------------ # libudev @@ -212,20 +213,6 @@ udev_test_udev_SOURCES = \ udev_test_udev_LDADD = libudev/libudev-private.la # ------------------------------------------------------------------------------ -# rule_generator - persistent network and optical device rule generator -# ------------------------------------------------------------------------------ -dist_libexec_SCRIPTS = \ - extras/rule_generator/write_cd_rules \ - extras/rule_generator/write_net_rules - -udevhomedir = $(libexecdir) -dist_udevhome_DATA = extras/rule_generator/rule_generator.functions - -dist_udevrules_DATA += \ - extras/rule_generator/75-cd-aliases-generator.rules \ - extras/rule_generator/75-persistent-net-generator.rules - -# ------------------------------------------------------------------------------ # firmware - firmware loading # ------------------------------------------------------------------------------ extras_firmware_firmware_SOURCES = extras/firmware/firmware.c @@ -257,22 +244,6 @@ extras_collect_collect_LDADD = libudev/libudev-private.la libexec_PROGRAMS += extras/collect/collect # ------------------------------------------------------------------------------ -# edd_id - BIOS EDD block device match -# ------------------------------------------------------------------------------ -extras_edd_id_edd_id_SOURCES = extras/edd_id/edd_id.c -extras_edd_id_edd_id_LDADD = libudev/libudev-private.la -libexec_PROGRAMS += extras/edd_id/edd_id -dist_udevrules_DATA += extras/edd_id/61-persistent-storage-edd.rules - -# ------------------------------------------------------------------------------ -# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...) -# ------------------------------------------------------------------------------ -extras_floppy_create_floppy_devices_SOURCES = extras/floppy/create_floppy_devices.c -extras_floppy_create_floppy_devices_LDADD = libudev/libudev-private.la -libexec_PROGRAMS += extras/floppy/create_floppy_devices -dist_udevrules_DATA += extras/floppy/60-floppy.rules - -# ------------------------------------------------------------------------------ # input_id - import input device class # ------------------------------------------------------------------------------ extras_input_id_input_id_SOURCES = extras/input_id/input_id.c @@ -314,19 +285,74 @@ libexec_PROGRAMS += extras/v4l_id/v4l_id dist_udevrules_DATA += extras/v4l_id/60-persistent-v4l.rules # ------------------------------------------------------------------------------ +# mtd_probe - autoloads FTL module for mtd devices +# ------------------------------------------------------------------------------ +extras_mtd_probe_mtd_probe_SOURCES = \ + extras/mtd_probe/mtd_probe.c \ + extras/mtd_probe/mtd_probe.h \ + extras/mtd_probe/probe_smartmedia.c +extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS) +dist_udevrules_DATA += extras/mtd_probe/75-probe_mtd.rules +libexec_PROGRAMS += extras/mtd_probe/mtd_probe + +# ------------------------------------------------------------------------------ # qemu -- qemu/kvm guest tweaks # ------------------------------------------------------------------------------ dist_udevrules_DATA += extras/qemu/42-qemu-usb.rules -if ENABLE_EXTRAS +if ENABLE_RULE_GENERATOR # ------------------------------------------------------------------------------ -# conditional extras (need glib, libusb, libacl, ...) +# rule_generator - persistent network and optical device rule generator # ------------------------------------------------------------------------------ +dist_libexec_SCRIPTS += \ + extras/rule_generator/write_cd_rules \ + extras/rule_generator/write_net_rules + +udevhomedir = $(libexecdir) +dist_udevhome_DATA = extras/rule_generator/rule_generator.functions + +dist_udevrules_DATA += \ + extras/rule_generator/75-cd-aliases-generator.rules \ + extras/rule_generator/75-persistent-net-generator.rules +endif + +if ENABLE_HWDB +# ------------------------------------------------------------------------------ +# usb/pci-db - read vendor/device string database +# ------------------------------------------------------------------------------ +extras_usb_db_usb_db_SOURCES = extras/usb-db/usb-db.c +extras_usb_db_usb_db_CPPFLAGS = $(AM_CPPFLAGS) -DUSB_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_USB +extras_usb_db_usb_db_LDADD = libudev/libudev-private.la +libexec_PROGRAMS += extras/usb-db/usb-db dist_udevrules_DATA += \ rules/rules.d/75-net-description.rules \ rules/rules.d/75-tty-description.rules \ rules/rules.d/78-sound-card.rules +extras_usb_db_pci_db_SOURCES = extras/usb-db/usb-db.c +extras_usb_db_pci_db_CPPFLAGS = $(AM_CPPFLAGS) -DPCI_DATABASE=\"$(PCI_DATABASE)\" -DBUILD_FOR_PCI +extras_usb_db_pci_db_LDADD = libudev/libudev-private.la +libexec_PROGRAMS += extras/usb-db/pci-db +endif + +if ENABLE_UDEV_ACL +# ------------------------------------------------------------------------------ +# udev_acl - apply ACLs for users with local forground sessions +# ------------------------------------------------------------------------------ +extras_udev_acl_udev_acl_SOURCES = extras/udev-acl/udev-acl.c +extras_udev_acl_udev_acl_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) +extras_udev_acl_udev_acl_LDADD = libudev/libudev-private.la -lacl $(GLIB_LIBS) +dist_udevrules_DATA += extras/udev-acl/70-acl.rules +libexec_PROGRAMS += extras/udev-acl/udev-acl + +udevacl-install-hook: + mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d + ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck + +INSTALL_EXEC_HOOKS += udevacl-install-hook +endif + +if ENABLE_GUDEV # ------------------------------------------------------------------------------ # GUdev - libudev gobject interface # ------------------------------------------------------------------------------ @@ -367,7 +393,7 @@ dist_extras_gudev_libgudev_1_0_la_SOURCES = \ extras/gudev/gudevmarshal.c \ extras/gudev/gudevenumtypes.h \ extras/gudev/gudevenumtypes.c -BUILT_SOURCES = $(dist_extras_gudev_libgudev_1_0_la_SOURCES) +BUILT_SOURCES += $(dist_extras_gudev_libgudev_1_0_la_SOURCES) extras_gudev_libgudev_1_0_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ @@ -407,7 +433,6 @@ extras/gudev/gudevenumtypes.c: extras/gudev/gudevenumtypes.c.template extras/gud $(AM_V_GEN)glib-mkenums --template $^ > \ $@.tmp && mv $@.tmp $@ -if ENABLE_INTROSPECTION extras/gudev/GUdev-1.0.gir: extras/gudev/libgudev-1.0.la $(G_IR_SCANNER) Makefile.am $(AM_V_GEN)PKG_CONFIG_PATH=$(top_builddir)/data:$$PKG_CONFIG_PATH \ LD_LIBRARY_PATH=$(top_builddir)/extras/gudev:$$LD_LIBRARY_PATH \ @@ -445,7 +470,6 @@ typelibsdir = $(GIRTYPELIBDIR) typelibs_DATA = extras/gudev/GUdev-1.0.typelib CLEANFILES += $(gir_DATA) $(typelibs_DATA) -endif # ENABLE_INTROSPECTION # move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed libgudev-install-move-hook: @@ -462,79 +486,9 @@ libgudev-uninstall-move-hook: INSTALL_EXEC_HOOKS += libgudev-install-move-hook UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook +endif -# ------------------------------------------------------------------------------ -# Bluetooth HID devices with special magic to switch the device -# ------------------------------------------------------------------------------ -extras_hid2hci_hid2hci_SOURCES = extras/hid2hci/hid2hci.c -extras_hid2hci_hid2hci_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS) -extras_hid2hci_hid2hci_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS) -dist_udevrules_DATA += extras/hid2hci/70-hid2hci.rules -libexec_PROGRAMS += extras/hid2hci/hid2hci - -# ------------------------------------------------------------------------------ -# udev_acl - apply ACLs for users with local forground sessions -# ------------------------------------------------------------------------------ -extras_udev_acl_udev_acl_SOURCES = extras/udev-acl/udev-acl.c -extras_udev_acl_udev_acl_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) -extras_udev_acl_udev_acl_LDADD = libudev/libudev-private.la -lacl $(GLIB_LIBS) -dist_udevrules_DATA += extras/udev-acl/70-acl.rules -libexec_PROGRAMS += extras/udev-acl/udev-acl - -udevacl-install-hook: - mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d - ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck - -INSTALL_EXEC_HOOKS += udevacl-install-hook - -# ------------------------------------------------------------------------------ -# usb-db - read USB vendor/device string database -# ------------------------------------------------------------------------------ -extras_usb_db_usb_db_SOURCES = extras/usb-db/usb-db.c -extras_usb_db_usb_db_CPPFLAGS = $(AM_CPPFLAGS) -DUSB_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_USB -extras_usb_db_usb_db_LDADD = libudev/libudev-private.la -libexec_PROGRAMS += extras/usb-db/usb-db - -# ------------------------------------------------------------------------------ -# pci-db - read PCI vendor/device string database -# ------------------------------------------------------------------------------ -extras_usb_db_pci_db_SOURCES = extras/usb-db/usb-db.c -extras_usb_db_pci_db_CPPFLAGS = $(AM_CPPFLAGS) -DPCI_DATABASE=\"$(PCI_DATABASE)\" -DBUILD_FOR_PCI -extras_usb_db_pci_db_LDADD = libudev/libudev-private.la -libexec_PROGRAMS += extras/usb-db/pci-db - -# ------------------------------------------------------------------------------ -# mobile-action-modeswitch - switch Mobile Action cables into serial mode -# ------------------------------------------------------------------------------ -extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES =\ - extras/mobile-action-modeswitch/mobile-action-modeswitch.c \ - extras/mobile-action-modeswitch/utils.c \ - extras/mobile-action-modeswitch/utils.h \ - extras/mobile-action-modeswitch/ma8280p_us.c \ - extras/mobile-action-modeswitch/ma8280p_us.h -extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS) -extras_mobile_action_modeswitch_mobile_action_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS) - -dist_udevrules_DATA += \ - extras/mobile-action-modeswitch/61-mobile-action.rules - -libexec_PROGRAMS += extras/mobile-action-modeswitch/mobile-action-modeswitch - -# ------------------------------------------------------------------------------ -# mtd_probe - autoloads FTL module for mtd devices -# ------------------------------------------------------------------------------ -extras_mtd_probe_mtd_probe_SOURCES = \ - extras/mtd_probe/mtd_probe.c \ - extras/mtd_probe/mtd_probe.h \ - extras/mtd_probe/probe_smartmedia.c - -extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS) - -dist_udevrules_DATA += extras/mtd_probe/75-probe_mtd.rules - -libexec_PROGRAMS += extras/mtd_probe/mtd_probe - - +if ENABLE_KEYMAP # ------------------------------------------------------------------------------ # keymap - map custom hardware's multimedia keys # ------------------------------------------------------------------------------ @@ -552,7 +506,6 @@ libexec_PROGRAMS += extras/keymap/keymap dist_libexec_SCRIPTS += extras/keymap/findkeyboards dist_libexec_SCRIPTS += extras/keymap/keyboard-force-release.sh dist_doc_DATA = extras/keymap/README.keymap.txt - CLEANFILES += \ extras/keymap/keys.txt \ extras/keymap/keys-from-name.gperf @@ -638,8 +591,55 @@ extras/keymap/keys-to-name.h: extras/keymap/keys.txt Makefile keymaps-distcheck-hook: extras/keymap/keys.txt $(top_srcdir)/extras/keymap/check-keymaps.sh $(top_srcdir) $^ DISTCHECK_HOOKS += keymaps-distcheck-hook +endif + +if ENABLE_FLOPPY +# ------------------------------------------------------------------------------ +# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...) +# ------------------------------------------------------------------------------ +extras_floppy_create_floppy_devices_SOURCES = extras/floppy/create_floppy_devices.c +extras_floppy_create_floppy_devices_LDADD = libudev/libudev-private.la +libexec_PROGRAMS += extras/floppy/create_floppy_devices +dist_udevrules_DATA += extras/floppy/60-floppy.rules +endif + +if ENABLE_EDD +# ------------------------------------------------------------------------------ +# edd_id - create /dev/disk/by-id/edd-* links for BIOS EDD data +# ------------------------------------------------------------------------------ +extras_edd_id_edd_id_SOURCES = extras/edd_id/edd_id.c +extras_edd_id_edd_id_LDADD = libudev/libudev-private.la +libexec_PROGRAMS += extras/edd_id/edd_id +dist_udevrules_DATA += extras/edd_id/61-persistent-storage-edd.rules +endif + +if ENABLE_HID2HCI +# ------------------------------------------------------------------------------ +# Bluetooth HID devices with special magic to switch the device +# ------------------------------------------------------------------------------ +extras_hid2hci_hid2hci_SOURCES = extras/hid2hci/hid2hci.c +extras_hid2hci_hid2hci_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS) +extras_hid2hci_hid2hci_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS) +dist_udevrules_DATA += extras/hid2hci/70-hid2hci.rules +libexec_PROGRAMS += extras/hid2hci/hid2hci +endif -endif # ENABLE_EXTRAS +if ENABLE_ACTION_MODESWITCH +# ------------------------------------------------------------------------------ +# mobile-action-modeswitch - switch Mobile Action cables into serial mode +# ------------------------------------------------------------------------------ +extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES =\ + extras/mobile-action-modeswitch/mobile-action-modeswitch.c \ + extras/mobile-action-modeswitch/utils.c \ + extras/mobile-action-modeswitch/utils.h \ + extras/mobile-action-modeswitch/ma8280p_us.c \ + extras/mobile-action-modeswitch/ma8280p_us.h +extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS) +extras_mobile_action_modeswitch_mobile_action_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS) +dist_udevrules_DATA += \ + extras/mobile-action-modeswitch/61-mobile-action.rules +libexec_PROGRAMS += extras/mobile-action-modeswitch/mobile-action-modeswitch +endif # ------------------------------------------------------------------------------ # install, uninstall, clean hooks @@ -51,9 +51,9 @@ Requirements: these group names with only the rootfs mounted and while no network is available. - - The 'udev extras' has the following dependencies: + - Some udev extras have external dependencies like: libacl, libglib2, libusb, usbutils, pciutils, and gperf. - These dependencies can be disabled with the --disable-extras configure option. + All these extras can be disabled with configure options. Setup: - At bootup, the /dev directory should get the 'devtmpfs' filesystem @@ -90,7 +90,8 @@ Operation: http://www.kernel.org/pub/linux/utils/kernel/hotplug/libudev/ http://www.kernel.org/pub/linux/utils/kernel/hotplug/gudev/ -For more details about udev and udev rules, see the udev(7) man page. +For more details about udev and udev rules, see the udev man pages: + http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/ Please direct any comment/question to the linux-hotplug mailing list at: linux-hotplug@vger.kernel.org diff --git a/configure.ac b/configure.ac index cb7585e58b..d5585b3c4a 100644 --- a/configure.ac +++ b/configure.ac @@ -54,8 +54,7 @@ AC_ARG_WITH(firmware-path, [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"]) OLD_IFS=$IFS IFS=: -for i in $with_firmware_path -do +for i in $with_firmware_path; do if test "x${FIRMWARE_PATH}" = "x"; then FIRMWARE_PATH="\\\"${i}/\\\"" else @@ -69,38 +68,34 @@ AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) if test "x$with_systemdsystemunitdir" != xno; then - AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) + AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) fi AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) -AC_ARG_ENABLE([extras], - AS_HELP_STRING([--disable-extras], [disable extras with external dependencies]), - [], [enable_extras=yes]) -if test "x$enable_extras" = xyes; then - AC_PATH_PROG([GPERF], [gperf]) - if test -z "$GPERF"; then - AC_MSG_ERROR([gperf is needed]) - fi - - PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) - AC_SUBST([GLIB_CFLAGS]) - AC_SUBST([GLIB_LIBS]) - - AC_CHECK_LIB([acl], [acl_init], [:], AC_MSG_ERROR([libacl not found])) - AC_CHECK_HEADER([acl/libacl.h], [:], AC_MSG_ERROR([libacl header not found])) - - PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12) - AC_SUBST(LIBUSB_CFLAGS) - AC_SUBST(LIBUSB_LIBS) - - PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82) - AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)]) +# ------------------------------------------------------------------------------ +# rule_generator - persistent network and optical device rule generator +# ------------------------------------------------------------------------------ +AC_ARG_ENABLE([hwdb], + AS_HELP_STRING([--disable-rule_generator], [disable persistent network, cdrom support]), + [], [enable_rule_generator=yes]) +AM_CONDITIONAL([ENABLE_RULE_GENERATOR], [test "x$enable_rule_genarator" = xyes]) +# ------------------------------------------------------------------------------ +# usb/pci-db - read vendor/device string database +# ------------------------------------------------------------------------------ +AC_ARG_ENABLE([hwdb], + AS_HELP_STRING([--disable-hwdb], [disable hardware database support]), + [], [enable_hwdb=yes]) +if test "x$enable_hwdb" = xyes; then if test "x$cross_compiling" = "xno" ; then AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids]) AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids]) AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids]) fi + + PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82) + AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)]) + AC_ARG_WITH(pci-ids-path, [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])], [PCI_DATABASE=${withval}], @@ -112,25 +107,103 @@ if test "x$enable_extras" = xyes; then AC_MSG_CHECKING([for PCI database location]) AC_MSG_RESULT([$PCI_DATABASE]) AC_SUBST(PCI_DATABASE) +fi +AM_CONDITIONAL([ENABLE_HWDB], [test "x$enable_hwdb" = xyes]) - AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found])) - 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}')]) +# ------------------------------------------------------------------------------ +# udev_acl - apply ACLs for users with local forground sessions +# ------------------------------------------------------------------------------ +AC_ARG_ENABLE([udev_acl], + AS_HELP_STRING([--disable-udev_acl], [disable local user acl permissions support]), + [], [enable_udev_acl=yes]) +if test "x$enable_udev_acl" = xyes; then + AC_CHECK_LIB([acl], [acl_init], [:], AC_MSG_ERROR([libacl not found])) + AC_CHECK_HEADER([acl/libacl.h], [:], AC_MSG_ERROR([libacl header not found])) + + PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) + AC_SUBST([GLIB_CFLAGS]) + AC_SUBST([GLIB_LIBS]) fi -AM_CONDITIONAL([ENABLE_EXTRAS], [test "x$enable_extras" = xyes]) +AM_CONDITIONAL([ENABLE_UDEV_ACL], [test "x$enable_udev_acl" = xyes]) + +# ------------------------------------------------------------------------------ +# GUdev - libudev gobject interface +# ------------------------------------------------------------------------------ +AC_ARG_ENABLE([gudev], + AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support]), + [], [enable_gudev=yes]) +if test "x$enable_gudev" = xyes; then + PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) + AC_SUBST([GLIB_CFLAGS]) + AC_SUBST([GLIB_LIBS]) -AC_ARG_ENABLE([introspection], - AS_HELP_STRING([--disable-introspection], [disable GObject introspection]), - [], [enable_introspection=yes]) -if test "x$enable_introspection" = xyes; then PKG_CHECK_MODULES([INTROSPECTION], [gobject-introspection-1.0 >= 0.6.2]) - AC_DEFINE([ENABLE_INTROSPECTION], [1], [enable GObject introspection support]) AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)]) AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)]) AC_SUBST([G_IR_GENERATE], [$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)]) AC_SUBST([GIRDIR], [$($PKG_CONFIG --define-variable=datadir=${datadir} --variable=girdir gobject-introspection-1.0)]) AC_SUBST([GIRTYPELIBDIR], [$($PKG_CONFIG --define-variable=libdir=${libdir} --variable=typelibdir gobject-introspection-1.0)]) fi -AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes]) +AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = xyes]) + +# ------------------------------------------------------------------------------ +# keymap - map custom hardware's multimedia keys +# ------------------------------------------------------------------------------ +AC_ARG_ENABLE([keymap], + AS_HELP_STRING([--disable-keymap], [disable keymap fixup support]), + [], [enable_keymap=yes]) +if test "x$enable_keymap" = xyes; then + AC_PATH_PROG([GPERF], [gperf]) + if test -z "$GPERF"; then + AC_MSG_ERROR([gperf is needed]) + fi + + AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found])) + 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}')]) +fi +AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = xyes]) + +# ------------------------------------------------------------------------------ +# create_floppy_devices - historical floppy kernel device nodes (/dev/fd0h1440, ...) +# ------------------------------------------------------------------------------ +AC_ARG_ENABLE([floppy], + AS_HELP_STRING([--enable-floppy], [enable legacy floppy support]), + [], [enable_floppy=no]) +AM_CONDITIONAL([ENABLE_FLOPPY], [test "x$enable_floppy" = xyes]) + +# ------------------------------------------------------------------------------ +# edd_id - create /dev/disk/by-id/edd-* links for BIOS EDD data +# ------------------------------------------------------------------------------ +AC_ARG_ENABLE([edd], + AS_HELP_STRING([--enable-edd], [enable disk edd support]), + [], [enable_edd=no]) +AM_CONDITIONAL([ENABLE_EDD], [test "x$enable_edd" = xyes]) + +# ------------------------------------------------------------------------------ +# Bluetooth HID devices with special magic to switch the device +# ------------------------------------------------------------------------------ +AC_ARG_ENABLE([hid2hci], + AS_HELP_STRING([--enable-hid2hci], [enable bluetooth hid to hci switch]), + [], [enable_hid2hci=no]) +if test "x$enable_hid2hci" = xyes; then + PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12) + AC_SUBST(LIBUSB_CFLAGS) + AC_SUBST(LIBUSB_LIBS) +fi +AM_CONDITIONAL([ENABLE_HID2HCI], [test "x$enable_hid2hci" = xyes]) + +# ------------------------------------------------------------------------------ +# mobile-action-modeswitch - switch Mobile Action cables into serial mode +# ------------------------------------------------------------------------------ +AC_ARG_ENABLE([ACTION_MODESWITCH], + AS_HELP_STRING([--enable-action_modeswitch], [enable action modeswitch support]), + [], [enable_action_modeswitch=no]) +if test "x$enable_action_modeswitch" = xyes; then + PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12) + AC_SUBST(LIBUSB_CFLAGS) + AC_SUBST(LIBUSB_LIBS) +fi +AM_CONDITIONAL([ENABLE_ACTION_MODESWITCH], [test "x$enable_action_modeswitch" = xyes]) AC_CONFIG_HEADERS(config.h) AC_CONFIG_FILES([ @@ -175,8 +248,15 @@ AC_MSG_RESULT([ cflags: ${CFLAGS} ldflags: ${LDFLAGS} - extras: ${enable_extras} - gintrospection: ${enable_introspection} + rule_generator: ${enable_rule_generator} + hwdb: ${enable_hwdb} + udev_acl: ${enable_udev_acl} + gudev: ${enable_gudev} + keymap: ${enable_keymap} + floppy: ${enable_floppy} + edd: ${enable_edd} + hid2hci: ${enable_hid2hci} + action_modeswitch: ${enable_action_modeswitch} usb.ids: ${USB_DATABASE} pci.ids: ${PCI_DATABASE} |