Merge commit 'fb3b2f5d923a6e19d80f21eb4e081674bceec810'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 1 Mar 2014 12:07:36 +0000 (13:07 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 1 Mar 2014 12:07:36 +0000 (13:07 +0100)
* commit 'fb3b2f5d923a6e19d80f21eb4e081674bceec810':
  configure: Set the thread type after resolving dependencies

Conflicts:
configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
configure

diff --cc configure
+++ b/configure
  
  # 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
 +if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
      enable pthreads
 -    if check_func pthread_join -pthread; then
 +    if check_func pthread_join -pthread && check_func pthread_create -pthread; then
          add_cflags -pthread
          add_extralibs -pthread
 -    elif check_func pthread_join -pthreads; then
 +    elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
          add_cflags -pthreads
          add_extralibs -pthreads
 -    elif check_func pthread_join -lpthreadGC2; then
 +    elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
          add_extralibs -lpthreadGC2
 -    elif check_lib pthread.h pthread_join -lpthread; then
 +    elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then
          :
 -    elif ! check_func pthread_join; then
 +    elif ! check_func pthread_join && ! check_func pthread_create; then
          disable pthreads
      fi
- for thread in $THREADS_LIST; do
-     if enabled $thread; then
-         test -n "$thread_type" &&
-             die "ERROR: Only one thread type must be selected." ||
-             thread_type="$thread"
-     fi
- done
 +    check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
 +fi
 +
 +
 +if enabled pthreads; then
 +  check_func pthread_cancel
  fi
  
  disabled  zlib || check_lib   zlib.h      zlibVersion -lz   || disable  zlib
  ! enabled_any memalign posix_memalign aligned_malloc &&
      enabled_any $need_memalign && enable memalign_hack
  
 +# add_dep lib dep
 +# -> enable ${lib}_deps_${dep}
 +# -> add $dep to ${lib}_deps only once
 +add_dep() {
 +    lib=$1
 +    dep=$2
 +    enabled "${lib}_deps_${dep}" && return 0
 +    enable  "${lib}_deps_${dep}"
 +    prepend "${lib}_deps" $dep
 +}
 +
 +# merge deps lib components
 +# merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
 +merge_deps() {
 +    lib=$1
 +    shift
 +    for comp in $*; do
 +        enabled $comp || continue
 +        eval "dep=\"\$${comp}_deps\""
 +        for d in $dep; do
 +            add_dep $lib $d
 +        done
 +    done
 +}
 +
 +merge_deps libavfilter $FILTER_LIST
 +
+ for thread in $THREADS_LIST; do
+     if enabled $thread; then
+         test -n "$thread_type" &&
+             die "ERROR: Only one thread type must be selected." ||
+             thread_type="$thread"
+     fi
+ done
  echo "install prefix            $prefix"
  echo "source path               $source_path"
  echo "C compiler                $cc"