diff options
| author | 2015-10-09 02:18:36 +0200 | |
|---|---|---|
| committer | 2015-10-09 02:18:36 +0200 | |
| commit | 9c2d268af412b905d845b2889bb3ef5375481330 (patch) | |
| tree | c1f5b135ca654eaa2d168c553acb3111a264494e /configure.ac | |
| parent | f5eff51c19612bb034482bdf71cb4a8a053f0d71 (diff) | |
| download | libirecovery-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.ac | 24 |
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 | |||
| 33 | AC_CHECK_HEADERS([readline/readline.h], [], | 33 | AC_CHECK_HEADERS([readline/readline.h], [], |
| 34 | [AC_MSG_ERROR([Please install readline development headers])] | 34 | [AC_MSG_ERROR([Please install readline development headers])] |
| 35 | ) | 35 | ) |
| 36 | PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION) | ||
| 37 | 36 | ||
| 38 | # Check additional platform flags | 37 | # Check additional platform flags |
| 39 | case "$host_os" in | 38 | case "$host_os" in |
| 40 | darwin*) | 39 | darwin*) |
| 41 | AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h, [ | 40 | AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h, [ |
| 42 | AC_CHECK_HEADER(IOKit/IOKitLib.h, [ | 41 | AC_CHECK_HEADER(IOKit/usb/IOUSBLib.h, [ |
| 43 | AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit]) | ||
| 44 | LIBIRECOVERYLDFLAGS="-framework IOKit -framework CoreFoundation" | 42 | LIBIRECOVERYLDFLAGS="-framework IOKit -framework CoreFoundation" |
| 43 | have_iokit=yes | ||
| 45 | ], []) | 44 | ], []) |
| 46 | ], []) | 45 | ], []) |
| 47 | ;; | 46 | ;; |
| @@ -61,6 +60,24 @@ case "$host_os" in | |||
| 61 | esac | 60 | esac |
| 62 | AC_SUBST(LIBIRECOVERYLDFLAGS) | 61 | AC_SUBST(LIBIRECOVERYLDFLAGS) |
| 63 | 62 | ||
| 63 | AS_IF([test "x$have_iokit" = "xyes"], [ | ||
| 64 | AC_ARG_WITH([iokit], | ||
| 65 | [AS_HELP_STRING([--with-iokit], [Use IOKit instead of libusb on OS X [default=yes]])], | ||
| 66 | [], | ||
| 67 | [with_iokit=yes]) | ||
| 68 | ], [] | ||
| 69 | ) | ||
| 70 | |||
| 71 | AS_IF([test "x$with_iokit" = "xyes" && test "x$have_iokit" = "xyes"] , [ | ||
| 72 | AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit]) | ||
| 73 | USB_BACKEND="IOKit" | ||
| 74 | ], | ||
| 75 | [ | ||
| 76 | PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION) | ||
| 77 | USB_BACKEND="libusb `$PKG_CONFIG --modversion libusb-1.0`" | ||
| 78 | ] | ||
| 79 | ) | ||
| 80 | |||
| 64 | # Checks for header files. | 81 | # Checks for header files. |
| 65 | AC_HEADER_STDC | 82 | AC_HEADER_STDC |
| 66 | AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) | 83 | AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) |
| @@ -144,6 +161,7 @@ Configuration for $PACKAGE $VERSION: | |||
| 144 | ------------------------------------------- | 161 | ------------------------------------------- |
| 145 | 162 | ||
| 146 | Install prefix: .........: $prefix | 163 | Install prefix: .........: $prefix |
| 164 | USB backend: ............: $USB_BACKEND | ||
| 147 | 165 | ||
| 148 | Now type 'make' to build $PACKAGE $VERSION, | 166 | Now type 'make' to build $PACKAGE $VERSION, |
| 149 | and then 'make install' for installation. | 167 | and then 'make install' for installation. |
