diff mbox

[FFmpeg-devel] configure: fail if sdl2 was requested but not found

Message ID 5c6dfd73-bf3c-3951-54ac-d6817e0b28d9@googlemail.com
State Superseded
Headers show

Commit Message

Andreas Cadhalpun Nov. 22, 2016, 10:15 p.m. UTC
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
---
 configure | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Carl Eugen Hoyos Nov. 22, 2016, 10:30 p.m. UTC | #1
2016-11-22 23:15 GMT+01:00 Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>:

>  disabled sdl && disable sdl2
> +enabled sdl2 && sdl_requested=yes

I consider this ugly and it makes sdl different to all other system
libraries: Why?

Carl Eugen
Andreas Cadhalpun Nov. 22, 2016, 10:33 p.m. UTC | #2
On 22.11.2016 23:30, Carl Eugen Hoyos wrote:
> 2016-11-22 23:15 GMT+01:00 Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>:
> 
>>  disabled sdl && disable sdl2
>> +enabled sdl2 && sdl_requested=yes
> 
> I consider this ugly

That is very subjective.

> and it makes sdl different to all other system libraries: Why?

Because it avoids confusing users. And the checks for other system
libraries should do this, too.

Best regards,
Andreas
Josh Dekker Nov. 22, 2016, 10:43 p.m. UTC | #3
On 22/11/2016 22:33, Andreas Cadhalpun wrote:
> On 22.11.2016 23:30, Carl Eugen Hoyos wrote:
>> 2016-11-22 23:15 GMT+01:00 Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>:
>>
>>>  disabled sdl && disable sdl2
>>> +enabled sdl2 && sdl_requested=yes
>>
>> I consider this ugly
>
> That is very subjective.
>

This goes both ways.

>> and it makes sdl different to all other system libraries: Why?
>
> Because it avoids confusing users. And the checks for other system
> libraries should do this, too.
>

I see no real reason to add this, but neither a reason to block it 
either. I personally think that it should stay as-is, or all other 
system libraries should have the same behavior as well. Consistency is key.
Andreas Cadhalpun Nov. 22, 2016, 11:11 p.m. UTC | #4
On 22.11.2016 23:43, Josh de Kock wrote:
> On 22/11/2016 22:33, Andreas Cadhalpun wrote:
>> Because it avoids confusing users. And the checks for other system
>> libraries should do this, too.
>>
> 
> I see no real reason to add this, but neither a reason to block it either.
> I personally think that it should stay as-is, or all other system libraries
> should have the same behavior as well.

Yes, I thinkg the other system library checks should be changed as well.

> Consistency is key.

However, the current behavior is already not consistent:
If a non-system library is enabled, but not found, configure fails.
If a system library is enabled, but not found, configure succeeds,
but later the build fails.

Best regards,
Andreas
Josh Dekker Nov. 22, 2016, 11:23 p.m. UTC | #5
On 22/11/2016 23:11, Andreas Cadhalpun wrote:
> On 22.11.2016 23:43, Josh de Kock wrote:
>> On 22/11/2016 22:33, Andreas Cadhalpun wrote:
>>> Because it avoids confusing users. And the checks for other system
>>> libraries should do this, too.
>>>
>>
>> I see no real reason to add this, but neither a reason to block it either.
>> I personally think that it should stay as-is, or all other system libraries
>> should have the same behavior as well.
>
> Yes, I thinkg the other system library checks should be changed as well.
>> Consistency is key.

I meant within the two types of libraries we have, system and 
non-system. (Which are different things, and therefore have been handled 
as such).
wm4 Nov. 23, 2016, 1:11 a.m. UTC | #6
On Tue, 22 Nov 2016 23:30:38 +0100
Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:

> 2016-11-22 23:15 GMT+01:00 Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>:
> 
> >  disabled sdl && disable sdl2
> > +enabled sdl2 && sdl_requested=yes  
> 
> I consider this ugly and it makes sdl different to all other system
> libraries: Why?

Wait a moment, SDL is not a system library. Like, not at all.
Andreas Cadhalpun Nov. 30, 2016, 11:24 p.m. UTC | #7
On 23.11.2016 00:23, Josh de Kock wrote:
> On 22/11/2016 23:11, Andreas Cadhalpun wrote:
>> On 22.11.2016 23:43, Josh de Kock wrote:
>>> On 22/11/2016 22:33, Andreas Cadhalpun wrote:
>>>> Because it avoids confusing users. And the checks for other system
>>>> libraries should do this, too.
>>>>
>>>
>>> I see no real reason to add this, but neither a reason to block it either.
>>> I personally think that it should stay as-is, or all other system libraries
>>> should have the same behavior as well.
>>
>> Yes, I thinkg the other system library checks should be changed as well.
>>> Consistency is key.
> 
> I meant within the two types of libraries we have, system and non-system.
> (Which are different things, and therefore have been handled as such).

I've just sent a patch doing this for all autodetected libraries (which are
not necessarily system libraries).

Best regards,
Andreas
diff mbox

Patch

diff --git a/configure b/configure
index 7d094df..0d85a54 100755
--- a/configure
+++ b/configure
@@ -5846,7 +5846,9 @@  if enabled gcrypt; then
 fi
 
 disabled sdl && disable sdl2
+enabled sdl2 && sdl_requested=yes
 if ! disabled sdl2; then
+    disable sdl2
     SDL2_CONFIG="${cross_prefix}sdl2-config"
     if check_pkg_config sdl2 SDL_events.h SDL_PollEvent; then
         check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
@@ -5867,6 +5869,8 @@  if ! disabled sdl2; then
 fi
 enabled sdl2 && add_cflags $sdl2_cflags && add_extralibs $sdl2_libs
 
+[ "x$sdl_requested" = "xyes" ] && ! enabled sdl2 && die "ERROR: libsdl2 requested but not found";
+
 disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
     check_lib2 "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
     enable securetransport; }