summaryrefslogtreecommitdiff
path: root/cmake/config-ix.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/config-ix.cmake')
-rwxr-xr-xcmake/config-ix.cmake16
1 files changed, 13 insertions, 3 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 9637363d38..fcd5dd5566 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -85,9 +85,19 @@ check_include_file(mach-o/dyld.h HAVE_MACH_O_DYLD_H)
# library checks
if( NOT PURE_WINDOWS )
check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
- check_library_exists(pthread pthread_getspecific "" HAVE_PTHREAD_GETSPECIFIC)
- check_library_exists(pthread pthread_rwlock_init "" HAVE_PTHREAD_RWLOCK_INIT)
- check_library_exists(pthread pthread_mutex_lock "" HAVE_PTHREAD_MUTEX_LOCK)
+ if (HAVE_LIBPTHREAD)
+ check_library_exists(pthread pthread_getspecific "" HAVE_PTHREAD_GETSPECIFIC)
+ check_library_exists(pthread pthread_rwlock_init "" HAVE_PTHREAD_RWLOCK_INIT)
+ check_library_exists(pthread pthread_mutex_lock "" HAVE_PTHREAD_MUTEX_LOCK)
+ else()
+ # this could be Android
+ check_library_exists(c pthread_create "" PTHREAD_IN_LIBC)
+ if (PTHREAD_IN_LIBC)
+ check_library_exists(c pthread_getspecific "" HAVE_PTHREAD_GETSPECIFIC)
+ check_library_exists(c pthread_rwlock_init "" HAVE_PTHREAD_RWLOCK_INIT)
+ check_library_exists(c pthread_mutex_lock "" HAVE_PTHREAD_MUTEX_LOCK)
+ endif()
+ endif()
check_library_exists(dl dlopen "" HAVE_LIBDL)
endif()