[PATCH] FATE tests don't build when SDL is installed (Win7 with MinGW32).
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). Greg Wolfe, Kodak Alaris
On Tue, Mar 04, 2014 at 02:21:22PM -0500, gregory.wolfe@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 DNS cache poisoning attacks, popular search engine, Google internet authority dont be evil, please
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
On Tue, Mar 04, 2014 at 02:21:22PM -0500, gregory.wolfe@kodakalaris.com wrote: 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
In ticket #3368 I mentioned that it might be more elegant to fix this problem in the Makefile. After looking at the options for the configure script, I tried --extra-cflags=-Umain, but that did not work. Will keep looking for a better solution and get back to you. Greg Wolfe, Kodak Alaris
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
On Tue, Mar 04, 2014 at 02:21:22PM -0500, gregory.wolfe@kodakalaris.com wrote: 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. Greg Wolfe, Kodak Alaris
On Fri, Mar 07, 2014 at 05:38:09PM -0500, gregory.wolfe@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
On Tue, Mar 04, 2014 at 02:21:22PM -0500, gregory.wolfe@kodakalaris.com wrote: 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
participants (2)
-
gregory.wolfe@kodakalaris.com -
Michael Niedermayer