[Buildroot] [PATCH 02/18] package/mplayer: add optional giflib support

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Mon Mar 30 21:06:06 UTC 2015


Hello,

On Mon, 30 Mar 2015 22:56:58 +0200, Thomas Petazzoni wrote:

> > +ifeq ($(BR2_PACKAGE_GIFLIB),y)
> > +MPLAYER_DEPENDENCIES += giflib
> > +MPLAYER_EXTRA_LIBS += -lgif
> > +endif
> 
> Any reason not to use --enable-gif / --disable-gif here? Then you don't
> need to pass a --extra-libs value. I've applied the patch with this
> change, as it seems to build fine. Let me know if that causes a problem.

Hum, looking at the ncurses case, things seem to be a bit annoying:

echocheck "termcap"
if test "$_termcap" = auto ; then
  _termcap=no
  for ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
    statement_check term.h 'tgetent(0, 0)' $ld_tmp &&
      extra_ldflags="$extra_ldflags $ld_tmp" && _termcap=yes && break
  done
fi
if test "$_termcap" = yes ; then
  def_termcap='#define HAVE_TERMCAP 1'
  test $ld_tmp && res_comment="using $ld_tmp"
else
  def_termcap='#undef HAVE_TERMCAP'
fi
echores "$_termcap"

So, if you explicitly pass --enable-termcap, autodetection is not done,
and you have to pass -lncurses explicitly in --extra-libs. Otherwise,
if you don't use --enable-termcap and let the autodetection do its
work, it detects -lncurses automatically.

So I'm not sure which one to choose:

 *) Autodetection, which avoids the need for passing explicit -l<foo>
 values, but has the drawback of autodetection: we're not explicitly
 saying which features we want to enable, which may cause mis-use of
 certain libraries.

 *) No autodetection, which forces us to pass the proper -l<foo> value
 for each dependency.

Opinions?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


More information about the buildroot mailing list