[FFmpeg-devel] [PATCH 1/2] configure: support --disable-sdl

Michael Niedermayer michaelni at gmx.at
Tue Sep 23 02:27:21 CEST 2014


On Tue, Sep 23, 2014 at 01:01:26AM +0200, Reimar Döffinger wrote:
> On Tue, Sep 23, 2014 at 12:42:53AM +0200, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  configure |   33 ++++++++++++++++++---------------
> >  1 file changed, 18 insertions(+), 15 deletions(-)
> > 
> > diff --git a/configure b/configure
> > index 12b2da5..f674a06 100755
> > --- a/configure
> > +++ b/configure
> > @@ -1388,6 +1388,7 @@ EXTERNAL_LIBRARY_LIST="
> >      opencl
> >      opengl
> >      openssl
> > +    sdl
> >      x11grab
> >      xlib
> >      zlib
> > @@ -4909,21 +4910,23 @@ if enabled libdc1394; then
> >          enable libdc1394_1; } ||
> >      die "ERROR: No version of libdc1394 found "
> >  fi
> > -
> > -SDL_CONFIG="${cross_prefix}sdl-config"
> > -if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
> > -    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
> > -    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
> > -    enable sdl
> > -else
> > -  if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
> > -    sdl_cflags=$("${SDL_CONFIG}" --cflags)
> > -    sdl_libs=$("${SDL_CONFIG}" --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 &&
> > -    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
> > -    enable sdl
> > -  fi
> > +if ! disabled sdl; then
> > +    disable sdl
> > +    SDL_CONFIG="${cross_prefix}sdl-config"
> > +    if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
> > +        check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
> > +        check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
> > +        enable sdl
> > +    else
> > +        if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
> > +            sdl_cflags=$("${SDL_CONFIG}" --cflags)
> > +            sdl_libs=$("${SDL_CONFIG}" --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 &&
> > +            check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
> > +            enable sdl
> > +        fi
> > +    fi
> >  fi
> 
> Maybe more readable if you do reindentation separately?

yes, will do


> Because I was going to suggest to use elif until I saw that that part
> is not actually used.

> Also doesn't this patch also add --enable-sdl? Seems it will be ignored,
> shouldn't we rather fail if --enable-sdl was given but we do not find
> it? I believe that is how FFmpeg configure normally behaves.

posted a seperate patch for that

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140923/1eb12e1a/attachment.asc>


More information about the ffmpeg-devel mailing list