[FFmpeg-devel] ffplay failed to build under mingw32 (and under OS X)

Hanspeter Niederstrasser niederstrasser at gmail.com
Sun May 15 16:38:04 CEST 2011


> after "configure: Revert sdl hunk of 4fa18c56. This breaks OSX"
> (http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=ca87d439065c705311d0a98076df3c021b187adb)
> ffplay is stopped to build. That happens because of SDL check fail. To
> be more precise it fail in a check:
>
> /.../
> check_func_headers SDL.h SDL_Init $sdl_cflags $sdl_libs &&
> /.../
>
> that give in config.log message:
>
> /.../
> check_func_headers SDL.h SDL_Init
> -I/usr/i686-pc-mingw32/sys-root/mingw/include/SDL -D_GNU_SOURCE=1
> -Dmain=SDL_main -lmingw32 -lSDLmain -lSDL -mwindows
> check_ld -I/usr/i686-pc-mingw32/sys-root/mingw/include/SDL
> -D_GNU_SOURCE=1 -Dmain=SDL_main -lmingw32 -lSDLmain -lSDL -mwindows
> check_cc -I/usr/i686-pc-mingw32/sys-root/mingw/include/SDL
> -D_GNU_SOURCE=1 -Dmain=SDL_main -mwindows
> BEGIN /tmp/ffconf.CKUleDYo.c
>      1 #include <SDL.h>
>      2 long check_SDL_Init(void) { return (long) SDL_Init; }
>      3 int main(void) { return 0; }
> END /tmp/ffconf.CKUleDYo.c
> ccache i686-pc-mingw32-gcc -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
> -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ --static
> -I/var/www/users/research/ffmpeg/snapshots/build/include -std=c99
> -fno-common -fomit-frame-pointer
> -I/usr/i686-pc-mingw32/sys-root/mingw/include/SDL -D_GNU_SOURCE=1
> -Dmain=SDL_main -mwindows -c -o /tmp/ffconf.PXRBqhG8.o
> /tmp/ffconf.CKUleDYo.c
> /tmp/ffconf.CKUleDYo.c:3:5: error: conflicting types for 'SDL_main'
> /usr/i686-pc-mingw32/sys-root/mingw/include/SDL/SDL_main.h:53:12: note:
> previous declaration of 'SDL_main' was here
> /.../

The same error happens on OS X (10.5/i386 with SDL-1.2.14 built
locally), but presumably also happens on other OS X versions.

My solution was to have check_func_headers() test for the same things
as in the pkg-config based check in the conditional (which does work
on OS X if I force the conditional to not use sdl-config):

diff --git a/configure b/configure
index 2fa0f3a..eda7909 100755
--- a/configure
+++ b/configure
@@ -2937,17 +2937,17 @@ if enabled libdc1394; then
         enable libdc1394_1; } ||
     die "ERROR: No version of libdc1394 found "
 fi

 SDL_CONFIG="${cross_prefix}sdl-config"
 if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
     sdl_cflags=$("${SDL_CONFIG}" --cflags)
     sdl_libs=$("${SDL_CONFIG}" --libs)
-    check_func_headers SDL.h SDL_Init $sdl_cflags $sdl_libs &&
+    check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags
$sdl_libs &&
     check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 |
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
     enable sdl &&
     check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable
sdl_video_size
 else
     if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then
         check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 |
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
         enable sdl &&
         check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags &&
enable sdl_video_size

For the record, I also independently tried Maksym's 2nd patch to
directly modify the check_func_headers function

> -        echo "int main(void) { return 0; }"
> +        echo "int main(int argc, char** argv) { return 0; }"

and that also re-enabled SDL.

Hanspeter

--
Disclaimer:
By sending an email to ANY of my addresses you are agreeing that:
1. I am by definition, "the intended recipient"
2. All information in the email is mine to do with as I see fit and
make such financial profit, political mileage, or good joke as it
lends itself to.
3. I may take the contents as representing the views of your company.
4. This overrides any disclaimer or statement of confidentiality that
may be included with your message.


More information about the ffmpeg-devel mailing list