summaryrefslogtreecommitdiff
path: root/build/make
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2018-04-18 06:23:09 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-04-18 06:23:09 +0000
commit03fa7018737180d6ee7c495543410c2b2f9f6d09 (patch)
treef11b06a2ac26fdf4954870ca653bab58b9b73a3c /build/make
parent449e84ff064063cb5ff55e0afa2364fbd7051e34 (diff)
parent38dc27cc6d03383cf1764e03697137e2f330d550 (diff)
downloadlibvpx-03fa7018737180d6ee7c495543410c2b2f9f6d09.tar
libvpx-03fa7018737180d6ee7c495543410c2b2f9f6d09.tar.gz
libvpx-03fa7018737180d6ee7c495543410c2b2f9f6d09.tar.bz2
libvpx-03fa7018737180d6ee7c495543410c2b2f9f6d09.zip
Merge "configure: Test linking pthreads before using it"
Diffstat (limited to 'build/make')
-rw-r--r--build/make/configure.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/build/make/configure.sh b/build/make/configure.sh
index a6c76612f..5efafdf95 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -319,6 +319,12 @@ check_ld() {
&& check_cmd ${LD} ${LDFLAGS} "$@" -o ${TMP_X} ${TMP_O} ${extralibs}
}
+check_lib() {
+ log check_lib "$@"
+ check_cc $@ \
+ && check_cmd ${LD} ${LDFLAGS} -o ${TMP_X} ${TMP_O} "$@" ${extralibs}
+}
+
check_header(){
log check_header "$@"
header=$1
@@ -1485,7 +1491,11 @@ EOF
# bionic includes basic pthread functionality, obviating -lpthread.
;;
*)
- check_header pthread.h && add_extralibs -lpthread
+ 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); }
+EOF
;;
esac
fi