[FFmpeg-devel] [PATCH] FATE tests don't build when SDL is installed (Win7 with MinGW32).

Michael Niedermayer michaelni at gmx.at
Sat Mar 8 02:51:29 CET 2014


On Fri, Mar 07, 2014 at 05:38:09PM -0500, gregory.wolfe at kodakalaris.com wrote:
> > On Tue, Mar 04, 2014 at 02:21:22PM -0500, gregory.wolfe at kodakalaris.com 
> wrote:
> > > A while back I submitted a bug tracker ticket for this (#3368).  Since 
> I
> > > have already done the work, I figured I might as well share it.
> > > 
> > > 
> > > Patched files:  46 source files (see .patch file attached)
> > > Description (from commit message):
> > > 
> > > Documented in ticket #3368, same problem as described in ticket #256.
> > > When SDL is being used, compile flags include -Dmain=SDL_main, which
> > > causes problems for FATE test programs.  Applied same fix as in #256:
> > > if building using MinGW32, simply #undef main prior to 
> main(argc,argv).
> > [...]
> > > diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
> > > index 6308348..a34bee2 100644
> > > --- a/libavcodec/dct-test.c
> > > +++ b/libavcodec/dct-test.c
> > > @@ -541,6 +541,10 @@ static void help(void)
> > >  #include "compat/getopt.c"
> > >  #endif
> > > 
> > > +#ifdef __MINGW32__
> > > +#undef main /* We don't want SDL to override our main() */
> > > +#endif
> > > +
> > >  int main(int argc, char **argv)
> > >  {
> > >      int test_idct = 0, test_248_dct = 0;
> > 
> > adding this same "hack" to every file is kind of ugly
> > cant the "-Dmain=SDL_main" thing be filtered out of the flags or
> > overridden?
> > 
> > [...]
> > 
> > -- 
> > Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Michael:
>  
> After some more poking around, I found that the following command line
> fixes the above problem without having to modify the source code:
> 
>     make fate SAMPLES=fate-suite/ CC_C="-c -Umain"
> 
> So maybe the path-of-least-resistance to resolve this is to just
> update the FATE documentation page at
> http://ffmpeg.mplayerhq.hu/fate.html to note that in a Windows
> environment, with SDL installed, you need to use CC_C="-c -Umain"
> on the make command(actually, you need to look at configure, see what the 
> current
> value of CC_C is, and add "-Umain").
> 
> A solution that would require somewhat more effort would modify
> ffmpeg/tests/Makefile to accomplish the same thing when doing a
> "make fate".  I'm OK with just updating the documentation.

It would be ideal if it would work out of the box without the user
needing to find this in the documentation

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140308/82737bff/attachment.asc>


More information about the ffmpeg-devel mailing list