summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-09-04 23:56:37 +0200
committerGravatar Nikias Bassen2019-09-04 23:56:37 +0200
commit38befc71844a6108a78e1fe5a76946450d49ca76 (patch)
tree3a886d468803b94f8b3c8fca1fc2d2802414cedc /configure.ac
parent2a38fe45f62cbd5c554293b7d82dbbb74ec8aeca (diff)
downloadlibirecovery-38befc71844a6108a78e1fe5a76946450d49ca76.tar.gz
libirecovery-38befc71844a6108a78e1fe5a76946450d49ca76.tar.bz2
Add device add/remove event subscription API
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac96
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
28AM_PROG_CC_C_O 28AM_PROG_CC_C_O
29AC_PROG_LIBTOOL 29AC_PROG_LIBTOOL
30 30
31# Checks for header files.
32AC_HEADER_STDC
33AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
34
35# Checks for typedefs, structures, and compiler characteristics.
36AC_C_CONST
37AC_TYPE_SIZE_T
38AC_TYPE_SSIZE_T
39AC_TYPE_UINT16_T
40AC_TYPE_UINT32_T
41AC_TYPE_UINT8_T
42
43# Checks for library functions.
44AC_FUNC_MALLOC
45AC_FUNC_REALLOC
46AC_CHECK_FUNCS([strdup strerror strndup])
47
31# Checks for libraries. 48# Checks for libraries.
32AC_CHECK_HEADERS([readline/readline.h], [], 49AC_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
37case "$host_os" in 54AC_MSG_CHECKING([for platform-specific build settings])
55case ${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 ;;
59esac 82esac
60AC_SUBST(LIBIRECOVERYLDFLAGS) 83AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
61 84
62AC_ARG_WITH([dummy], 85AC_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
75AS_IF([test "x$with_dummy" = "xyes"], [ 98AS_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. 115AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden $PTHREAD_CFLAGS")
93AC_HEADER_STDC 116GLOBAL_LDFLAGS+=" $PTHREAD_LIBS"
94AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
95
96# Checks for typedefs, structures, and compiler characteristics.
97AC_C_CONST
98AC_TYPE_SIZE_T
99AC_TYPE_SSIZE_T
100AC_TYPE_UINT16_T
101AC_TYPE_UINT32_T
102AC_TYPE_UINT8_T
103
104# Checks for library functions.
105AC_FUNC_MALLOC
106AC_FUNC_REALLOC
107AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
108
109# Check for operating system
110AC_MSG_CHECKING([whether to enable WIN32 build settings])
111case ${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 ;;
122esac
123AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
124
125AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden")
126AC_SUBST(GLOBAL_CFLAGS) 117AC_SUBST(GLOBAL_CFLAGS)
118AC_SUBST(GLOBAL_LDFLAGS)
127 119
128case "$GLOBAL_CFLAGS" in 120case "$GLOBAL_CFLAGS" in
129 *-fvisibility=hidden*) 121 *-fvisibility=hidden*)