diff options
author | Nikias Bassen | 2018-09-17 18:11:47 +0200 |
---|---|---|
committer | Nikias Bassen | 2018-09-17 18:11:47 +0200 |
commit | 4daf6d84f7271cc19256c45b52c63b99ba7b4391 (patch) | |
tree | 9329f344b20d753ee5b43bda609b6db51a2d6530 /configure.ac | |
parent | 85d352a6bd4c4d3fef26bc1bec289254939950f9 (diff) | |
download | libirecovery-4daf6d84f7271cc19256c45b52c63b99ba7b4391.tar.gz libirecovery-4daf6d84f7271cc19256c45b52c63b99ba7b4391.tar.bz2 |
Add configuration option to allow compiling without USB driver
Using --with-dummy, libirecovery can be compiled in a way that it will
not require any USB driver at all. This is only useful if you just want
to query libirecovery's device database by product type or hardware model,
namely using:
irecv_devices_get_device_by_product_type();
irecv_devices_get_device_by_hardware_model();
All other function are either no-op or return IRECV_E_UNSUPPORTED
if the library is compiled this way.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index e13c571..1f10bb7 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,11 @@ case "$host_os" in esac AC_SUBST(LIBIRECOVERYLDFLAGS) +AC_ARG_WITH([dummy], + [AS_HELP_STRING([--with-dummy], [Use no USB driver at all [default=no]. This is only useful if you just want to query the device list by product type or hardware model. All other operations are no-ops or will return IRECV_E_UNSUPPORTED.])], + [], + [with_dummy=no]) + AS_IF([test "x$have_iokit" = "xyes"], [ AC_ARG_WITH([iokit], [AS_HELP_STRING([--with-iokit], [Use IOKit instead of libusb on OS X [default=yes]])], @@ -67,17 +72,22 @@ AS_IF([test "x$have_iokit" = "xyes"], [ ], [] ) -AS_IF([test "x$with_iokit" = "xyes" && test "x$have_iokit" = "xyes"] , [ - AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit]) - USB_BACKEND="IOKit" - ], - [ - PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION) - USB_BACKEND="libusb `$PKG_CONFIG --modversion libusb-1.0`" - LIBUSB_REQUIRED="libusb-1.0 >= $LIBUSB_VERSION" - AC_SUBST(LIBUSB_REQUIRED) - ] -) +AS_IF([test "x$with_dummy" = "xyes"], [ + AC_DEFINE(USE_DUMMY, 1, [Define if we are using dummy USB driver]) + USB_BACKEND="dummy" +], [ + AS_IF([test "x$with_iokit" = "xyes" && test "x$have_iokit" = "xyes"] , [ + AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit]) + USB_BACKEND="IOKit" + ], + [ + PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION) + USB_BACKEND="libusb `$PKG_CONFIG --modversion libusb-1.0`" + LIBUSB_REQUIRED="libusb-1.0 >= $LIBUSB_VERSION" + AC_SUBST(LIBUSB_REQUIRED) + ] + ) +]) # Checks for header files. AC_HEADER_STDC |