From b1fb02448c581fb37be76e16ea4ac0e0406f7321 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Wed, 1 Apr 2015 14:50:17 -0400
Subject: [PATCH] fix build for android

---
 configure.ac      | 6 ++++++
 tools/Makefile.am | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7af9af75..76237889 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,9 @@ case "${host_os}" in
   linux*)
     SYS=linux
     ;;
+  android*)
+    SYS=android
+    ;;
   darwin*)
     SYS=darwin
     ;;
@@ -40,6 +43,9 @@ case "${host_os}" in
     ;;
 esac
 
+AS_IF([test "x$SYS" = "xandroid"],
+      [], [LDFLAGS="${LDFLAGS} -lpthread"])
+
 LT_INIT()
 LT_LANG(C++)
 
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 4516cdbe..81233c7c 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,9 +1,9 @@
 libexec_PROGRAMS = dhtnode dhtchat
 
 AM_CPPFLAGS = -I../include
+
 dhtnode_SOURCES = dhtnode.cpp
-dhtnode_LDFLAGS = -lpthread -lopendht -L../src/.libs @GNUTLS_LIBS@
+dhtnode_LDFLAGS = -lopendht -L../src/.libs @GNUTLS_LIBS@
 
-AM_CPPFLAGS = -I../include
 dhtchat_SOURCES = dhtchat.cpp
-dhtchat_LDFLAGS = @GNUTLS_LIBS@ -lpthread -lopendht -L../src/.libs
+dhtchat_LDFLAGS = -lopendht -L../src/.libs  @GNUTLS_LIBS@
-- 
GitLab