summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2018-09-17 18:11:47 +0200
committerGravatar Nikias Bassen2018-09-17 18:11:47 +0200
commit4daf6d84f7271cc19256c45b52c63b99ba7b4391 (patch)
tree9329f344b20d753ee5b43bda609b6db51a2d6530 /configure.ac
parent85d352a6bd4c4d3fef26bc1bec289254939950f9 (diff)
downloadlibirecovery-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.ac32
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
59esac 59esac
60AC_SUBST(LIBIRECOVERYLDFLAGS) 60AC_SUBST(LIBIRECOVERYLDFLAGS)
61 61
62AC_ARG_WITH([dummy],
63 [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.])],
64 [],
65 [with_dummy=no])
66
62AS_IF([test "x$have_iokit" = "xyes"], [ 67AS_IF([test "x$have_iokit" = "xyes"], [
63 AC_ARG_WITH([iokit], 68 AC_ARG_WITH([iokit],
64 [AS_HELP_STRING([--with-iokit], [Use IOKit instead of libusb on OS X [default=yes]])], 69 [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"], [
67 ], [] 72 ], []
68) 73)
69 74
70AS_IF([test "x$with_iokit" = "xyes" && test "x$have_iokit" = "xyes"] , [ 75AS_IF([test "x$with_dummy" = "xyes"], [
71 AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit]) 76 AC_DEFINE(USE_DUMMY, 1, [Define if we are using dummy USB driver])
72 USB_BACKEND="IOKit" 77 USB_BACKEND="dummy"
73 ], 78], [
74 [ 79 AS_IF([test "x$with_iokit" = "xyes" && test "x$have_iokit" = "xyes"] , [
75 PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION) 80 AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit])
76 USB_BACKEND="libusb `$PKG_CONFIG --modversion libusb-1.0`" 81 USB_BACKEND="IOKit"
77 LIBUSB_REQUIRED="libusb-1.0 >= $LIBUSB_VERSION" 82 ],
78 AC_SUBST(LIBUSB_REQUIRED) 83 [
79 ] 84 PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION)
80) 85 USB_BACKEND="libusb `$PKG_CONFIG --modversion libusb-1.0`"
86 LIBUSB_REQUIRED="libusb-1.0 >= $LIBUSB_VERSION"
87 AC_SUBST(LIBUSB_REQUIRED)
88 ]
89 )
90])
81 91
82# Checks for header files. 92# Checks for header files.
83AC_HEADER_STDC 93AC_HEADER_STDC