]> granicus.if.org Git - libvpx/commitdiff
configure: Use both check_header and check_lib for pthreads
authorMartin Storsjo <martin@martin.st>
Thu, 19 Apr 2018 05:55:44 +0000 (08:55 +0300)
committerMartin Storsjo <martin@martin.st>
Thu, 19 Apr 2018 06:32:40 +0000 (09:32 +0300)
check_lib can be a stub that always returns true - make sure to
still use check_headers as before 38dc27cc6.

Change-Id: I5d471de56b16c015a0b686fa6c6caefa35bb89b4

build/make/configure.sh
configure

index 5efafdf95529765554d2b677a04eccf9bf289602..876255bfe98efe3094fc9f794be55ab61be7beee 100644 (file)
@@ -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); }
index 3174a9f4b57146a052b229cbcf52a04c1e99c856..b021c1212a7e8b22a8e790b5bdb3edb9f0767e6b 100755 (executable)
--- a/configure
+++ b/configure
@@ -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); }