[FFmpeg-devel] [PATCH] fix post r9988 Cygwin builds

Måns Rullgård mans
Sat Aug 11 22:36:56 CEST 2007


Ramiro Polla <ramiro at lisha.ufsc.br> writes:

> M?ns Rullg?rd wrote:
>> Ramiro Polla <ramiro at lisha.ufsc.br> writes:
>>
>>
>>> M?ns Rullg?rd wrote:
>>>
>>>> Ramiro Polla <ramiro at lisha.ufsc.br> writes:
>>>>
>>>>> Two patches attached.
>>>>>
>>>>> Ramiro Polla
>>>>> Index: configure
>>>>> ===================================================================
>>>>> --- configure	(revision 10072)
>>>>> +++ configure	(working copy)
>>>>> @@ -1537,7 +1537,7 @@
>>>>>  check_header termios.h
>>>>>  check_header conio.h
>>>>>
>>>>> -check_header arpa/inet.h
>>>>> +check_header arpa/inet.h ||
>>>>>  check_header winsock2.h
>>>>>
>>>> Why the || ?
>>>>
>>> This is the fix for Cygwin, which has both arpa/inet.h and
>>> winsock2.h. It can't use both.
>>
>> Shouldn't some ifdeffery in the code take care of that?
>
> Are you seriously suggesting that you'd prefer ifdeffery? You'll be
> contradicting yourself if you do. Just in case you really want to
> consider it, attached is ifdeffery.diff

I would have thought something like this would do it:

#ifdef HAVE_ARPA_INET_H
/* standard network stuff */
#elif defined HAVE_WINSOCK2_H
/* winsock stuff */
#else
/* no network stuff, if needed */
#endif

>>>>>  check_func inet_aton
>>>>> Index: configure
>>>>> ===================================================================
>>>>> --- configure	(revision 10072)
>>>>> +++ configure	(working copy)
>>>>> @@ -766,6 +766,7 @@
>>>>>  libxvid_encoder_deps="libxvid"
>>>>>
>>>>>  # demuxers / muxers
>>>>> +network_deps_any="arpa_inet_h winsock2_h"
>>>>>
>>>> Wrong place.
>>>>
>>> Indeed, I'll put it in alphabetical order. Is it wrong because it's
>>> not in alphabetical order, or because of something else?
>>>
>>
>> Placing it in the protocols section a little further down seems more
>> logical to me.
>>
>>
>
> network_deps_any.diff attached. What will the dependency checker do if
> it has checked something that depend on network, and later on, when
> network is checked for, it sees that network isn't supposed to be
> enabled?

Dependencies are checked depth-first, so the dependencies of network
will be checked immediately if it is encountered as a dependency for
something else.

> have_winsock2.diff is another possible way. It checks for winsock2_h,
> and only enables winsock2 in case arpa_inet_h wasn't found. It's not
> big enough to require CONFIG_, because in that case network wouldn't
> be enabled by default on MinGW builds.

I don't like this.  It should be possible to make network.h favour
arpa/inet.h over winsock2.h without any special actions from
configure.

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




More information about the ffmpeg-devel mailing list