Skip to content
Snippets Groups Projects
configure.ac 190 KiB
Newer Older
        VLC_ADD_CPPFLAGS([mux_ts ts dvb],[-I${real_dvbpsi_tree}/src])
        VLC_ADD_LDFLAGS([mux_ts ts dvb],[${real_dvbpsi_tree}/src/.libs/libdvbpsi.a])
      else
        dnl  The given libdvbpsi wasn't built
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
      fi
    dnl  Compile without dvbpsi
  ;;
  *)
    AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
Samuel Hocevar's avatar
Samuel Hocevar committed
    if test -z "${with_dvbpsi}"
      LDFLAGS_test="-L${with_dvbpsi}/lib"
      CPPFLAGS_test="-I${with_dvbpsi}/include"
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
Samuel Hocevar's avatar
Samuel Hocevar committed
    AC_CHECK_HEADERS([dvbpsi/dr.h],[
      VLC_ADD_PLUGINS([ts])
      if test "${enable_sout}" != "no"; then
        VLC_ADD_PLUGINS([mux_ts])
      VLC_ADD_CPPFLAGS([mux_ts ts dvb],[${CPPFLAGS_test}])
      VLC_ADD_LDFLAGS([mux_ts ts dvb],[${LDFLAGS_test} -ldvbpsi])
Samuel Hocevar's avatar
Samuel Hocevar committed
    ],[
Samuel Hocevar's avatar
Samuel Hocevar committed
      if test -n "${enable_dvbpsi}"
      then
        AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
      fi
    ])
  AC_CHECK_LIB(dvbpsi, dvbpsi_GenSDTSections, [
    AC_DEFINE(HAVE_DVBPSI_SDT, 1, [Define if you have dvbpsi_GenSDTSections.])
  ], [], [${LDFLAGS_ts}])

dnl
dnl  Video4Linux plugin
dnl
AC_ARG_ENABLE(v4l,
  [  --enable-v4l            Video4Linux input support (default disabled)])
if test "${enable_v4l}" = "yes"
  AC_ARG_WITH(v4l,
    [    --with-v4l=PATH       path to a v4l-enabled kernel tree],[],[])
Samuel Hocevar's avatar
Samuel Hocevar committed
  if test "${with_v4l}" != "no" -a -n "${with_v4l}"
    VLC_ADD_CPPFLAGS([v4l],[-I${with_v4l}/include])
  fi

  CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_v4l}"
  AC_CHECK_HEADERS(linux/videodev.h, [
    VLC_ADD_PLUGINS([v4l])
  ],[])
  CPPFLAGS="${CPPFLAGS_save}"
dnl
dnl  Video4Linux plugin
dnl
AC_ARG_ENABLE(v4l2,
bigben's avatar
bigben committed
  [  --enable-v4l2            Video4Linux2 input support (default disabled)])
if test "${enable_v4l2}" = "yes"
then
  AC_ARG_WITH(v4l2,
    [    --with-v4l2=PATH       path to a v4l2-enabled kernel tree],[],[])
  if test "${with_v4l2}" != "no" -a -n "${with_v4l2}"
  then
    VLC_ADD_CPPFLAGS([v4l2],[-I${with_v4l2}/include])
  fi

  CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_v4l2}"
  AC_CHECK_HEADERS(linux/videodev2.h, [
    VLC_ADD_PLUGINS([v4l2])
  ],[])
  CPPFLAGS="${CPPFLAGS_save}"
fi


dnl
dnl  special access module for Hauppauge PVR cards
dnl
AC_ARG_ENABLE(pvr,
  [  --enable-pvr            PVR cards access module (default disabled)])
if test "${enable_pvr}" = "yes"
  VLC_ADD_PLUGINS([pvr])
bigben's avatar
bigben committed
dnl
dnl  gnomeVFS access module
dnl
AC_ARG_ENABLE(gnomevfs,
  [  --enable-gnomevfs       GnomeVFS access module (default enabled)])
if test "${enable_gnomevfs}" != "no" 
bigben's avatar
bigben committed
then
  PKG_CHECK_MODULES(GNOMEVFS, gnome-vfs-2.0,
    VLC_ADD_LDFLAGS([access_gnomevfs],[$GNOMEVFS_LIBS])
    VLC_ADD_CPPFLAGS([access_gnomevfs],[$GNOMEVFS_CPPFLAGS])
    VLC_ADD_CFLAGS([access_gnomevfs],[$GNOMEVFS_CFLAGS])
    VLC_ADD_PLUGINS([access_gnomevfs]),
    AC_MSG_WARN([GnomeVFS support disabled because GnomeVFS development headers not found]))
dnl Need to test libcdio and libvcdinfo for a number of things. Do it now.
AC_ARG_ENABLE(libcdio,
  [  --enable-libcdio        CD input and control library support (default enabled)])
have_libcdio=no
have_libvcdinfo=no
if test "${enable_libcdio}" != "no"
then
  PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.78.2,
     have_libcdio=yes
     AC_DEFINE(HAVE_LIBCDIO, [], 
     [Define if you have libcdio 0.78.2 or greater installed]),
     [AC_MSG_WARN(CD Reading and information library not found)])
  PKG_CHECK_MODULES(VCDINFO, libvcdinfo >= 0.7.22,
     [Define if you have libvcdinfo 0.7.22 or greater installed])],
     [AC_MSG_WARN(VCD information library not found)])
dnl
dnl  VCDX and CDDAX modules
dnl
AC_ARG_ENABLE(cddax,
  [  --enable-cddax          audio CD plugin with CD Text and CD paranoia via libcdio (default disabled)])
  [  --enable-libcddb        CDDB support for libcdio audio CD (default enabled)])
if test "${enable_cddax}" = "yes"
  if test "$have_libcdio" = "yes"
  then
    AC_DEFINE(HAVE_CDDAX, [], [Define for the audio CD plugin using libcdio])
    VLC_ADD_LDFLAGS([cddax],[$LIBCDIO_LIBS])
    VLC_ADD_CFLAGS([cddax],[$LIBCDIO_CFLAGS])
    PKG_CHECK_MODULES(LIBCDIO_PARANOIA, libcdio_paranoia >= 0.72, [
    VLC_ADD_LDFLAGS([cddax],[$LIBCDIO_CDDA_LIBS $LIBCDIO_CDDA_LIBS $LIBCDIO_PARANOIA_LIBS])],
    AC_MSG_WARN([CD Paranoia support disabled because no libcdio >= 0.72 found]))
  else 
    AC_MSG_WARN([cddax plugin disabled because ok libcdio library not found or disabled])
    HAVE_CDDAX=no
  fi
  if test "$enable_libcddb" != "no"; then
    PKG_CHECK_MODULES(LIBCDDB, libcddb >= 0.9.5, [
      HAVE_LIBCDDB=yes 
      AC_DEFINE(HAVE_LIBCDDB, [], [Define this if you have libcddb installed])
      VLC_ADD_LDFLAGS([cddax],[$LIBCDDB_LIBS])
      VLC_ADD_CFLAGS([cddax],[$LIBCDDB_CFLAGS])
      ],
      [AC_MSG_WARN(new enough libcddb not found. CDDB access disabled) 
      HAVE_LIBCDDB=no])
  fi
 
  [  --enable-vcdx           VCD with navigation via libvcdinfo (default disabled)])
if test "${enable_vcdx}" = "yes"
then
  if test "${have_libvcdinfo}" = "yes"
  then
    VLC_ADD_LDFLAGS([vcdx],[$VCDINFO_LIBS])
    VLC_ADD_CFLAGS([vcdx],[$VCDINFO_CFLAGS])
  else 
    AC_MSG_WARN([vcdx plugin disabled because ok libvcdinfo library not found or disabled])
    HAVE_VCDX=no
  fi
Rocky Bernstein's avatar
Rocky Bernstein committed
  PKG_CHECK_MODULES(LIBCDIO, libiso9660 >= 0.72,
   [VLC_ADD_LDFLAGS([vcdx],[$LIBISO9660_LIBS])
    VLC_ADD_CFLAGS([vcdx],[$LIBISO9660_CFLAGS])],
    [AC_MSG_WARN([vcdx plugin disabled because ok libiso9660 library not found])
  if test "$have_libvcdinfo" = "yes"
  then
    AC_DEFINE(HAVE_VCDX, [], 
    [Define for the VCD plugin using libcdio/libvcdinfo])
    VLC_ADD_LDFLAGS([vcdx],[$VCDINFO_LIBS])
    VLC_ADD_CFLAGS([vcdx],[$VCDINFO_CFLAGS])
    VLC_ADD_PLUGINS([vcdx])
  else 
    AC_MSG_WARN([vcdx plugin disabled because ok libvcdinfo library not found])
    HAVE_VCDX=no
  fi
dnl  Built-in CD-DA and VCD module
  [  --enable-cdda           audio CD via built-in VCD (default enabled)])
AC_ARG_ENABLE(vcd,
  [  --enable-vcd            built-in VCD (default enabled)])
if test "${enable_vcd}" != "no"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
then
  AC_MSG_CHECKING(for cdrom_msf0 in linux/cdrom.h)
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
    VLC_ADD_PLUGINS([vcd cdda])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  ])
  AC_MSG_CHECKING(for scsireq in sys/scsiio.h)
  AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
    VLC_ADD_PLUGINS([vcd cdda])
    AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
  AC_MSG_CHECKING(for ioc_toc_header in sys/cdio.h)
  AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
    VLC_ADD_PLUGINS([vcd cdda])
    AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
  if test "${SYS}" = "bsdi" -o "${SYS}" = "mingw32"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  then
    VLC_ADD_PLUGINS([vcd cdda])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  fi
  if test "${SYS}" = "darwin"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  then
    VLC_ADD_PLUGINS([vcd cdda])
    VLC_ADD_LDFLAGS([vcd vcdx cdda cddax],[-framework IOKit -framework CoreFoundation])
zorglub's avatar
zorglub committed
    VLC_ADD_LDFLAGS([vcdx cddax cdda],[-liconv])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  fi

  if test "$enable_libcddb" != "no"; then
    PKG_CHECK_MODULES(LIBCDDB, libcddb >= 0.9.5, [
      HAVE_LIBCDDB=yes 
      AC_DEFINE(HAVE_LIBCDDB, [], [Define this if you have libcddb installed])
      VLC_ADD_LDFLAGS([cdda],[$LIBCDDB_LIBS])
      VLC_ADD_CFLAGS([cdda],[$LIBCDDB_CFLAGS])
      ],:
      [AC_MSG_WARN(new enough libcddb not found. CDDB access disabled) 
      HAVE_LIBCDDB=no])
  fi
dnl
dnl  DVB-S/DVB-T/DVB-C satellite/teresterial/cable input using v4l2
dnl
AC_ARG_ENABLE(dvb,
  [  --enable-dvb            DVB-S/T/C card support (default disabled)])

if test "${enable_dvb}" = "yes"
then
  AC_ARG_WITH(dvb,
  [    --with-dvb=PATH       path to a dvb- and v4l2-enabled kernel tree],[],[])
  if test "${with_dvb}" != "no" -a -n "${with_dvb}"
  then
    VLC_ADD_CFLAGS([dvb],[-I${with_dvb}/include])
  CPPFLAGS="${CPPFLAGS_save} -I${with_dvb}/include"
  AC_CHECK_HEADERS(linux/dvb/version.h linux/dvb/frontend.h, [
    if test -z "${with_dvbpsi_tree}"
    then
      VLC_ADD_PLUGINS([dvb])
    else
      VLC_ADD_BUILTINS([dvb])
    fi
  ],[AC_MSG_WARN(linux-dvb headers not found, dvb disabled)])
dnl
dnl  Screen capture module
dnl
AC_ARG_ENABLE(screen,
  [  --enable-screen         Screen capture support (default enabled)])
Eric Petit's avatar
Eric Petit committed
  if test "${SYS}" = "darwin"; then
    AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
      VLC_ADD_PLUGINS([screen])
      VLC_ADD_LDFLAGS([screen],[-framework ApplicationServices])
    ])
Eric Petit's avatar
Eric Petit committed
  elif test "${SYS}" = "mingw32"; then
    VLC_ADD_PLUGINS([screen])
    VLC_ADD_LDFLAGS([screen],[-lgdi32])
  elif test "${SYS}" = "mingwce"; then
    CPPFLAGS="${CPPFLAGS_save}"
  elif test "${SYS}" = "beos"; then
    VLC_ADD_PLUGINS([screen])
    VLC_ADD_CXXFLAGS([screen],[])
    VLC_ADD_LDFLAGS([screen],[-lbe])
  else
    CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
    AC_CHECK_HEADERS(X11/Xlib.h, [
      VLC_ADD_PLUGINS([screen])
      VLC_ADD_LDFLAGS([screen],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext])
      VLC_ADD_CPPFLAGS([screen],[${X_CFLAGS}])
dnl  ipv6 plugin - not for QNX yet
have_ipv6=no
AC_CHECK_FUNCS(inet_pton,[have_ipv6=yes],[
  AC_CHECK_LIB(nsl,inet_pton, [have_ipv6=yes])
AS_IF([test "${have_ipv6}" = "yes"], [
  AC_DEFINE(HAVE_INET_PTON, 1, [Define to 1 if you have inet_pton().])])

if test "${SYS}" != "nto" &&
   test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
  AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
  AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
    [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=no])
  AS_IF([test "${have_ipv6}" != "no"], [
    VLC_ADD_PLUGINS([ipv6])])
if test "${SYS}" = "mingw32"
gbazin's avatar
 
gbazin committed
then
  AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
  AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
    VLC_ADD_PLUGINS([ipv6])],[AC_MSG_RESULT(no)])
gbazin's avatar
 
gbazin committed
fi
gbazin's avatar
 
gbazin committed
dnl
gbazin's avatar
 
gbazin committed
dnl  ogg demux plugin
gbazin's avatar
 
gbazin committed
dnl
AC_ARG_ENABLE(ogg,
  [  --enable-ogg            Ogg demux support (default enabled)])
if test "${enable_ogg}" != "no"
gbazin's avatar
 
gbazin committed
then
  [    --with-ogg-tree=PATH  ogg tree for static linking])
  if test -n "${with_ogg_tree}"
  then
    AC_MSG_CHECKING(for libogg.a in ${with_ogg_tree})
    real_ogg_tree="`cd ${with_ogg_tree} 2>/dev/null && pwd`"
    if test -z "${real_ogg_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_ogg_tree}])
    fi
    if test -f "${real_ogg_tree}/src/.libs/libogg.a"
    then
      dnl  Use a custom ogg
      AC_MSG_RESULT(${real_ogg_tree}/src/.libs/libogg.a)
      VLC_ADD_PLUGINS([ogg])
      if test "${enable_sout}" != "no"; then
        VLC_ADD_PLUGINS([mux_ogg])
      fi
      VLC_ADD_LDFLAGS([ogg mux_ogg speex vorbis],[${real_ogg_tree}/src/.libs/libogg.a])
      VLC_ADD_CFLAGS([ogg mux_ogg speex vorbis],[-I${real_ogg_tree}/include])
    else
      dnl  The given ogg wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_ogg_tree}/src/.libs/libogg.a, make sure you compiled ogg in ${with_ogg_tree}])
    fi
  else
    AC_CHECK_HEADERS(ogg/ogg.h, [
      AC_CHECK_LIB( ogg, oggpack_read, [
        VLC_ADD_PLUGINS([ogg])
        if test "${enable_sout}" != "no"; then
          VLC_ADD_PLUGINS([mux_ogg])
        fi
        VLC_ADD_LDFLAGS([ogg mux_ogg],[-logg])])
     ],[])
  fi
gbazin's avatar
 
gbazin committed
fi

gbazin's avatar
 
gbazin committed
dnl
dnl  matroska demux plugin
dnl
AC_ARG_ENABLE(mkv,
gbazin's avatar
 
gbazin committed
  [  --enable-mkv            Matroska demux support (default enabled)])
if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
Samuel Hocevar's avatar
Samuel Hocevar committed
  AC_LANG_PUSH(C++)
  AC_CHECK_HEADERS(ebml/EbmlVersion.h, [
    AC_MSG_CHECKING(for libebml version >= 0.7.6)
    AC_EGREP_CPP(yes,
      [#include <ebml/EbmlVersion.h>
       #ifdef LIBEBML_VERSION
       #if LIBEBML_VERSION >= 0x000706
       yes
       #endif
       #endif],
      [AC_MSG_RESULT([yes])
        AC_CHECK_HEADERS(matroska/KaxVersion.h, [
          AC_MSG_CHECKING(for libmatroska version >= 0.7.7)
          AC_EGREP_CPP(yes,
            [#include <matroska/KaxVersion.h>
             #ifdef LIBMATROSKA_VERSION
             #if LIBMATROSKA_VERSION >= 0x000705
             yes
             #endif
             #endif],
            [AC_MSG_RESULT([yes])
              AC_CHECK_HEADERS(matroska/KaxAttachments.h)
              VLC_ADD_CXXFLAGS([mkv],[])
              if test "${SYS}" = "darwin"; then
                VLC_ADD_CXXFLAGS([mkv],[-O1])
              fi
                VLC_ADD_LDFLAGS([mkv],[-lmatroska -lebml])
              ])
            ],
            [AC_MSG_RESULT([no])
              AC_MSG_ERROR([Your libmatroska is too old: you may get a more recent one from http://dl.matroska.org/downloads/libmatroska/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
          ])
Samuel Hocevar's avatar
Samuel Hocevar committed
        ])
      ],
      [AC_MSG_RESULT([no])
        AC_MSG_ERROR([Your libebml is too old: you may get a more recent one from http://dl.matroska.org/downloads/libebml/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
Samuel Hocevar's avatar
Samuel Hocevar committed
  ])
Samuel Hocevar's avatar
Samuel Hocevar committed
  AC_LANG_POP(C++)
gbazin's avatar
 
gbazin committed
fi

gbazin's avatar
 
gbazin committed
dnl
dnl  modplug demux plugin
dnl
AC_ARG_ENABLE(mod,
  [  --enable-mod            Mod demux support (default enabled)])
if test "${enable_mod}" != "no"
then
  AC_ARG_WITH(mod-tree,
  [    --with-mod-tree=PATH mod tree for static linking])
  if test -n "${with_mod_tree}"
  then
    AC_MSG_CHECKING(for libmodplug.a in ${with_mod_tree})
    real_mod_tree="`cd ${with_mod_tree} 2>/dev/null && pwd`"
    if test -z "${real_mod_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_mod_tree}])
    fi
    if test -f "${real_mod_tree}/src/.libs/libmodplug.a"
    then
      dnl  Use a custom mod
      AC_MSG_RESULT(${real_mod_tree}/src/.libs/libmodplug.a)
      VLC_ADD_PLUGINS([mod])
      VLC_ADD_LDFLAGS([mod],[${real_mod_tree}/src/.libs/libmodplug.a -lstdc++])
      VLC_ADD_CXXFLAGS([mod],[-I${real_mod_tree}/include])
    else
      dnl  The given mod wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_mod_tree}/src/.libs/libmodplug.a, make sure you compiled mod in ${with_mod_tree}])
    fi
  else
    AC_CHECK_HEADERS(libmodplug/modplug.h, [
      VLC_ADD_PLUGINS([mod])
      VLC_ADD_CXXFLAGS([mod],[])
      VLC_ADD_LDFLAGS([mod],[-lmodplug -lstdc++])])
gbazin's avatar
 
gbazin committed
fi

dnl
dnl  mpc demux plugin
dnl
AC_ARG_ENABLE(mpc,
  [  --enable-mpc            Mpc demux support (default enabled)])
if test "${enable_mpc}" != "no"
then
  AC_CHECK_HEADERS(mpcdec/mpcdec.h, [
    VLC_ADD_PLUGINS([mpc])
    VLC_ADD_LDFLAGS([mpc],[-lmpcdec])])
fi

dnl
dnl  game music emu demux plugin
dnl
AC_ARG_ENABLE(gme,
  [  --enable-gme            Game Music Emu demux support (default enabled)])
if test "${enable_gme}" != "no" -a "${CXX}" != "";
then
  AC_LANG_PUSH(C++)
  AC_ARG_WITH(gme-tree,
  [    --with-gme-tree=PATH gme tree for static linking])
  if test -n "${with_gme_tree}"
  then
    AC_MSG_CHECKING(for libgme.a in ${with_mod_tree})
    real_gme_tree="`cd ${with_gme_tree} 2>/dev/null && pwd`"
    if test -z "${real_gme_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_gme_tree}])
    fi
    if test -f "${real_gme_tree}/gme/libgme.a"
    then
      dnl  Use a custom gme
      AC_MSG_RESULT(${real_gme_tree}/gme/libgme.a)
      VLC_ADD_PLUGINS([gme])
      VLC_ADD_LDFLAGS([gme],[${real_gme_tree}/gme/libgme.a])
      VLC_ADD_CXXFLAGS([gme],[-I${real_gme_tree}/gme])
    else
      dnl  The given gme wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_mod_tree}/gme/libgme.a, make sure you compiled gme in ${with_gme_tree}])
    fi
  else
      AC_MSG_WARN([only static linking is available, you must provide a gme-tree])
  fi
  AC_LANG_POP(C++)
fi
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  Codec plugins
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed

Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_ARG_WITH(,[Codec plugins:])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  mad plugin
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_ARG_ENABLE(mad,
  [  --enable-mad            libmad module (default enabled)])
if test "${enable_mad}" != "no"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
then
  AC_ARG_WITH(mad,
gbazin's avatar
 
gbazin committed
    [    --with-mad=PATH       path to libmad],[],[])
Samuel Hocevar's avatar
Samuel Hocevar committed
  if test "${with_mad}" != "no" -a -n "${with_mad}"
gbazin's avatar
 
gbazin committed
  then
    VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${with_mad}/include])
    VLC_ADD_LDFLAGS([mpgatofixed32],[-L${with_mad}/lib])
gbazin's avatar
 
gbazin committed
  fi

  AC_ARG_WITH(mad-tree,
    [    --with-mad-tree=PATH   mad tree for static linking],[],[])
Samuel Hocevar's avatar
Samuel Hocevar committed
  if test "${with_mad_tree}" != "no" -a -n "${with_mad_tree}"
gbazin's avatar
 
gbazin committed
  then
    real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
Samuel Hocevar's avatar
Samuel Hocevar committed
    if test -z "${real_mad_tree}"
gbazin's avatar
 
gbazin committed
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
    fi
    dnl  Use a custom libmad
    AC_MSG_CHECKING(for mad.h in ${real_mad_tree})
    if test -f ${real_mad_tree}/mad.h
gbazin's avatar
 
gbazin committed
    then
      AC_MSG_RESULT(yes)
      VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${real_mad_tree}])
      VLC_ADD_LDFLAGS([mpgatofixed32],[-L${real_mad_tree}/.libs])
      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mpgatofixed32}"
gbazin's avatar
 
gbazin committed
      AC_CHECK_LIB(mad, mad_bit_init, [
        VLC_ADD_BUILTINS([mpgatofixed32])
        VLC_ADD_LDFLAGS([mpgatofixed32],[-lmad])
gbazin's avatar
 
gbazin committed
        ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
      ],[])
gbazin's avatar
 
gbazin committed
    else
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([the specified tree doesn't have mad.h])
    fi
  else
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mpgatofixed32}"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mpgatofixed32}"
gbazin's avatar
 
gbazin committed
    AC_CHECK_HEADERS(mad.h, ,
gbazin's avatar
 
gbazin committed
      [ AC_MSG_ERROR([Could not find libmad on your system: you may get it from http://www.underbit.com/products/mad/. Alternatively you can use --disable-mad to disable the mad plugin.]) ])
    AC_CHECK_LIB(mad, mad_bit_init, [
      VLC_ADD_PLUGINS([mpgatofixed32])
      VLC_ADD_LDFLAGS([mpgatofixed32],[-lmad])],
gbazin's avatar
 
gbazin committed
      [ AC_MSG_ERROR([Cannot find libmad library...]) ])
    CPPFLAGS="${CPPFLAGS_save}"
    LDFLAGS="${LDFLAGS_save}"
gbazin's avatar
 
gbazin committed
  fi
Samuel Hocevar's avatar
 
Samuel Hocevar committed
fi
dnl   libid3tag support (FIXME!!! doesn't work with new input)
AC_CHECK_HEADERS(id3tag.h, [
  AC_CHECK_HEADERS(zlib.h, [
    VLC_ADD_LDFLAGS([id3tag],[-lid3tag -lz])
    VLC_ADD_PLUGINS([id3tag])]) ])
gbazin's avatar
 
gbazin committed
dnl  ffmpeg decoder/demuxer plugin
dnl we try to find ffmpeg using : 1- given tree 2- ffmpeg-config, 3- pkg-config
dnl 				4- default place, 
gbazin's avatar
 
gbazin committed
[  --enable-ffmpeg         ffmpeg codec (default enabled)])
if test "${enable_ffmpeg}" != "no"

dnl Those options have to be here because the .pc can be bogus for ffmpeg previous nov 05

 AC_ARG_WITH(ffmpeg-mp3lame,
   [    --with-ffmpeg-mp3lame specify if ffmpeg has been compiled with mp3lame support],
   [
     if test "$with_ffmpeg_mp3lame" = "yes";	then
     	VLC_ADD_LDFLAGS([ffmpeg],[-lmp3lame])
     fi])

 AC_ARG_WITH(ffmpeg-faac,
   [    --with-ffmpeg-faac    specify if ffmpeg has been compiled with faac support],
   [
     if test "$with_ffmpeg_faac" = "yes"; then
     	VLC_ADD_LDFLAGS([ffmpeg],[-lfaac])
     fi])

 AC_ARG_WITH(ffmpeg-dts,
   [    --with-ffmpeg-dts     specify if ffmpeg has been compiled with dts support],
   [
     if test "$with_ffmpeg_dts" = "yes"; then
             LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
             AC_CHECK_LIB(dts_pic, dts_free, 
               [ VLC_ADD_LDFLAGS([ffmpeg],[-ldts_pic]) ],
               [ VLC_ADD_LDFLAGS([ffmpeg],[-ldts]) ])
             LDFLAGS="${LDFLAGS_save}"
     fi])

 AC_ARG_WITH(ffmpeg-vorbis,
   [    --with-ffmpeg-vorbis    specify if ffmpeg has been compiled with vorbis support],
   [
     if test "$with_ffmpeg_vorbis" = "yes"; then
        VLC_ADD_LDFLAGS([ffmpeg],[-lvorbisenc -lvorbis])
     fi])

 AC_ARG_WITH(ffmpeg-theora,
   [    --with-ffmpeg-theora    specify if ffmpeg has been compiled with theora support],
   [
     if test "$with_ffmpeg_theora" = "yes"; then
        VLC_ADD_LDFLAGS([ffmpeg],[-ltheora])
     fi])

 AC_ARG_WITH(ffmpeg-ogg,
   [    --with-ffmpeg-ogg    specify if ffmpeg has been compiled with ogg support],
   [
     if test "$with_ffmpeg_ogg" = "yes"; then
        VLC_ADD_LDFLAGS([ffmpeg],[-logg])
     fi])

 AC_ARG_WITH(ffmpeg-zlib,
   [    --with-ffmpeg-zlib    specify if ffmpeg has been compiled with zlib support],
   [
     if test "$with_ffmpeg_zlib" = "yes"; then
		VLC_ADD_LDFLAGS([ffmpeg],[-lz])
     fi])

 dnl
 dnl test for --with-ffmpeg-tree
 dnl
 AC_ARG_WITH(ffmpeg-tree,
   [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])

 if test "${with_ffmpeg_tree}" != "no" -a -n "${with_ffmpeg_tree}"; then
   AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
   real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
   if test -z "${real_ffmpeg_tree}"; then
     dnl  The given directory can't be found
     AC_MSG_RESULT(no)
     AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
   fi
   if ! test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"; then
     dnl  The given libavcodec wasn't built
     AC_MSG_RESULT(no)
     AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
   fi
   if ! fgrep -s "pp_get_context" "${real_ffmpeg_tree}/libavcodec/libavcodec.a"; then
     if test -f "${real_ffmpeg_tree}/libavcodec/libpostproc/libpostproc.a"; then
       VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavcodec/libpostproc ${real_ffmpeg_tree}/libavcodec/libpostproc/libpostproc.a])	
     elif test -f "${real_ffmpeg_tree}/libpostproc/libpostproc.a"; then 
	VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libpostproc ${real_ffmpeg_tree}/libpostproc/libpostproc.a])
gbazin's avatar
gbazin committed
        VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}])
     else
       dnl  The given libavcodec wasn't built with --enable-pp
       AC_MSG_RESULT(no)
Christophe Mutricy's avatar
Christophe Mutricy committed
       AC_MSG_ERROR([cannot find libpostproc.a in ${real_ffmpeg_tree}/[libavcodec/]libpostproc/. Make sure you configured ffmpeg with --enable-pp])
   fi
   dnl  Use a custom libffmpeg
   AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)

   if fgrep -s "CONFIG_ZLIB=yes" "${real_ffmpeg_tree}/config.mak"; then
     if test "${with_ffmpeg_zlib}" != "yes"; then
       VLC_ADD_LDFLAGS([ffmpeg],[-lz])
     fi
   fi
   if fgrep -s "CONFIG_MP3LAME=yes" "${real_ffmpeg_tree}/config.mak"; then
     if test "${with_ffmpeg_mp3lame}" != "yes"; then
       VLC_ADD_LDFLAGS([ffmpeg],[-lmp3lame])
     fi
   fi
   if fgrep -s "CONFIG_FAAC=yes" "${real_ffmpeg_tree}/config.mak"; then
     if test "${with_ffmpeg_faac}" != "yes"; then
       VLC_ADD_LDFLAGS([ffmpeg],[-lfaac])
     fi
   fi
   if fgrep -s "CONFIG_DTS=yes" "${real_ffmpeg_tree}/config.mak"; then
     if test "${with_ffmpeg_dts}" != "yes"; then
       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
       AC_CHECK_LIB(dts_pic, dts_free, 
         [ VLC_ADD_LDFLAGS([ffmpeg],[-ldts_pic]) ],
         [ VLC_ADD_LDFLAGS([ffmpeg],[-ldts]) ])
       LDFLAGS="${LDFLAGS_save}"
     fi
   fi
   if fgrep -s "CONFIG_VORBIS=yes" "${real_ffmpeg_tree}/config.mak"; then
     VLC_ADD_LDFLAGS([ffmpeg],[-lvorbis -lvorbisenc])
   fi
   if fgrep -s "CONFIG_FAAD=yes" "${real_ffmpeg_tree}/config.mak"; then
     VLC_ADD_LDFLAGS([ffmpeg],[-lfaad])
   fi
   if fgrep -s "CONFIG_XVID=yes" "${real_ffmpeg_tree}/config.mak"; then
     VLC_ADD_LDFLAGS([ffmpeg],[-lxvidcore])
   fi

   VLC_ADD_BUILTINS([ffmpeg])
   if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes" ; then
     VLC_ADD_BUILTINS([stream_out_switcher])
   fi

   if test -f "${real_ffmpeg_tree}/libavutil/libavutil.a"; then
     VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavutil ${real_ffmpeg_tree}/libavutil/libavutil.a])
     VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavutil])
   fi

   VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavcodec ${real_ffmpeg_tree}/libavcodec/libavcodec.a])
   VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavcodec])

   if test -f "${real_ffmpeg_tree}/libavformat/libavformat.a"; then
     AC_DEFINE(HAVE_LIBAVFORMAT_TREE, 1, [Define if you have ffmpeg's libavformat.])
     VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavformat ${real_ffmpeg_tree}/libavformat/libavformat.a])
     VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavformat])
   fi
hartman's avatar
hartman committed

   if test -f "${real_ffmpeg_tree}/libswscale/libswscale.a"; then
     AC_DEFINE(HAVE_LIBSWSCALE_TREE, 1, [Define if you have ffmpeg's libswscale.])
     VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libswscale ${real_ffmpeg_tree}/libswscale/libswscale.a])
     VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libswscale])
   fi
else    
    
dnl Look for a ffmpeg-config (we are on debian )
 
  FFMPEG_PATH="${PATH}"
  AC_ARG_WITH(ffmpeg-config-path,
    [    --with-ffmpeg-config-path=PATH ffmpeg-config path (default search in \$PATH)],
    [ if test "${with_ffmpeg_config_path}" != "no"
      then
        FFMPEG_PATH="${with_ffmpeg_config_path}"
      fi ])
  AC_PATH_PROG(FFMPEG_CONFIG, ffmpeg-config, no, ${FFMPEG_PATH})
  if test "${FFMPEG_CONFIG}" != "no"
  then
hartman's avatar
hartman committed
    AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
    AC_CHECK_HEADERS(ffmpeg/avformat.h)
    AC_CHECK_HEADERS(ffmpeg/avutil.h)
    AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
    if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then
        VLC_ADD_PLUGINS([stream_out_switcher])
    fi
    VLC_ADD_CFLAGS([ffmpeg stream_out_switcher],[`${FFMPEG_CONFIG} --cflags`])
    VLC_ADD_LDFLAGS([ffmpeg stream_out_switcher],[`${FFMPEG_CONFIG} --plugin-libs avcodec avformat postproc`])
 
 else
   PKG_CHECK_MODULES(FFMPEG,[libavcodec, libavformat],
     AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
     AC_CHECK_HEADERS(ffmpeg/avformat.h)
     AC_CHECK_HEADERS(ffmpeg/avutil.h)
hartman's avatar
hartman committed
     AC_CHECK_HEADERS(ffmpeg/swscale.h)
     AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
     if test "${SYS}" = "darwin"; then
        VLC_ADD_BUILTINS([ffmpeg])
     else
        VLC_ADD_PLUGINS([ffmpeg])
     fi
     if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then
        if test "${SYS}" = "darwin"; then
            VLC_ADD_BUILTINS([stream_out_switcher])
        else
            VLC_ADD_PLUGINS([stream_out_switcher])
        fi
     fi
     VLC_ADD_CFLAGS([ffmpeg stream_out_switcher],[${FFMPEG_CFLAGS}])
     VLC_ADD_LDFLAGS([ffmpeg stream_out_switcher],[${FFMPEG_LIBS}])
     dnl newer ffmpeg have a separate libpostproc
hartman's avatar
hartman committed
     PKG_CHECK_MODULES(POSTPROC, libpostproc,[
       VLC_ADD_CFLAGS([ffmpeg],[${POSTPROC_CFLAGS}]) 
       VLC_ADD_LDFLAGS([ffmpeg],[${POSTPROC_LIBS}]) 
     dnl even newer ffmpeg has a libswscale
     PKG_CHECK_MODULES(SWSCALE, libswscale,[
       VLC_ADD_CFLAGS([ffmpeg],[${SWSCALE_CFLAGS}]) 
       VLC_ADD_LDFLAGS([ffmpeg],[${SWSCALE_LIBS}]) 
       ],[ true ])
    dnl
      CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
      AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
hartman's avatar
hartman committed
      AC_CHECK_HEADERS(ffmpeg/swscale.h)
      AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
        VLC_ADD_LDFLAGS([ffmpeg],[-lavutil])
        LDAVUTIL="-lavutil"])
        VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
        if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then
            VLC_ADD_BUILTINS([stream_out_switcher])
Christophe Mutricy's avatar
Christophe Mutricy committed
         [ AC_MSG_ERROR([Could not find ffmpeg on your system: you may get it from http://ffmpeg.sf.net/ (svn version is recommended). Alternatively you can use --disable-ffmpeg to disable the ffmpeg plugins.]) ], [$LDAVUTIL])
      AC_CHECK_LIB(postproc, pp_postprocess, [
        VLC_ADD_LDFLAGS([ffmpeg],[-lpostproc])],
	AC_MSG_ERROR([Could not find libpostproc inside FFmpeg. You should configure FFmpeg with --enable-gpl --enable-pp.]),
	[$LDAVUTIL])

      AC_CHECK_LIB(avformat, av_open_input_stream, [
        VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz]) ], [], [-lavcodec -lz $LDAVUTIL])
      LDFLAGS="${LDFLAGS_save}"
      CPPFLAGS="${CPPFLAGS_save}"
hartman's avatar
hartman committed

      AC_CHECK_LIB(swscale, sws_getContext, [
        VLC_ADD_LDFLAGS([ffmpeg],[-lswscale]) ], [], [-lavcodec $LDAVUTIL])
      LDFLAGS="${LDFLAGS_save}"
      CPPFLAGS="${CPPFLAGS_save}"
gbazin's avatar
 
gbazin committed
  fi
dnl
AC_ARG_ENABLE(ffmpegaltivec,
[  --enable-ffmpegaltivec  ffmpegaltivec codec (DO NOT USE)])
if test "${enable_ffmpegaltivec}" = "yes"
then
  if test "${with_ffmpeg_tree}" != "no" -a -n "${with_ffmpeg_tree}"; then
    AC_MSG_CHECKING(for libavcodecaltivec.a in ${with_ffmpeg_tree})
    real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
    if test -z "${real_ffmpeg_tree}"; then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
    fi
    if ! test -f "${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a"; then
      dnl  The given libavcodecaltivec wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a, make sure you compiled libavcodecaltivec in ${with_ffmpeg_tree}])
    fi
    if ! fgrep -s "pp_get_context" "${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a"; then
      dnl  The given libavcodecaltivec wasn't built with --enable-pp
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a was not compiled with postprocessing support, make sure you configured ffmpeg with --enable-pp])
    fi
    dnl  Use a custom libffmpeg
    AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a)
    VLC_ADD_BUILTINS([ffmpegaltivec])
    VLC_ADD_LDFLAGS([ffmpegaltivec],[-L${real_ffmpeg_tree}/libavcodec -lavcodecaltivec])
    VLC_ADD_CPPFLAGS([ffmpeg],[-DNO_ALTIVEC_IN_FFMPEG])
    VLC_ADD_CPPFLAGS([ffmpegaltivec],[-I${real_ffmpeg_tree}/libavcodec -I${real_ffmpeg_tree}/libavformat])

    if test -f "${real_ffmpeg_tree}/libavformat/libavformat.a"; then
      AC_DEFINE(HAVE_LIBAVFORMAT_TREE, 1, [Define if you have ffmpeg's libavformat.])
      VLC_ADD_LDFLAGS([ffmpegaltivec],[-L${real_ffmpeg_tree}/libavformat -lavformataltivec -lz])
      VLC_ADD_CPPFLAGS([ffmpegaltivec],[-I${real_ffmpeg_tree}/libavformat])
    fi
    VLC_ADD_LDFLAGS([stream_out_switcher],[-L${real_ffmpeg_tree}/libavcodec])
    VLC_ADD_CPPFLAGS([stream_out_switcher],[-I${real_ffmpeg_tree}/libavcodec -I${real_ffmpeg_tree}/libavformat])
dnl
dnl  faad decoder plugin
dnl
AC_ARG_ENABLE(faad,
[  --enable-faad           faad codec (default disabled)])
if test "${enable_faad}" = "yes"
  [    --with-faad-tree=PATH faad tree for static linking])
Samuel Hocevar's avatar
Samuel Hocevar committed
  if test -n "${with_faad_tree}"
  then
    AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
    real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
Samuel Hocevar's avatar
Samuel Hocevar committed
    if test -z "${real_faad_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
    fi
    if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
    then
      dnl  Use a custom faad
      AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
      VLC_ADD_BUILTINS([faad])
      VLC_ADD_LDFLAGS([faad],[${real_faad_tree}/libfaad/.libs/libfaad.a])
      VLC_ADD_CPPFLAGS([faad],[-I${real_faad_tree}/include])
    else
      dnl  The given libfaad wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
    AC_CHECK_HEADERS(faad.h, ,
      [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
    AC_CHECK_LIB(faad, faacDecOpen, [
      VLC_ADD_PLUGINS([faad])
      VLC_ADD_LDFLAGS([faad],[-lfaad]) ],
      AC_CHECK_LIB(faad, NeAACDecOpen, [
        VLC_ADD_PLUGINS([faad])
        VLC_ADD_LDFLAGS([faad],[-lfaad]) ],
        [ AC_MSG_ERROR([Cannot find libfaad library...]) ]))
    LDFLAGS="${LDFLAGS_save}"
    CPPFLAGS="${CPPFLAGS_save}"
AC_ARG_ENABLE(twolame,
[  --enable-twolame        twolame codec (default disabled)])
if test "${enable_twolame}" = "yes"
  AC_ARG_WITH(twolame-tree,
  [    --with-twolame-tree=PATH twolame tree for static linking])
  if test -n "${with_twolame_tree}"
    AC_MSG_CHECKING(for libtwolame.a in ${with_twolame_tree})
    real_twolame_tree="`cd ${with_twolame_tree} 2>/dev/null && pwd`"
    if test -z "${real_twolame_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_twolame_tree}])
    if test -f "${real_twolame_tree}/src/libtwolame/.libs/libtwolame.a"
      dnl  Use a custom twolame
      AC_MSG_RESULT(${real_twolame_tree}/src/libtwolame/.libs/libtwolame.a)
      VLC_ADD_BUILTINS([twolame])
      VLC_ADD_LDFLAGS([twolame],[${real_twolame_tree}/src/libtwolame/.libs/libtwolame.a])
      VLC_ADD_CPPFLAGS([twolame],[-I${real_twolame_tree}/src/libtwolame])
      AC_MSG_ERROR([cannot find ${real_twolame_tree}/src/libtwolame/.libs/libtwolame.a, make sure you compiled libtwolame in ${with_twolame_tree}])
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_twolame}"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_twolame}"
    AC_CHECK_HEADERS(twolame.h, ,
      [ AC_MSG_ERROR([Cannot find development header for libtwolame...]) ])
    AC_CHECK_LIB(twolame, twolame_init, [
      VLC_ADD_PLUGINS([twolame])
      VLC_ADD_LDFLAGS([twolame],[-ltwolame]) ],
        [ AC_MSG_ERROR([Cannot find libtwolame library...]) ])