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

  AC_ARG_WITH(dv-avc1394,
  [    --with-dv-avc1394=PATH   libavc1394 headers and libraries])
  AC_ARG_WITH(dv-avc1394-tree,
  [    --with-dv-avc1394=PATH   libavc1394 tree for static linking])

  if test -z "${with_dv_avc1394}" -a "${with_dv_avc1394}" != ""
  then
    AC_MSG_CHECKING(for avc1394 headers in ${with_dv_avc1394})
    if test -f ${with_dv_avc1394}/include/libavc1394/avc1394.h
    then
      dnl  Use ${with_dv_avc1394}/include/libavc1394/avc1394.h
      AC_MSG_RESULT(yes)
      VLC_ADD_LIBS([access_dv],[-L${with_dv_avc1394}/lib -lavc1394 -lrom1394 -lpthread])
      VLC_ADD_CPPFLAGS([access_dv],[-I${with_avc1394}/include])
    else
      dnl  No libavc1394 could be found, sorry
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${with_dv_avc1394}/include/libavc1394/avc1394.h])
    fi
  else
    AC_CHECK_HEADERS(libavc1394/avc1394.h,
    [ VLC_ADD_LIBS([access_dv],[-lavc1394 -lrom1394 -lpthread])
    ],[
        if test -n "${enable_dv}"
        then
          AC_MSG_ERROR([cannot find libavc1394 headers])
        fi
    ])
  fi

  dnl Check for static linking of libavc1394
  if test -z "${with_dv_avc1394_tree}" -a "${with_dv_avc1394_tree}" != ""
  then
    AC_MSG_CHECKING(for libavc1394.a in ${with_dv_avc1394_tree})
    real_dv_avc1394_tree="`cd ${with_dv_avc1394_tree} 2>/dev/null && pwd`"
    if test -z "${real_dv_avc1394_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${real_dv_avc1394_tree}])
    fi
    if test -f "${real_dv_avc1394_tree}/src/.libs/libavc1394.a"
    then
      dnl  Use a custom libavc1394
      AC_MSG_RESULT(${real_dv_avc1394_tree}/src/.libs/libavc1394.a)
      VLC_ADD_LIBS([access_dv],[-L${real_dv_avc1394_tree}/src/.libs -lavc1394 -lrom1394 -lpthread])
      VLC_ADD_CPPFLAGS([access_dv],[-I${real_dv_avc1394_tree}])
    else
      dnl  The given libavc1394 wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_dv_avc1394_tree}/src/.libs/libavc1394.a, make sure you compiled libavc1394 in ${with_dv_avc1394_tree}])
    fi
  fi
fi

dnl
dnl dvdread module: check for libdvdread
dnl
AC_ARG_ENABLE(dvdread,
[  --enable-dvdread        dvdread input module (default disabled)])
if test "${enable_dvdread}" != "no"
then
  AC_ARG_WITH(dvdread,
  [    --with-dvdread=PATH   libdvdread headers and libraries])
  AC_ARG_WITH(dvdread-tree,
  [    --with-dvdread-tree=PATH libdvdread tree for static linking])

  dnl Temporary hack (yeah, sure ;)
  if test "${SYS}" = "mingw32" || test "${SYS}" = "darwin" || test "${SYS}" = "beos" ; then
      VLC_ADD_LIBS([dvdread],[-ldvdcss])
  if test -z "${with_dvdread}"
  then
    if test -z "${with_dvdread_tree}"
    then
      AC_CHECK_HEADERS(dvdread/dvd_reader.h,
        [ VLC_ADD_PLUGIN([dvdread])
          VLC_ADD_LIBS([dvdread],[-ldvdread ${LIBS_dvdcss}])
	  AC_CHECK_HEADERS(libdvdread/dvd_reader.h,
            [ VLC_ADD_PLUGIN([dvdread])
	      VLC_ADD_LIBS([dvdread],[-ldvdread ${LIBS_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_LIBS([dvdread],[-L${real_dvdread_tree}/dvdread/.libs -ldvdread ${LIBS_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_PLUGIN([dvdread])
      VLC_ADD_LIBS([dvdread],[-L${with_dvdread}/lib -ldvdread ${LIBS_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_LIBS([dvdnav],[-ldvdcss])
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_PLUGIN([dvdnav])
    VLC_ADD_CFLAGS([dvdnav],[`${DVDNAV_CONFIG} --cflags`])
    VLC_ADD_LIBS([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_PLUGIN([dshow])
        VLC_ADD_CXXFLAGS([dshow],[])
        VLC_ADD_LIBS([dshow],[-lole32 -loleaut32 -luuid]) ])
gbazin's avatar
 
gbazin committed
  fi
fi

dnl
dnl  Windows DirectShow BDA access module
dnl
AC_ARG_ENABLE(bda,
Christophe Mutricy's avatar
Christophe Mutricy committed
  AS_HELP_STRING([--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_PLUGIN([bda])
        VLC_ADD_LIBS([bda],[-lstrmiids -lole32 -loleaut32 -luuid]) ])

dnl
dnl  OpenCV wrapper and example filters
dnl
AC_ARG_ENABLE(opencv,
Rafaël Carré's avatar
Rafaël Carré committed
  [  --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 "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
    then
      test -z "${with_opencv_tree}" && AC_MSG_ERROR([You have to specify --with-opencv-tree])
	  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_PLUGIN([opencv_wrapper])
        VLC_ADD_LIBS([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_PLUGIN([opencv_example])
        VLC_ADD_LIBS([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
      PKG_CHECK_MODULES(OPENCV, opencv,
        [
          VLC_ADD_PLUGIN([opencv_example])
          VLC_ADD_PLUGIN([opencv_wrapper])
          VLC_ADD_LIBS([opencv_example opencv_wrapper],[${OPENCV_LIBS}])
          VLC_ADD_CFLAGS([opencv_wrapper],[${OPENCV_CFLAGS}])
          VLC_ADD_CXXFLAGS([opencv_example],[${OPENCV_CFLAGS}])
        ],
        [AC_MSG_ERROR([libopencv not found!])]
      )
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_PLUGIN([access_smb])
      VLC_ADD_LIBS([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]),,
  [  --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_PLUGIN([ts])
          if test "${enable_sout}" != "no"; then
            VLC_ADD_PLUGIN([mux_ts])
          VLC_ADD_LIBS([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_LIBS([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_PLUGIN([ts])
      if test "${enable_sout}" != "no"; then
        VLC_ADD_PLUGIN([mux_ts])
      VLC_ADD_CPPFLAGS([mux_ts ts dvb],[${CPPFLAGS_test}])
      VLC_ADD_LIBS([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.])
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_PLUGIN([v4l])
  ],[])
  CPPFLAGS="${CPPFLAGS_save}"
dnl
AC_ARG_ENABLE(v4l2,
  [  --enable-v4l2           Video4Linux2 input support (default enabled)])
if test "${enable_v4l2}" != "no"
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

  AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_v4l2_alsa="true", have_v4l2_alsa="false"),have_v4l2_alsa="false")
  if test "${have_v4l2_alsa}" = "true"
  then
    CFLAGS="${CFLAGS_save}"
    AC_TRY_COMPILE([#define ALSA_PCM_NEW_HW_PARAMS_API
                    #define ALSA_PCM_NEW_SW_PARAMS_API
                    #include <alsa/asoundlib.h>],
       [snd_pcm_hw_params_get_period_time(0,0,0);],
        AC_DEFINE(HAVE_ALSA_NEW_API, 1, Define if ALSA is at least rc4))
    VLC_ADD_LDFLAGS([v4l2],[-lasound -lm -ldl])
    AC_DEFINE(HAVE_ALSA, 1, Define if ALSA is present.)
  fi

  CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_v4l2}"
  AC_CHECK_HEADERS(linux/videodev2.h, [
    VLC_ADD_PLUGIN([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_PLUGIN([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],
      [ac_cv_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; ],
          ac_cv_new_linux_videodev2_h=yes,
          ac_cv_new_linux_videodev2_h=no)])
  if test "${ac_cv_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_LIBS([access_gnomevfs],[$GNOMEVFS_LIBS])
bigben's avatar
bigben committed
    VLC_ADD_CPPFLAGS([access_gnomevfs],[$GNOMEVFS_CPPFLAGS])
    VLC_ADD_CFLAGS([access_gnomevfs],[$GNOMEVFS_CFLAGS])
    VLC_ADD_PLUGIN([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,
     [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
Christophe Mutricy's avatar
Christophe Mutricy committed
  AS_HELP_STRING([--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, 1, [Define for the audio CD plugin using libcdio])
    VLC_ADD_LIBS([cddax],[$LIBCDIO_LIBS])
    VLC_ADD_CFLAGS([cddax],[$LIBCDIO_CFLAGS])
    VLC_ADD_PLUGIN([cddax])
    PKG_CHECK_MODULES(LIBCDIO_PARANOIA, libcdio_paranoia >= 0.72, [
    VLC_ADD_LIBS([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, [
      AC_DEFINE(HAVE_LIBCDDB, 1, [Define this if you have libcddb installed])
      VLC_ADD_LIBS([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_LIBS([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_LIBS([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
    [Define for the VCD plugin using libcdio/libvcdinfo])
    VLC_ADD_LIBS([vcdx],[$VCDINFO_LIBS])
    VLC_ADD_CFLAGS([vcdx],[$VCDINFO_CFLAGS])
    VLC_ADD_PLUGIN([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_PLUGIN([vcd])
    VLC_ADD_PLUGIN([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_PLUGIN([vcd])
    VLC_ADD_PLUGIN([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_PLUGIN([vcd])
    VLC_ADD_PLUGIN([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_PLUGIN([vcd])
    VLC_ADD_PLUGIN([cdda])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  fi
  if test "${SYS}" = "darwin"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  then
    VLC_ADD_PLUGIN([vcd])
    VLC_ADD_PLUGIN([cdda])
    VLC_ADD_LDFLAGS([vcd vcdx cdda cddax],[-Wl,-framework,IOKit,-framework,CoreFoundation])
    VLC_ADD_LIBS([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, 1, [Define this if you have libcddb installed])
      VLC_ADD_LIBS([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 enabled)])
if test "${enable_dvb}" != "no"
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, [
      VLC_ADD_PLUGIN([dvb])
  ],[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(OpenGL/gl.h, [
      AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
        VLC_ADD_PLUGIN([screen])
        VLC_ADD_LDFLAGS([screen],[-Wl,-framework,OpenGL,-framework,ApplicationServices])
      ])
Eric Petit's avatar
Eric Petit committed
  elif test "${SYS}" = "mingw32"; then
    VLC_ADD_PLUGIN([screen])
    VLC_ADD_LIBS([screen],[-lgdi32])
  elif test "${SYS}" = "mingwce"; then
    CPPFLAGS="${CPPFLAGS_save}"
  elif test "${SYS}" = "beos"; then
    VLC_ADD_PLUGIN([screen])
    VLC_ADD_CXXFLAGS([screen],[])
    VLC_ADD_LIBS([screen],[-lbe])
    CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
      VLC_ADD_PLUGIN([screen])
      VLC_ADD_LIBS([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_PLUGIN([ogg])
      if test "${enable_sout}" != "no"; then
        VLC_ADD_PLUGIN([mux_ogg])
      VLC_ADD_LIBS([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_PLUGIN([ogg])
        if test "${enable_sout}" != "no"; then
          VLC_ADD_PLUGIN([mux_ogg])
        VLC_ADD_LIBS([ogg mux_ogg],[-logg])])
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_PLUGIN([mkv])
                VLC_ADD_LIBS([mkv],[-lmatroska -lebml_pic])
              ],
                AC_CHECK_LIB(ebml, main, [
                  VLC_ADD_PLUGIN([mkv])
                  VLC_ADD_LIBS([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_PLUGIN([mod])
      VLC_ADD_LIBS([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_PLUGIN([mod])
      VLC_ADD_LIBS([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_PLUGIN([mpc])
    VLC_ADD_LIBS([mpc],[-lmpcdec])])
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_PLUGIN([gme])
      VLC_ADD_LIBS([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_LIBS([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_LIBS([mpgatofixed32],[-L${real_mad_tree}/.libs])
      LDFLAGS="${LDFLAGS_save} ${LIBS_mpgatofixed32}"
gbazin's avatar
 
gbazin committed
      AC_CHECK_LIB(mad, mad_bit_init, [
        VLC_ADD_BUILTINS([mpgatofixed32])
        VLC_ADD_LIBS([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} ${LIBS_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_PLUGIN([mpgatofixed32])
      VLC_ADD_LIBS([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,
Christophe Mutricy's avatar
Christophe Mutricy committed
[  --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_LIBS([id3tag],[-lid3tag -lz])
      VLC_ADD_PLUGIN([id3tag])
Christophe Mutricy's avatar
Christophe Mutricy committed
[  --enable-avcodec        libavcodec codec (default enabled)])
  PKG_CHECK_MODULES(AVCODEC,[libavcodec libavutil],
    [
      VLC_SAVE_FLAGS
      CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
      CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
      AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h)
      AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
      VLC_ADD_PLUGIN([avcodec])
      VLC_ADD_LIBS([avcodec],[$AVCODEC_LIBS])
      VLC_ADD_CFLAGS([avcodec],[$AVCODEC_CFLAGS])
      VLC_RESTORE_FLAGS
    ],[
      AC_MSG_ERROR([Could not find libavcodec or libavutil. Use --disable-avcodec to ignore this error.])
Christophe Mutricy's avatar
Christophe Mutricy committed
[  --enable-avformat       libavformat containers (default enabled)])
if test "${enable_avformat}" != "no"
then
  PKG_CHECK_MODULES(AVFORMAT,[libavformat libavutil],
      VLC_SAVE_FLAGS
      CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
      CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
      AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h)
      AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
      VLC_ADD_PLUGIN([avformat])
      VLC_ADD_LIBS([avformat],[$AVFORMAT_LIBS])
      VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS])