Commit a5a3b398 authored by Luca Barbato's avatar Luca Barbato

configure: Reorder pthreads checks

Some pthreads symbols might be present in libc (as shown on various *BSD)
but not all of them, leading to false positives.

Check for the most common compiler flags before the plain symbol check
to avoid known pitfalls.
parent 7cbe1ea9
...@@ -3842,9 +3842,7 @@ fi ...@@ -3842,9 +3842,7 @@ fi
# do this before the optional library checks as some of them require pthreads # do this before the optional library checks as some of them require pthreads
if ! disabled pthreads && ! enabled w32threads; then if ! disabled pthreads && ! enabled w32threads; then
enable pthreads enable pthreads
if check_func pthread_join; then if check_func pthread_join -pthread; then
:
elif check_func pthread_join -pthread; then
add_cflags -pthread add_cflags -pthread
add_extralibs -pthread add_extralibs -pthread
elif check_func pthread_join -pthreads; then elif check_func pthread_join -pthreads; then
...@@ -3852,7 +3850,9 @@ if ! disabled pthreads && ! enabled w32threads; then ...@@ -3852,7 +3850,9 @@ if ! disabled pthreads && ! enabled w32threads; then
add_extralibs -pthreads add_extralibs -pthreads
elif check_func pthread_join -lpthreadGC2; then elif check_func pthread_join -lpthreadGC2; then
add_extralibs -lpthreadGC2 add_extralibs -lpthreadGC2
elif ! check_lib pthread.h pthread_join -lpthread; then elif check_lib pthread.h pthread_join -lpthread; then
:
elif ! check_func pthread_join; then
disable pthreads disable pthreads
fi fi
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment