summaryrefslogtreecommitdiff
path: root/m4/ax_boost_thread.m4
diff options
context:
space:
mode:
authorIgor Cota <igor@codexapertus.com>2019-12-31 17:24:21 +0100
committerIgor Cota <igor@codexapertus.com>2019-12-31 17:24:21 +0100
commit0087595e99c8bb9a41f5c05a426b453c8d4d931c (patch)
tree4069795c17bdf75bfc34864b6bb0dec4ad25d5d9 /m4/ax_boost_thread.m4
parent794677945ba208bd52173dda034318e967ef9691 (diff)
downloadautoconf-archive-0087595e99c8bb9a41f5c05a426b453c8d4d931c.tar.gz
ax_boost_thread: do not set -pthread on Android
The android libc, bionic, provides built-in support for pthreads, so no additional linking is necessary. Leaving -pthread breaks the build, see protocolbuffers/protobuf#1373
Diffstat (limited to 'm4/ax_boost_thread.m4')
-rw-r--r--m4/ax_boost_thread.m454
1 files changed, 39 insertions, 15 deletions
diff --git a/m4/ax_boost_thread.m4 b/m4/ax_boost_thread.m4
index e9dea43..75e80e6 100644
--- a/m4/ax_boost_thread.m4
+++ b/m4/ax_boost_thread.m4
@@ -30,7 +30,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 32
+#serial 33
AC_DEFUN([AX_BOOST_THREAD],
[
@@ -67,13 +67,24 @@ AC_DEFUN([AX_BOOST_THREAD],
[AC_LANG_PUSH([C++])
CXXFLAGS_SAVE=$CXXFLAGS
- if test "x$host_os" = "xsolaris" ; then
- CXXFLAGS="-pthreads $CXXFLAGS"
- elif test "x$host_os" = "xmingw32" ; then
- CXXFLAGS="-mthreads $CXXFLAGS"
- else
- CXXFLAGS="-pthread $CXXFLAGS"
- fi
+ case "x$host_os" in
+ xsolaris )
+ CXXFLAGS="-pthreads $CXXFLAGS"
+ break;
+ ;;
+ xmingw32 )
+ CXXFLAGS="-mthreads $CXXFLAGS"
+ break;
+ ;;
+ *android* )
+ break;
+ ;;
+ * )
+ CXXFLAGS="-pthread $CXXFLAGS"
+ break;
+ ;;
+ esac
+
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(
[[@%:@include <boost/thread/thread.hpp>]],
@@ -84,13 +95,23 @@ AC_DEFUN([AX_BOOST_THREAD],
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_thread" = "xyes"; then
- if test "x$host_os" = "xsolaris" ; then
- BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
- elif test "x$host_os" = "xmingw32" ; then
- BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
- else
- BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
- fi
+ case "x$host_os" in
+ xsolaris )
+ BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
+ break;
+ ;;
+ xmingw32 )
+ BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
+ break;
+ ;;
+ *android* )
+ break;
+ ;;
+ * )
+ BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
+ break;
+ ;;
+ esac
AC_SUBST(BOOST_CPPFLAGS)
@@ -148,6 +169,9 @@ AC_DEFUN([AX_BOOST_THREAD],
xmingw32 )
break;
;;
+ *android* )
+ break;
+ ;;
* )
BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread"
break;