[MPlayer-dev-eng] [PATCH] configure cleanup

Diego Biurrun diego at biurrun.de
Sun Oct 2 22:02:59 CEST 2005


OK, I finally managed to finish reviewing this...

On Fri, Aug 19, 2005 at 08:22:50AM +0200, Reimar Döffinger wrote:
> 
> Anyway, attached fixed patch. Feel free to comment on smaller parts of
> the patch, I don't intend to apply it all at once anyway.
> 
> @@ -2456,18 +2456,16 @@
>  #include <netdb.h>
>  int main(void) { (void) gethostbyname(0); return 0; }
>  EOF
> -cc_check -lsocket && _ld_sock="-lsocket"
> -cc_check -lnsl && _ld_sock="-lnsl"
> -cc_check -lsocket -lnsl && _ld_sock="-lsocket -lnsl"
> -cc_check -lsocket -ldnet && _ld_sock="-lsocket -ldnet"
> -cc_check -lsocket -lbind && _ld_sock="-lsocket -lbind"
> -if test $_winsock2 = auto && not cygwin ; then
> +for _ld_tmp in "-lsocket" "-lnsl" "-lsocket -lnsl" "-lsocket -ldnet" "-lsocket -lbind" ; do
> +  cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && break
> +done
> +if test -z "$_ld_sock" && test $_winsock2 = auto && not cygwin ; then

Why are you testing if _ld_sock got set here?  This was not done
before...

>    _winsock2=no
>    cat > $TMPC << EOF
>  #include <winsock2.h>
>  int main(void) { (void) gethostbyname(0); return 0; }
>  EOF
> -  cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
> +  cc_check -lws2_32 && _winsock2=yes
>  fi
>  if test "$_ld_sock" ; then
>    echores "yes (using $_ld_sock)"

Sure about this last hunk?  It looks fishy to me...

> @@ -2738,39 +2733,21 @@
>  _def_threads='#undef HAVE_THREADS'
>  
>  echocheck "pthread"
> -_ld_pthread=''
>  if test "$_pthreads" != no ; then
>  cat > $TMPC << EOF
>  #include <pthread.h>
>  void* func(void *arg) { return arg; }
>  int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
>  EOF
> -if hpux ; then
> -  _ld_pthread=''
> -elif ( cc_check -lpthreadGC2 && $TMPO ) ; then # mingw pthreads-win32
> -  _ld_pthread='-lpthreadGC2'
> -elif ( cc_check && $TMPO ) ; then              # QNX
> -  _ld_pthread=' ' # _ld_pthread='' would disable pthreads, but the test worked
> -elif ( cc_check -lpthread && $TMPO ) ; then
> -  _ld_pthread='-lpthread'
> -elif ( cc_check -pthread && $TMPO ) ; then
> -  _ld_pthread='-pthread'
> -else
> -  if test "$_ld_static" ; then
> +_pthreads=no
> +if not hpux ; then
> +  for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
>      # for crosscompilation, we cannot execute the program, be happy if we can link statically
> -    if ( cc_check -lpthread ) ; then
> -      _ld_pthread='-lpthread'
> -    elif ( cc_check -pthread ) ; then
> -     _ld_pthread='-pthread'
> -    else
> -      _ld_pthread=''
> -    fi
> -  else
> -    _ld_pthread='' 
> -  fi
> +    cc_check $_ld_tmp && ($TMPO || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
> +  done
>  fi
>  fi
> -if test "$_ld_pthread" != '' ; then
> +if test "$_pthreads" = yes ; then
>    echores "yes (using $_ld_pthread)"
>    _pthreads='yes'
>    _def_pthreads='#define HAVE_PTHREADS 1'
> @@ -3568,6 +3524,7 @@
>  
>  echocheck "DPMS"
>  _xdpms3=no
> +_xdpms4=no

Hmm, why?  I think the variable is unnecessary in any case.

> @@ -4680,23 +4620,26 @@
>  echocheck "JACK"
>  if test "$_jack" = auto ; then
>    _jack=no
> -  if ( pkg-config --modversion jack > /dev/null 2>&1 ) &&
> -     jackd --version | grep version | awk '{ print $3 }' >> "$TMPLOG" 2>&1 ; then
>  
>  cat > $TMPC << EOF
>  #include <jack/jack.h>
>  int main(void) { jack_client_new("test"); return 0; }
>  EOF
> -	cc_check `pkg-config --libs --cflags jack` && "$TMPO" >> "$TMPLOG" 2>&1 && _jack=yes
> -fi
> +  _jack=yes

_jack was set to no 5 lines above, why not set it to yes in the
beginnning?

> @@ -5513,7 +5446,10 @@
>    fi
>    # internal faad: check if our dear gcc is able to compile it...
>    cp "`pwd`/libfaad2/cfft.c" $TMPC
> -  if ( cc_check -c -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer -D_GNU_SOURCE $_inc_faad ); then
> +  if test "$_lrintf" = yes ; then
> +    _faad_extra=-DHAVE_LRINTF
> +  fi
> +  if ( cc_check -c -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer -D_GNU_SOURCE $_inc_faad $_faad_extra); then

Hmm, why?

The rest of the patch is great, please apply shortly.

Diego




More information about the MPlayer-dev-eng mailing list