configure: Use both check_header and check_lib for pthreads

check_lib can be a stub that always returns true - make sure to
still use check_headers as before 38dc27cc6.

Change-Id: I5d471de56b16c015a0b686fa6c6caefa35bb89b4
This commit is contained in:
Martin Storsjo
2018-04-19 08:55:44 +03:00
parent d547aced6c
commit 9b7d4cce63
2 changed files with 5 additions and 2 deletions

View File

@@ -1491,7 +1491,7 @@ EOF
# bionic includes basic pthread functionality, obviating -lpthread. # bionic includes basic pthread functionality, obviating -lpthread.
;; ;;
*) *)
check_lib -lpthread <<EOF && enable_feature pthread_h && add_extralibs -lpthread check_header pthread.h && check_lib -lpthread <<EOF && enable_feature pthread_h && add_extralibs -lpthread
#include <pthread.h> #include <pthread.h>
#include <stddef.h> #include <stddef.h>
int main(void) { return pthread_create(NULL, NULL, NULL, NULL); } int main(void) { return pthread_create(NULL, NULL, NULL, NULL); }

5
configure vendored
View File

@@ -582,7 +582,10 @@ process_detect() {
int main(void) {return 0;} int main(void) {return 0;}
EOF EOF
# check system headers # check system headers
check_lib -lpthread <<EOF && enable_feature pthread_h
# Use both check_header and check_lib here, since check_lib
# could be a stub that always returns true.
check_header pthread.h && check_lib -lpthread <<EOF && enable_feature pthread_h
#include <pthread.h> #include <pthread.h>
#include <stddef.h> #include <stddef.h>
int main(void) { return pthread_create(NULL, NULL, NULL, NULL); } int main(void) { return pthread_create(NULL, NULL, NULL, NULL); }