ref: e63c29c7603a49d18fee1192a5fe3895a0b05876
parent: 04d8700862851885ae5c164dac82d3e0c44965ab
author: Martin Storsjo <martin@martin.st>
date: Fri May 4 05:32:41 EDT 2018
configure: Disable pthread_h if linking failed When doing both check_header and check_lib, the check_header call will already enable pthread_h if the header was found. This was overlooked when the pthread linking check was amended into a header check and a separate linking check in 9b7d4cce635e. This brings back the same result as the original check in 38dc27cc6. Change-Id: I0efb38f5780f7c79e2eb2b14290d6094096ea222
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -1491,7 +1491,7 @@
# bionic includes basic pthread functionality, obviating -lpthread.
;;
*)
- check_header pthread.h && check_lib -lpthread <<EOF && enable_feature pthread_h && add_extralibs -lpthread
+ check_header pthread.h && check_lib -lpthread <<EOF && add_extralibs -lpthread || disable_feature pthread_h
#include <pthread.h>
#include <stddef.h>
int main(void) { return pthread_create(NULL, NULL, NULL, NULL); }
--- a/configure
+++ b/configure
@@ -585,7 +585,7 @@
# 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
+ check_header pthread.h && check_lib -lpthread <<EOF || disable_feature pthread_h
#include <pthread.h>
#include <stddef.h>
int main(void) { return pthread_create(NULL, NULL, NULL, NULL); }