configure.ac: Don't look for pthreads in Android platform
authorGurchetan Singh <gurchetansingh@chromium.org>
Thu, 27 Oct 2016 16:06:42 +0000 (09:06 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 15 Nov 2016 15:48:02 +0000 (15:48 +0000)
In Android, the pthreads libs are in bionic.  When building
Mesa for Android with the autotools workflow, we shouldn't
set -lpthread or -pthread.

[Emil Velikov]
Other platforms could use a similar fix, although that is left as
separate exercise.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
configure.ac

index 4761c5972e840392559780c0397d43e642a1d125..3f21cd53a76fdf6df34e343702eb5751fa278b6c 100644 (file)
@@ -823,8 +823,11 @@ if test "x$ax_pthread_ok" = xno; then
 fi
 dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
 dnl to -pthread, which causes problems if we need -lpthread to appear in
-dnl pkgconfig files.
-test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
+dnl pkgconfig files.  Since Android doesn't have a pthread lib, this check
+dnl is not valid for that platform.
+if test "x$android" = xno; then
+    test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
+fi
 
 dnl pthread-stubs is mandatory on targets where it exists
 case "$host_os" in