diff options
author | Lars Op den Kamp <lars@opdenkamp.eu> | 2011-08-29 15:04:49 +0200 |
---|---|---|
committer | Lars Op den Kamp <lars@opdenkamp.eu> | 2011-09-30 00:37:53 +0200 |
commit | 034236bf690119b2a82be1133ff328bccbdc4411 (patch) | |
tree | 73591daaadc6539cee5c71bab0325485096e79ec /configure.in | |
parent | 714ad40da8b2ead338aa8e57ef6a5b6802d8a2df (diff) |
Squashed original peripherals PR #383
This is a PR for a new "peripherals manager", /xbmc/peripherals, that detects devices and automatically configures them for use with XBMC. The device mappings and configurations can be defined in system/peripherals.xml. Users can modify settings via system->system->input->peripherals.
It works as follows:
- CPeripherals contains one or more CPeripheralBus instances.
- CPeripheralBus contains the device scanning implementations for the different platforms we support.
- The implementations for the devices can be found in peripheral/devices and all devices inherit from CPeripheral.
- The devices that are detected are looked up in peripherals.xml, starting at the top of the file and going down. If no mapping was found for the device, an instance of one of the default classes will be created: CPeripheralHID, CPeripheralDisk or CPeripheralNIC.
- in peripherals.xml, devices can be matched by vendor id (vendor="xxxx"), product id (product="xxxx"), bus type (bus="xxxx"), device class (class="xxxx") or a combination of these values. The class that will be instantiated for that device is defined in mapTo="xxxx"
- the configuration for the device can be defined in peripherals.xml as well. Have a look at system/peripherals.xml, where you can find the possible settings in the demo entry at the bottom. When a device is inserted and there are any settings with configurable="true" present for that device, these settings will be added to the settings dialog, under system->system->input->peripherals.
- an example of how these settings can be used can be found in CPeripheralHID, which checks for a "keymap" setting and will automatically switch the keymap XBMC uses to the one that is defined in the setting.
TODO:
- keep separate configs when the same device is found more than once
- general review of this code.
Diffstat (limited to 'configure.in')
-rwxr-xr-x | configure.in | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/configure.in b/configure.in index 08ef959902..5f6fc78f3f 100755 --- a/configure.in +++ b/configure.in @@ -119,6 +119,10 @@ libplist_disabled="== AirPlay support disabled. ==" alsa_not_found="== Could not find ALSA. ALSA support disabled. ==" dbus_not_found="== Could not find DBUS. DBUS support disabled. ==" +udev_not_found="== Could not find libudev. Will use polling to check for device changes. ==" +udev_disabled="== udev support disabled. Will use polling to check for device changes. ==" +libusb_not_found="== Could not find libusb. Plug and play USB device support will not be available. ==" +libusb_disabled="== libusb disabled. Plug and play USB device support will not be available. ==" # External library message strings external_libraries_enabled="== Use of all supported external libraries enabled. ==" @@ -378,6 +382,18 @@ AC_ARG_WITH([lirc-device], [lirc_device=/dev/lircd]) AC_DEFINE_UNQUOTED([LIRC_DEVICE], ["$lirc_device"], [Default LIRC device]) +AC_ARG_ENABLE([udev], + [AS_HELP_STRING([--enable-udev], + [enable udev support (default is yes)])], + [use_udev=$enableval], + [use_udev=yes]) + +AC_ARG_ENABLE([libusb], + [AS_HELP_STRING([--enable-libusb], + [enable libusb support (default is yes)])], + [use_libusb=$enableval], + [use_libusb=yes]) + ### External libraries options AC_ARG_ENABLE([external-libraries], [AS_HELP_STRING([--enable-external-libraries], @@ -1050,6 +1066,39 @@ if test "x$use_airtunes" != "xno"; then fi fi +# udev +if test "$host_vendor" = "apple" ; then + use_udev="no" + AC_MSG_NOTICE($udev_disabled) +else + if test "$use_udev" = "yes" ; then + PKG_CHECK_MODULES([UDEV], [libudev], + [INCLUDES="$INCLUDES $UDEV_CFLAGS"; LIBS="$LIBS $UDEV_LIBS"]; \ + AC_DEFINE([HAVE_LIBUDEV],[1],["Define to 1 if libudev is installed"]), + use_udev="no";AC_MSG_ERROR($udev_not_found)) + else + AC_MSG_NOTICE($udev_disabled) + fi +fi + +# libusb +if test "$host_vendor" = "apple" ; then + use_libusb="no" + HAVE_LIBUSB=0 + AC_MSG_NOTICE($libusb_disabled) +else + if test "$use_libusb" = "yes" ; then + PKG_CHECK_MODULES([USB], [libusb], + [INCLUDES="$INCLUDES $USB_CFLAGS"; LIBS="$LIBS $USB_LIBS"; HAVE_LIBUSB=1]; \ + AC_DEFINE([HAVE_LIBUSB],[1],["Define to 1 if libusb is installed"]), + use_libusb="no"; HAVE_LIBUSB=0; AC_MSG_ERROR($libusb_not_found)) + else + use_libusb="no" + HAVE_LIBUSB=0 + AC_MSG_NOTICE($libusb_disabled) + fi +fi + ### External libraries checks # External FFmpeg if test "$use_external_ffmpeg" = "yes"; then @@ -1729,7 +1778,8 @@ OUTPUT_FILES="Makefile \ tools/Linux/xbmc.sh \ tools/Linux/xbmc-standalone.sh \ tools/TexturePacker/Makefile \ - tools/EventClients/Clients/OSXRemote/Makefile" + tools/EventClients/Clients/OSXRemote/Makefile \ + xbmc/peripherals/bus/Makefile" # Line below is used so we can use AM_INIT_AUTOMAKE. The corresponding # .dummy.am does nothing. @@ -1781,6 +1831,7 @@ AC_SUBST(USE_TEXTUREPACKER) AC_SUBST(USE_TEXTUREPACKER_NATIVE) AC_SUBST(USE_TEXTUREPACKER_NATIVE_ROOT) AC_SUBST(USE_AIRTUNES) +AC_SUBST(HAVE_LIBUSB) # pushd and popd are not available in other shells besides bash, so implement # our own pushd/popd functions |