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:
@@ -1491,7 +1491,7 @@ EOF
|
||||
# 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 <stddef.h>
|
||||
int main(void) { return pthread_create(NULL, NULL, NULL, NULL); }
|
||||
|
||||
5
configure
vendored
5
configure
vendored
@@ -582,7 +582,10 @@ process_detect() {
|
||||
int main(void) {return 0;}
|
||||
EOF
|
||||
# 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 <stddef.h>
|
||||
int main(void) { return pthread_create(NULL, NULL, NULL, NULL); }
|
||||
|
||||
Reference in New Issue
Block a user