/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
-
-/* Add defines which Android is missing */
-#ifndef TIMESPEC_TO_TIMEVAL
-#define TIMESPEC_TO_TIMEVAL(tv, ts) \
- do { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
- } while (0)
-#endif
AC_MSG_CHECKING([operating system])
+dnl on linux-android platform, some functions are in different places
+case $host in
+*-linux-android*)
+ AC_MSG_RESULT([This is a Linux-Android system])
+ is_backend_android="yes"
+ ;;
+*)
+ is_backend_android="no"
+esac
+
case $host in
*-linux* | *-uclinux*)
AC_MSG_RESULT([Linux])
])
fi
AC_SUBST(USE_UDEV)
+
+case $is_backend_android in
+yes)
+ dnl some pthread functions is in libc
+ THREAD_CFLAGS="-c"
+ LIBS="${LIBS} -c"
+ dnl there are gettimeofday function but configure doesn't seem to be able to find it.
+ AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [Define if you have gettimeofday])
+ ;;
+*)
THREAD_CFLAGS="-pthread"
LIBS="${LIBS} -pthread"
+esac
+
AC_CHECK_HEADERS([poll.h])
AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
;;
#define TIMESPEC_IS_SET(ts) ((ts)->tv_sec != 0 || (ts)->tv_nsec != 0)
+/* Some platforms don't have this define */
+#ifndef TIMESPEC_TO_TIMEVAL
+#define TIMESPEC_TO_TIMEVAL(tv, ts) \
+ do { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+ } while (0)
+#endif
+
void usbi_log(struct libusb_context *ctx, enum libusb_log_level level,
const char *function, const char *format, ...);
-#define LIBUSB_NANO 10854
+#define LIBUSB_NANO 10855