And use it to check for pthreads support.
Unbreak f058f384a0d76bfd125f4738dceab7c890186432 for *BSD since their
compilers have a false positive with pthread_join.
---
If somebody has a nicer ideas or if you think we should pick some of
the functions we use and list them there please tell.
configure | 32 +++++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/configure b/configure
index 832a54a..2559b35 100755
--- a/configure
+++ b/configure
@@ -844,6 +844,25 @@ int main(void){ $func(); }
EOF
}
+check_funcs(){
+ log check_funcs "$@"
+ key=$1
+ shift
+ func=$1
+ shift
+ disable $key
+ for fn in $func; do
+ d="$d extern int $fn();"
+ c="$c $fn();"
+ done
+
+ check_ld "$@" <<EOF && enable $func
+$d
+int main(void){ $c }
+EOF
+}
+
+
check_mathfunc(){
log check_mathfunc "$@"
func=$1
@@ -3799,19 +3818,18 @@ fi
# check for some common methods of building with pthread support
# do this before the optional library checks as some of them require pthreads
if ! disabled pthreads && ! enabled w32threads; then
- enable pthreads
- if check_func pthread_join; then
+ if check_funcs pthreads "pthread_join pthread_create"; then
:
- elif check_func pthread_join -pthread; then
+ elif check_funcs pthreads "pthread_join pthread_create" -pthread; then
add_cflags -pthread
add_extralibs -pthread
- elif check_func pthread_join -pthreads; then
+ elif check_funcs pthreads "pthread_join pthread_create" -pthreads; then
add_cflags -pthreads
add_extralibs -pthreads
- elif check_func pthread_join -lpthreadGC2; then
+ elif check_funcs pthreads "pthread_join pthread_create" -lpthreadGC2; then
add_extralibs -lpthreadGC2
- elif ! check_lib pthread.h pthread_join -lpthread; then
- disable pthreads
+ else
+ check_libs pthreads "pthread_join pthread_create" -lpthread
fi
fi
--
1.8.3.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel