summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorKuangye Guo <kuangye@ciinow.com>2013-10-21 18:36:15 -0700
committerPete Batard <pete@akeo.ie>2013-12-28 23:03:32 +0000
commit7e3de5de095a493accc77081fb384be8e9144250 (patch)
treea3b752134d2fc99562bf14a852e86441f38faa72 /configure.ac
parent650e22508f6d595d73d565423cb06b14049bd3af (diff)
downloadlibusb-7e3de5de095a493accc77081fb384be8e9144250.tar.gz
Android: Add support for Linux/Android platforms
* Closes #154
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9a2e24d..3495acf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,16 @@ LTLDFLAGS="${LTLDFLAGS} -no-undefined"
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])
@@ -108,8 +118,20 @@ 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])
;;