configure: Add argc, argv to the main function signature in check_func_headers

Message ID 4D84B937.4070500@gentoo.org
State Superseded
Headers show

Commit Message

Luca Barbato March 19, 2011, 2:09 p.m.
On 03/19/2011 02:33 PM, Martin Storsjö wrote:
> I tried that, but that ends up with a duplicate symbol error for the main 
> symbol.
> 
> Is there any flag to make gcc accept the issue that the function was 
> defined with different parameters earlier, that could be added to this 
> test?

This seems to work for me, could you try it as well?

     check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable
sdl_video_size
 fi

Comments

Mans Rullgard March 19, 2011, 2:11 p.m. | #1
Luca Barbato <lu_zero@gentoo.org> writes:

> On 03/19/2011 02:33 PM, Martin Storsjö wrote:
>> I tried that, but that ends up with a duplicate symbol error for the main 
>> symbol.
>> 
>> Is there any flag to make gcc accept the issue that the function was 
>> defined with different parameters earlier, that could be added to this 
>> test?
>
> This seems to work for me, could you try it as well?
>
> diff --git a/configure b/configure
> index 2515c9f..a06734b 100755
> --- a/configure
> +++ b/configure
> @@ -2890,8 +2890,8 @@ if enabled libdc1394; then
>      die "ERROR: No version of libdc1394 found "
>  fi
>
> -if check_pkg_config sdl SDL.h SDL_Init; then

Only this one needs to be changed.  The others don't use main().

> -    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 |
> SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
> +if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then
> +    check_cpp_condition SDL_version.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
>  fi

Patch

diff --git a/configure b/configure
index 2515c9f..a06734b 100755
--- a/configure
+++ b/configure
@@ -2890,8 +2890,8 @@  if enabled libdc1394; then
     die "ERROR: No version of libdc1394 found "
 fi

-if check_pkg_config sdl SDL.h SDL_Init; then
-    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 |
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
+if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then
+    check_cpp_condition SDL_version.h "(SDL_MAJOR_VERSION<<16 |
SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
     enable sdl &&