[2/2,v2] configure: use test_pkg_config() for the SDL check

Message ID 20170930015609.10952-2-jamrial@gmail.com
State New
Headers show

Commit Message

James Almer Sept. 30, 2017, 1:56 a.m.
Removes the extra code to preserve global cflags and extralibs.

Signed-off-by: James Almer <jamrial@gmail.com>
---
Removed the bogus avplay_extralibs line. It's added automatically as sdl is
listed as a dependency of avplay.

 configure | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Diego Biurrun Oct. 2, 2017, 9:48 a.m. | #1
On Fri, Sep 29, 2017 at 10:56:09PM -0300, James Almer wrote:
> --- a/configure
> +++ b/configure
> @@ -4873,10 +4873,7 @@ fi
>  
>  # SDL is "special" and adds some CFLAGS that should not pollute anything else.
>  if enabled avplay; then
> -    CFLAGS_SAVE=$CFLAGS
> -    check_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent &&
> -    sdl_cflags=$pkg_cflags
> -    CFLAGS=$CFLAGS_SAVE
> +    test_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent
>  fi

Uh, no. You're adding the CFLAGS globally. That's the very thing this,
admittedly, hack tries to prevent.

Diego
James Almer Oct. 2, 2017, 2:10 p.m. | #2
On 10/2/2017 6:48 AM, Diego Biurrun wrote:
> On Fri, Sep 29, 2017 at 10:56:09PM -0300, James Almer wrote:
>> --- a/configure
>> +++ b/configure
>> @@ -4873,10 +4873,7 @@ fi
>>  
>>  # SDL is "special" and adds some CFLAGS that should not pollute anything else.
>>  if enabled avplay; then
>> -    CFLAGS_SAVE=$CFLAGS
>> -    check_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent &&
>> -    sdl_cflags=$pkg_cflags
>> -    CFLAGS=$CFLAGS_SAVE
>> +    test_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent
>>  fi
> 
> Uh, no. You're adding the CFLAGS globally. That's the very thing this,
> admittedly, hack tries to prevent.

No. I'm using test_pkg_config(), added in the last patch, which will set
sdl_cflags but not affect global CFLAGS.

Patch

diff --git a/configure b/configure
index cd60ae865..4b359ffec 100755
--- a/configure
+++ b/configure
@@ -4873,10 +4873,7 @@  fi
 
 # SDL is "special" and adds some CFLAGS that should not pollute anything else.
 if enabled avplay; then
-    CFLAGS_SAVE=$CFLAGS
-    check_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent &&
-    sdl_cflags=$pkg_cflags
-    CFLAGS=$CFLAGS_SAVE
+    test_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent
 fi
 
 ! disabled pod2man   && check_cmd pod2man --help     && enable pod2man   || disable pod2man