[FFmpeg-cvslog] r24156 - trunk/configure

Måns Rullgård mans
Sun Jul 11 03:00:19 CEST 2010


Ramiro Polla <ramiro.polla at gmail.com> writes:

> 2010/7/10 M?ns Rullg?rd <mans at mansr.com>:
>> Ramiro Polla <ramiro.polla at gmail.com> writes:
>>> The issue with vfwcap is that mingw32 did not have some necessary
>>> defines prior to w32api 3.12, and we had them as a hack in vfwcap.c
>>> (which have already been removed from our code). On 3.12 they
>>> integrated one patch from me which was utterly broken (my bad). On
>>> 3.13 they fixed it. We can remove this version check and check for the
>>> cpp condition (WM_CAP_DRIVER_CONNECT > WM_USER) instead.
>>>
>>> It should be possible to do:
>>> check_cpp_condition vfw.h "(WM_CAP_DRIVER_CONNECT > WM_USER)" ||
>>> disable vfwcap_indev
>>> but that doesn't look clean. We could also enable something on that
>>> cpp condition and add it to vfwcap_index_deps. Suggestions?
>>
>> I'd go with an intermediate property and _deps as you suggest. ?I'll
>> leave picking a name to you as I don't really know what we're checking
>> for here. ?The name should probably contain vfw though.
>
> Patch attached. We should also add a comment so that we don't forget
> why the check works that way. Possibly:
> # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
> # w32api 3.12 had it defined wrong

Yeah, it's pretty obscure otherwise.  Working sounds good to me.

>>> The mingw runtime issue is a little different. The MS runtime provides
>>> strtod(), but it is not c99-compliant and fails for us. There is a
>>> replacement c99-compliant strtod() on MinGW exported as __strtod(). On
>>> mingw32 >= 3.15 there is a hack that chooses the c99-compliant one by
>>> default, but the mingw32 devs have expressed interest in reverting
>>> that change. Since mingw-w64 was forked before that change, it also
>>> fails on strtod() for us. I've been asking the mingw-w64 developers to
>>> also make this change under some ISOC99 ifdef, but they have not done
>>> it yet.
>>
>> Is there any compilation test we can do to detect this? ?I suspect not...
>
> I don't think so either... Two ideas that come to mind are running a
> test program (which is obviously not ok because of cross-compilation),
> and testing to see if the symbol from msvcrt is used instead of from
> another library (libmingwex), which is way too hackish.
>
>>> What we could do is define strtod as __strtod as to always pick the
>>> c99-compliant one. This would make both mingw32 and mingw-w64 work
>>> without version checks.
>>
>> That might be trickier than it seems. ?Defining that before including
>> stdlib.h would probably cause some kind of name clash.
>
> Adding a "add_cflags strtod=__strtod" to configure works with mingw32
> and mingw-w64.

Hmm, I would have expected odd things when including stdlib.h with
that definition.

>> To me this is a clear case of broken OS which should be fixed at the
>> source or patched outside of individual apps. ?Surely ffmpeg isn't the
>> only user of strtod(). ?That said, I know windows users are hesitant
>> to patch their systems, so a minimally intrusive workaround here could
>> be acceptable, at least until upstream is fixed.
>
> A patch was applied to mingw-w64 today for this. It hasn't been
> thoroughly tested though and might be reverted if it has any unwanted
> side effects.

That's good news.

> Index: configure
> ===================================================================
> --- configure	(revision 24181)
> +++ configure	(working copy)
> @@ -1362,7 +1362,7 @@
>  oss_outdev_deps_any="soundcard_h sys_soundcard_h"
>  v4l_indev_deps="linux_videodev_h"
>  v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
> -vfwcap_indev_deps="capCreateCaptureWindow"
> +vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
>  vfwcap_indev_extralibs="-lavicap32"
>  x11_grab_device_indev_deps="x11grab XShmCreateImage"
>  x11_grab_device_indev_extralibs="-lX11 -lXext -lXfixes"
> @@ -2274,9 +2274,6 @@
>          if ! check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR)"; then
>              check_cpp_condition _mingw.h "(__MINGW32_MAJOR_VERSION > 3) || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
>                  die "ERROR: MinGW runtime version must be >= 3.15."

Now those two checks can be folded into one.

> -            enabled_any vfwcap_indev &&
> -                { check_cpp_condition w32api.h "(__W32API_MAJOR_VERSION > 3) || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION >= 13)" ||
> -                  die "ERROR: vfwcap_indev requires w32api version 3.13 or later."; }
>          fi
>          ;;
>      cygwin*)
> @@ -2721,6 +2718,7 @@
>  check_header sys/videoio.h
>  
>  check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
> +check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
>  
>  # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
>  { check_header dev/bktr/ioctl_meteor.h &&

Patch OK.

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



More information about the ffmpeg-cvslog mailing list