diff options
| author | 2019-09-04 23:56:37 +0200 | |
|---|---|---|
| committer | 2019-09-04 23:56:37 +0200 | |
| commit | 38befc71844a6108a78e1fe5a76946450d49ca76 (patch) | |
| tree | 3a886d468803b94f8b3c8fca1fc2d2802414cedc /configure.ac | |
| parent | 2a38fe45f62cbd5c554293b7d82dbbb74ec8aeca (diff) | |
| download | libirecovery-38befc71844a6108a78e1fe5a76946450d49ca76.tar.gz libirecovery-38befc71844a6108a78e1fe5a76946450d49ca76.tar.bz2 | |
Add device add/remove event subscription API
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 96 |
1 files changed, 44 insertions, 52 deletions
diff --git a/configure.ac b/configure.ac index 1f10bb7..6481d74 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -28,36 +28,59 @@ AC_PROG_CXX | |||
| 28 | AM_PROG_CC_C_O | 28 | AM_PROG_CC_C_O |
| 29 | AC_PROG_LIBTOOL | 29 | AC_PROG_LIBTOOL |
| 30 | 30 | ||
| 31 | # Checks for header files. | ||
| 32 | AC_HEADER_STDC | ||
| 33 | AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) | ||
| 34 | |||
| 35 | # Checks for typedefs, structures, and compiler characteristics. | ||
| 36 | AC_C_CONST | ||
| 37 | AC_TYPE_SIZE_T | ||
| 38 | AC_TYPE_SSIZE_T | ||
| 39 | AC_TYPE_UINT16_T | ||
| 40 | AC_TYPE_UINT32_T | ||
| 41 | AC_TYPE_UINT8_T | ||
| 42 | |||
| 43 | # Checks for library functions. | ||
| 44 | AC_FUNC_MALLOC | ||
| 45 | AC_FUNC_REALLOC | ||
| 46 | AC_CHECK_FUNCS([strdup strerror strndup]) | ||
| 47 | |||
| 31 | # Checks for libraries. | 48 | # Checks for libraries. |
| 32 | AC_CHECK_HEADERS([readline/readline.h], [], | 49 | AC_CHECK_HEADERS([readline/readline.h], [], |
| 33 | [AC_MSG_ERROR([Please install readline development headers])] | 50 | [AC_MSG_ERROR([Please install readline development headers])] |
| 34 | ) | 51 | ) |
| 35 | 52 | ||
| 36 | # Check additional platform flags | 53 | # Check additional platform flags |
| 37 | case "$host_os" in | 54 | AC_MSG_CHECKING([for platform-specific build settings]) |
| 55 | case ${host_os} in | ||
| 38 | darwin*) | 56 | darwin*) |
| 57 | AC_MSG_RESULT([${host_os}]) | ||
| 39 | AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h, [ | 58 | AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h, [ |
| 40 | AC_CHECK_HEADER(IOKit/usb/IOUSBLib.h, [ | 59 | AC_CHECK_HEADER(IOKit/usb/IOUSBLib.h, [ |
| 41 | LIBIRECOVERYLDFLAGS="-framework IOKit -framework CoreFoundation" | 60 | GLOBAL_LDFLAGS+=" -framework IOKit -framework CoreFoundation" |
| 42 | have_iokit=yes | 61 | have_iokit=yes |
| 43 | ], []) | 62 | ], []) |
| 44 | ], []) | 63 | ], []) |
| 64 | AX_PTHREAD([], [AC_MSG_ERROR([pthread is required to build $PACKAGE])]) | ||
| 45 | ;; | 65 | ;; |
| 46 | mingw32*) | 66 | mingw32*) |
| 47 | LDFLAGS+=" -static-libgcc" | 67 | AC_MSG_RESULT([${host_os}]) |
| 48 | LIBIRECOVERYLDFLAGS=" -lkernel32 -lmsvcrt -lsetupapi" | 68 | GLOBAL_LDFLAGS+=" -static-libgcc -lkernel32 -lmsvcrt -lsetupapi" |
| 69 | win32=true | ||
| 49 | ;; | 70 | ;; |
| 50 | cygwin*) | 71 | cygwin*) |
| 72 | AC_MSG_RESULT([${host_os}]) | ||
| 51 | CC=gcc-3 | 73 | CC=gcc-3 |
| 52 | CFLAGS+=" -mno-cygwin" | 74 | CFLAGS+=" -mno-cygwin" |
| 53 | LDFLAGS+=" -static-libgcc" | 75 | GLOBAL_LDFLAGS+=" -static-libgcc -lkernel32 -lmsvcrt -lsetupapi" |
| 54 | LIBIRECOVERYLDFLAGS=" -lkernel32 -lmsvcrt -lsetupapi" | 76 | win32=true |
| 55 | ;; | 77 | ;; |
| 56 | *) | 78 | *) |
| 57 | LIBIRECOVERYLDFLAGS= | 79 | AC_MSG_RESULT([${host_os}]) |
| 80 | AX_PTHREAD([], [AC_MSG_ERROR([pthread is required to build $PACKAGE])]) | ||
| 58 | ;; | 81 | ;; |
| 59 | esac | 82 | esac |
| 60 | AC_SUBST(LIBIRECOVERYLDFLAGS) | 83 | AM_CONDITIONAL(WIN32, test x$win32 = xtrue) |
| 61 | 84 | ||
| 62 | AC_ARG_WITH([dummy], | 85 | AC_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.])], | 86 | [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.])], |
| @@ -69,61 +92,30 @@ AS_IF([test "x$have_iokit" = "xyes"], [ | |||
| 69 | [AS_HELP_STRING([--with-iokit], [Use IOKit instead of libusb on OS X [default=yes]])], | 92 | [AS_HELP_STRING([--with-iokit], [Use IOKit instead of libusb on OS X [default=yes]])], |
| 70 | [], | 93 | [], |
| 71 | [with_iokit=yes]) | 94 | [with_iokit=yes]) |
| 72 | ], [] | 95 | ] |
| 73 | ) | 96 | ) |
| 74 | 97 | ||
| 75 | AS_IF([test "x$with_dummy" = "xyes"], [ | 98 | AS_IF([test "x$with_dummy" = "xyes"], [ |
| 76 | AC_DEFINE(USE_DUMMY, 1, [Define if we are using dummy USB driver]) | 99 | AC_DEFINE(USE_DUMMY, 1, [Define if we are using dummy USB driver]) |
| 77 | USB_BACKEND="dummy" | 100 | USB_BACKEND="dummy" |
| 78 | ], [ | 101 | ], [ |
| 79 | AS_IF([test "x$with_iokit" = "xyes" && test "x$have_iokit" = "xyes"] , [ | 102 | AS_IF([test "x$with_iokit" = "xyes" && test "x$have_iokit" = "xyes"], [ |
| 80 | AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit]) | 103 | AC_DEFINE(HAVE_IOKIT, 1, [Define if we have IOKit]) |
| 81 | USB_BACKEND="IOKit" | 104 | USB_BACKEND="IOKit" |
| 82 | ], | 105 | ], [ |
| 83 | [ | 106 | AS_IF([test "x$win32" = "xtrue"], [ |
| 107 | USB_BACKEND="win32 native (setupapi)" | ||
| 108 | ], [ | ||
| 84 | PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION) | 109 | PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION) |
| 85 | USB_BACKEND="libusb `$PKG_CONFIG --modversion libusb-1.0`" | 110 | USB_BACKEND="libusb `$PKG_CONFIG --modversion libusb-1.0`" |
| 86 | LIBUSB_REQUIRED="libusb-1.0 >= $LIBUSB_VERSION" | 111 | ]) |
| 87 | AC_SUBST(LIBUSB_REQUIRED) | 112 | ]) |
| 88 | ] | ||
| 89 | ) | ||
| 90 | ]) | 113 | ]) |
| 91 | 114 | ||
| 92 | # Checks for header files. | 115 | AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden $PTHREAD_CFLAGS") |
| 93 | AC_HEADER_STDC | 116 | GLOBAL_LDFLAGS+=" $PTHREAD_LIBS" |
| 94 | AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) | ||
| 95 | |||
| 96 | # Checks for typedefs, structures, and compiler characteristics. | ||
| 97 | AC_C_CONST | ||
| 98 | AC_TYPE_SIZE_T | ||
| 99 | AC_TYPE_SSIZE_T | ||
| 100 | AC_TYPE_UINT16_T | ||
| 101 | AC_TYPE_UINT32_T | ||
| 102 | AC_TYPE_UINT8_T | ||
| 103 | |||
| 104 | # Checks for library functions. | ||
| 105 | AC_FUNC_MALLOC | ||
| 106 | AC_FUNC_REALLOC | ||
| 107 | AC_CHECK_FUNCS([strcasecmp strdup strerror strndup]) | ||
| 108 | |||
| 109 | # Check for operating system | ||
| 110 | AC_MSG_CHECKING([whether to enable WIN32 build settings]) | ||
| 111 | case ${host_os} in | ||
| 112 | *mingw32*|*cygwin*) | ||
| 113 | win32=true | ||
| 114 | AC_MSG_RESULT([yes]) | ||
| 115 | AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found])) | ||
| 116 | AC_SUBST(WINDRES) | ||
| 117 | ;; | ||
| 118 | *) | ||
| 119 | win32=false | ||
| 120 | AC_MSG_RESULT([no]) | ||
| 121 | ;; | ||
| 122 | esac | ||
| 123 | AM_CONDITIONAL(WIN32, test x$win32 = xtrue) | ||
| 124 | |||
| 125 | AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden") | ||
| 126 | AC_SUBST(GLOBAL_CFLAGS) | 117 | AC_SUBST(GLOBAL_CFLAGS) |
| 118 | AC_SUBST(GLOBAL_LDFLAGS) | ||
| 127 | 119 | ||
| 128 | case "$GLOBAL_CFLAGS" in | 120 | case "$GLOBAL_CFLAGS" in |
| 129 | *-fvisibility=hidden*) | 121 | *-fvisibility=hidden*) |
