summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Aaron Burghardt2015-10-09 02:18:36 +0200
committerGravatar Nikias Bassen2015-10-09 02:18:36 +0200
commit9c2d268af412b905d845b2889bb3ef5375481330 (patch)
treec1f5b135ca654eaa2d168c553acb3111a264494e /configure.ac
parentf5eff51c19612bb034482bdf71cb4a8a053f0d71 (diff)
downloadlibirecovery-9c2d268af412b905d845b2889bb3ef5375481330.tar.gz
libirecovery-9c2d268af412b905d845b2889bb3ef5375481330.tar.bz2
Added IOKit option for OS X that removes libusb dependency (enabled by default)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac24
1 files changed, 21 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 67459b8..bc8ba3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,15 +33,14 @@ AC_PROG_LIBTOOL
AC_CHECK_HEADERS([readline/readline.h], [],
[AC_MSG_ERROR([Please install readline development headers])]
)
-PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION)
# Check additional platform flags
case "$host_os" in
darwin*)
AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h, [
- AC_CHECK_HEADER(IOKit/IOKitLib.h, [
- AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit])
+ AC_CHECK_HEADER(IOKit/usb/IOUSBLib.h, [
LIBIRECOVERYLDFLAGS="-framework IOKit -framework CoreFoundation"
+ have_iokit=yes
], [])
], [])
;;
@@ -61,6 +60,24 @@ case "$host_os" in
esac
AC_SUBST(LIBIRECOVERYLDFLAGS)
+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]])],
+ [],
+ [with_iokit=yes])
+ ], []
+)
+
+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`"
+ ]
+)
+
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
@@ -144,6 +161,7 @@ Configuration for $PACKAGE $VERSION:
-------------------------------------------
Install prefix: .........: $prefix
+ USB backend: ............: $USB_BACKEND
Now type 'make' to build $PACKAGE $VERSION,
and then 'make install' for installation.