[FFmpeg-devel] [PATCH] Check for the winsock library name

Måns Rullgård mans
Tue Jul 14 14:09:21 CEST 2009


Martin Storsj? <martin at martin.st> writes:

> On Tue, 14 Jul 2009, M?ns Rullg?rd wrote:
>
>> check_func closesocket -lws2 && ... || ...
>
> So, is this ok, or should the "check_func_headers winsock2.h closesocket" 
> line still be kept for some reason? The check_header winsock2.h above will 
> enable that if it is found, and this check enables closesocket, so as far 
> as I can tell, this replaces the check_func_headers call.
>
> // Martin
>
> ---
>  configure |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 79f5695..3d7a8ed 100755
> --- a/configure
> +++ b/configure
> @@ -2220,9 +2220,9 @@ if enabled network; then
>      if check_header arpa/inet.h ; then
>          check_func closesocket
>      elif check_header winsock2.h ; then
> -        network_extralibs="-lws2_32"
> +        check_func closesocket -lws2 && network_extralibs="-lws2" \
> +                                     || network_extralibs="-lws2_32"
>          check_type ws2tcpip.h socklen_t
> -        check_func_headers winsock2.h closesocket
>      else
>          disable network
>      fi

This will only enable closesocket in the -lws2 case.  Try this:

    check_func_headers winsock2.h closesocket -lws2 &&
        network_extralibs="-lws2" ||
    { check_func_headers winsock2.h closesocket -lws2_32 &&
        network_extralibs="-lws2_32"; }

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list