forked from ryanbinns/ttwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
64 lines (54 loc) · 1.59 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
AC_INIT(ttwatch, version-0.1)
AC_ARG_WITH(unsafe, [ --with-unsafe enable unsafe functions])
AC_PROG_CC
AC_LANG(C)
AN_MAKEVAR([AR], [AC_PROG_AR])
AN_PROGRAM([ar], [AC_PROG_AR])
AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL([AR], [ar], [ar])])
AC_PROG_AR
ok=1
AC_CHECK_HEADERS(getopt.h, [], [ok=0])
AC_CHECK_HEADERS(memory.h, [], [ok=0])
AC_CHECK_HEADERS(stdarg.h, [], [ok=0])
AC_CHECK_HEADERS(stdio.h, [], [ok=0])
AC_CHECK_HEADERS(stdlib.h, [], [ok=0])
AC_CHECK_HEADERS(string.h, [], [ok=0])
AC_CHECK_HEADERS(time.h, [], [ok=0])
AC_CHECK_HEADERS(unistd.h, [], [ok=0])
AC_CHECK_HEADERS(pwd.h, [], [ok=0])
AC_CHECK_HEADERS(fcntl.h, [], [ok=0])
AC_CHECK_HEADERS(sys/types.h, [], [ok=0])
AC_CHECK_HEADERS(sys/stat.h, [], [ok=0])
AC_CHECK_HEADERS(libusb-1.0/libusb.h, [], [ok=0])
AC_CHECK_LIB(usb-1.0, libusb_init, [], [ok=0])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <libusb-1.0/libusb.h>
]],
[[
#ifdef LIBUSB_API_VERSION
# if LIBUSB_API_VERSION < 0x01000102
# error "LIBUSB Version too old"
# endif
#else
# ifdef LIBUSBX_API_VERSION
# if LIBUSBX_API_VERSION < 0x01000102
# error "LIBUSB Version too old"
# endif
# else
# error "Unable to determine LIBUSB version"
# endif
#endif
]])],
[], [AC_MSG_ERROR([[The libusb version must be 1.0.16 or higher]])])
AC_CHECK_HEADERS(curl/curl.h, [], [ok=0])
AC_CHECK_LIB(curl, curl_easy_init, [], [ok=0])
if test "x$with_unsafe" = xyes; then
AC_SUBST(unsafe, [-DUNSAFE])
else
AC_SUBST(unsafe, [ ])
fi
if test "x$ok" = x1; then
AC_OUTPUT(Makefile)
else
AC_MSG_NOTICE([Errors prevent Makefile being generated])
fi