Skip to content
Snippets Groups Projects
configure.ac 205 KiB
Newer Older

  dnl Temporary hack (yeah, sure ;)
  if test "${SYS}" = "mingw32" || test "${SYS}" = "darwin" || test "${SYS}" = "beos" ; then
      VLC_ADD_LDFLAGS([dvdread],[-ldvdcss])
  fi

  if test -z "${with_dvdread}"
  then
    if test -z "${with_dvdread_tree}"
    then
      AC_CHECK_HEADERS(dvdread/dvd_reader.h,
        [ VLC_ADD_PLUGINS([dvdread])
          VLC_ADD_LDFLAGS([dvdread],[-ldvdread ${LDFLAGS_dvdcss}])
        ],[
          if test -n "${enable_dvdread}"
          then
            AC_MSG_ERROR([cannot find libdvdread headers])
          fi
        ])
    else
      AC_MSG_CHECKING(for libdvdread.a in ${with_dvdread_tree})
      real_dvdread_tree="`cd ${with_dvdread_tree} 2>/dev/null && pwd`"
      if test -z "${real_dvdread_tree}"
      then
        dnl  The given directory can't be found
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot cd to ${with_dvdread_tree}])
      fi
      if test -f "${real_dvdread_tree}/dvdread/.libs/libdvdread.a"
      then
        dnl  Use a custom libdvdread
        AC_MSG_RESULT(${real_dvdread_tree}/dvdread/.libs/libdvdread.a)
        VLC_ADD_BUILTINS([dvdread])
        VLC_ADD_LDFLAGS([dvdread],[-L${real_dvdread_tree}/dvdread/.libs -ldvdread ${LDFLAGS_dvdcss}])
        VLC_ADD_CPPFLAGS([dvdread],[-I${real_dvdread_tree}])
      else
        dnl  The given libdvdread wasn't built
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot find ${real_dvdread_tree}/dvdread/.libs/libdvdread.a, make sure you compiled libdvdread in ${with_dvdread_tree}])
      fi
    fi
  else
    AC_MSG_CHECKING(for dvdread headers in ${with_dvdread})
    if test -f ${with_dvdread}/include/dvdread/dvd_reader.h
    then
      dnl  Use ${with_dvdread}/include/dvdread/dvd_reader.h
      AC_MSG_RESULT(yes)
      VLC_ADD_PLUGINS([dvdread])
      VLC_ADD_LDFLAGS([dvdread],[-L${with_dvdread}/lib -ldvdread ${LDFLAGS_dvdcss}])
      VLC_ADD_CPPFLAGS([dvdread],[-I${with_dvdread}/include])
    else
      dnl  No libdvdread could be found, sorry
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${with_dvdread}/include/dvdread/dvd_reader.h])
    fi
  fi
fi
gbazin's avatar
 
gbazin committed
dnl
dnl  libdvdnav plugin
dnl
AC_ARG_ENABLE(dvdnav,
  [  --enable-dvdnav         dvdnav input module (default enabled)])
if test "${enable_dvdnav}" != "no"
gbazin's avatar
 
gbazin committed
then
  dnl Same hack than dvdread
  if test "${SYS}" = "mingw32" || test "${SYS}" = "darwin" || test "${SYS}" = "beos" ; then
      VLC_ADD_LDFLAGS([dvdnav],[-ldvdcss])
  fi

gbazin's avatar
 
gbazin committed
  DVDNAV_PATH="${PATH}"
  AC_ARG_WITH(dvdnav-config-path,
    [    --with-dvdnav-config-path=PATH dvdnav-config path (default search in \$PATH)],
    [ if test "${with_dvdnav_config_path}" != "no"
      then
        DVDNAV_PATH="${with_dvdnav_config_path}:${PATH}"
      fi ])
  AC_PATH_PROG(DVDNAV_CONFIG, dvdnav-config, no, ${DVDNAV_PATH})
  if test "${DVDNAV_CONFIG}" != "no"
  then
    VLC_ADD_PLUGINS([dvdnav])
    VLC_ADD_CFLAGS([dvdnav],[`${DVDNAV_CONFIG} --cflags`])
    VLC_ADD_LDFLAGS([dvdnav],[`${DVDNAV_CONFIG} --libs`])
gbazin's avatar
 
gbazin committed
  fi
fi

gbazin's avatar
 
gbazin committed
dnl
dnl  Windows DirectShow access module
dnl
AC_ARG_ENABLE(dshow,
hartman's avatar
hartman committed
  [  --enable-dshow          Win32 DirectShow support (default enabled on Win32)])
gbazin's avatar
 
gbazin committed
if test "${enable_dshow}" != "no"
then
  if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
  then
gbazin's avatar
 
gbazin committed
      AC_CHECK_HEADERS(dshow.h,
      [ VLC_ADD_PLUGINS([dshow])
        VLC_ADD_CXXFLAGS([dshow],[])
        VLC_ADD_LDFLAGS([dshow],[-lole32 -loleaut32 -luuid]) ])
gbazin's avatar
 
gbazin committed
  fi
fi

dnl
dnl  Windows DirectShow BDA access module
dnl
AC_ARG_ENABLE(bda,
  [  --enable-bda          Win32 DirectShow BDA support (default enabled on Win32)])
if test "${enable_bda}" != "no"
then
  if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
  then
      AC_CHECK_HEADERS(dshow.h,
      [ VLC_ADD_PLUGINS([bda])
        VLC_ADD_CXXFLAGS([bda],[])
        VLC_ADD_LDFLAGS([bda],[-lstrmiids -lole32 -loleaut32 -luuid]) ])

dnl
dnl  OpenCV wrapper and example filters
dnl
AC_ARG_ENABLE(opencv,
  [  --enable-opencv            OpenCV (computer vision) filter (default disabled)])
if test "${enable_opencv}" = "yes" -a "${CXX}" != "";
then
  AC_ARG_WITH(opencv-tree,
  [    --with-opencv-tree=PATH opencv tree for linking])
  if test -n "${with_opencv_tree}"
  then
    if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
    then
	  AC_MSG_CHECKING(for opencv in ${with_opencv_tree})
	  if test -f ${with_opencv_tree}/cv/include/cv.h -a -f ${with_opencv_tree}/cxcore/include/cxcore.h \
	    -a -f ${with_opencv_tree}/cvaux/include/cvaux.h -a -f ${with_opencv_tree}/otherlibs/highgui/highgui.h
      then
        AC_MSG_RESULT(yes)
        VLC_ADD_PLUGINS([opencv_wrapper])
        VLC_ADD_LDFLAGS([opencv_wrapper],[-L${with_opencv_tree}/lib -lcv -lcxcore -lcvaux -lhighgui])
        VLC_ADD_CFLAGS([opencv_wrapper],[-I${with_opencv_tree}/cv/include -I${with_opencv_tree}/cxcore/include -I${with_opencv_tree}/cvaux/include -I${with_opencv_tree}/otherlibs/highgui])
        AC_LANG_PUSH(C++)
        VLC_ADD_PLUGINS([opencv_example])
        VLC_ADD_LDFLAGS([opencv_example],[-L${with_opencv_tree}/lib -lcv -lcxcore -lcvaux -lhighgui])
        VLC_ADD_CXXFLAGS([opencv_example],[-I${with_opencv_tree}/cv/include -I${with_opencv_tree}/cxcore/include -I${with_opencv_tree}/cvaux/include -I${with_opencv_tree}/otherlibs/highgui])
        AC_LANG_POP(C++)        
	  else
        dnl  No opencv could be found, sorry
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot find opencv in ${with_opencv_tree}])
	  fi
    else
	  AC_MSG_WARN([--enable-opencv currently only works on windows])
    fi
  fi  
fi


dnl
dnl  libsmbclient plugin
dnl
AC_ARG_ENABLE(smb,
  [  --enable-smb            smb input module (default enabled)])
if test "${enable_smb}" != "no"; then
  AC_CHECK_HEADERS(libsmbclient.h,
    [ VLC_ADD_PLUGINS([access_smb])
      VLC_ADD_LDFLAGS([access_smb],[-lsmbclient]) ],
    [ if test -n "${enable_smb}"; then
        AC_MSG_ERROR([cannot find libsmbclient headers])
     fi ])
  AC_CHECK_MEMBER([struct _SMBCCTX.close_fn],
    AC_DEFINE([HAVE__SMBCCTX_CLOSE_FN], [1], [Define if samba has _SMBCCTX.close_fn]),,
    [#include <libsmbclient.h>])
  [  --enable-dvbpsi         dvbpsi ts mux and demux module (default enabled)])
if test "${enable_dvbpsi}" != "no"
  [    --with-dvbpsi=PATH    libdvbpsi headers and libraries])
  AC_ARG_WITH(dvbpsi,
  [    --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
  case "${with_dvbpsi}" in
  ""|yes)
Samuel Hocevar's avatar
Samuel Hocevar committed
    if test -z "${with_dvbpsi_tree}"
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_LDFLAGS([mux_ts ts dvb],[-ldvbpsi]) ],
        [  AC_MSG_WARN([cannot find libdvbpsi headers]) ],
        [#if defined( HAVE_STDINT_H )
#   include <stdint.h>
#elif defined( HAVE_INTTYPES_H )
#   include <inttypes.h>
#endif
gbazin's avatar
 
gbazin committed
#include <dvbpsi/dvbpsi.h>
#include <dvbpsi/descriptor.h>
#include <dvbpsi/pat.h>
#include <dvbpsi/pmt.h>])
    else
      AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
      real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
Samuel Hocevar's avatar
Samuel Hocevar committed
      if test -z "${real_dvbpsi_tree}"
      then
        dnl  The given directory can't be found
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
      fi
      if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
      then
        dnl  Use a custom libdvbpsi
        AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
        VLC_ADD_BUILTINS([ts])
        if test "${enable_sout}" != "no"; then
          VLC_ADD_BUILTINS([mux_ts])
        fi
        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])
  AC_ARG_WITH(videodev2,
    [  --with-videodev2=FILE   Location of videodev2.h file (default /usr/include/linux/videodev2.h)],[],[])
  if test "${with_videodev2}" != "no" -a -n "${with_videodev2}"
  then
    AC_DEFINE_UNQUOTED(VIDEODEV2_H_FILE, "${with_videodev2}", [Location of videodev2.h])
  fi
    

  AC_CACHE_CHECK([for new linux/videodev2.h],
      [new_linux_videodev2_h],
      [AC_TRY_COMPILE([
          #include <sys/types.h>
          #   ifdef VIDEODEV2_H_FILE
	  #   include VIDEODEV2_H_FILE
	  #   else
	  #   include <linux/videodev2.h>
	  #   endif
	  ],
          [struct v4l2_ext_controls ctrls; ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG; ],
          new_linux_videodev2_h=yes,
          new_linux_videodev2_h=no)])
  if test "${new_linux_videodev2_h}" != "no"; then
    AC_DEFINE(HAVE_NEW_LINUX_VIDEODEV2_H, 1, [Define if new linux/videodev2.h present])
  fi
bigben's avatar
bigben committed
dnl
dnl  gnomeVFS access module
dnl
AC_ARG_ENABLE(gnomevfs,
  [  --enable-gnomevfs       GnomeVFS access module (default disabled)])
if test "${enable_gnomevfs}" = "yes" 
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],[-Wl,-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],[-Wl,-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])
      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().])])


AC_CHECK_FUNCS(inet_ntop,[
  AC_DEFINE(HAVE_INET_NTOP, 1, [Define to 1 if you have inet_ntop().])])


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
              AC_CHECK_LIB(ebml_pic, main, [
                VLC_ADD_LDFLAGS([mkv],[-lmatroska -lebml_pic])
              ],
                AC_CHECK_LIB(ebml, main, [
                  VLC_ADD_PLUGINS([mkv])
                  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_ARG_ENABLE( id3tag,
  [  --disable-id3tag id3tag metadata reader plugin (default enabled)])
AS_IF([test "${enable_id3tag}" != "no"], [
  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