summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
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
33AC_CHECK_HEADERS([readline/readline.h], [], 33AC_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)
36PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION)
37 36
38# Check additional platform flags 37# Check additional platform flags
39case "$host_os" in 38case "$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
61esac 60esac
62AC_SUBST(LIBIRECOVERYLDFLAGS) 61AC_SUBST(LIBIRECOVERYLDFLAGS)
63 62
63AS_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
71AS_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.
65AC_HEADER_STDC 82AC_HEADER_STDC
66AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) 83AC_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.