Skip to content
Snippets Groups Projects
configure.ac 196 KiB
Newer Older
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  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_PLUGIN([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,
[  --disable-id3tag        id3tag metadata reader plugin (default disabled)])
AS_IF([test "${enable_id3tag}" = "yes"], [
  AC_CHECK_HEADERS(id3tag.h, [
      AS_IF([test "${have_zlib}" = "yes"],[
          VLC_ADD_LIBS([id3tag],[-lid3tag -lz])
          VLC_ADD_PLUGIN([id3tag])
       ])
    ])
if test "${with_ffmpeg_tree}"
then
  AC_MSG_WARN([--with-ffmpeg-tree is deprecated. Use PKG_CONFIG_PATH instead.])
fi

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_FAILURE([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])
      VLC_RESTORE_FLAGS
    ],[
      AC_MSG_FAILURE([Could not find libavformat or libavutil. Use --disable-avformat to ignore this error.])
dnl
dnl  swscale image scaling and conversion plugin
dnl
  AS_HELP_STRING([--enable-swscale],[libswscale image scaling and conversion
Christophe Mutricy's avatar
Christophe Mutricy committed
		  (default enabled)]))
  PKG_CHECK_MODULES(SWSCALE,[libswscale],
      CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
      CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
      AC_CHECK_HEADERS(libswscale/swscale.h ffmpeg/swscale.h)
      VLC_ADD_PLUGIN([swscale])
      VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
      VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
      AC_MSG_WARN([Could not find libswscale. Trying to enable imgresample.])
      enable_imgresample=yes
  ])
fi

dnl
dnl  avcodec (deprecated API) image scaling and conversion plugin
dnl
dnl  This is build as a seperate module than the avcodec one to prevent
dnl  stupid run time library load errors from disabling most codecs
dnl  from VLC.
dnl

AC_ARG_ENABLE(imgresample,
  AS_HELP_STRING([--enable-imgresample],[deprecated libavcodec image scaling
Christophe Mutricy's avatar
Christophe Mutricy committed
		  and conversion (default disabled)]))
if test "${enable_imgresample}" = "yes"
then
  PKG_CHECK_MODULES(IMGRESAMPLE,[libavcodec],
    [
      VLC_SAVE_FLAGS
      CPPFLAGS="${CPPFLAGS} ${IMGRESAMPLE_CFLAGS}"
      CFLAGS="${CFLAGS} ${IMGRESAMPLE_CFLAGS}"
      AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h)
      AC_CHECK_LIB(avcodec,img_resample,
        [
          VLC_ADD_PLUGIN([imgresample])
          VLC_ADD_LIBS([imgresample],[$IMGRESAMPLE_LIBS])
          VLC_ADD_CFLAGS([imgresample],[$IMGRESAMPLE_CFLAGS])
        ],[
          AC_MSG_WARN([Could not find img_resample in libavcodec.])
          if test "${enable_swscale}" != "no"
          then
            AC_MSG_FAILURE([swscale (and its fallback module imgresample) support will be missing. Use --disable-swscale to ignore this error. (This basically means that you will be missing any good software scaling module and some video chroma converters.)])
	# That sed hack to add -rpath is kind of ugly but at least it fixes
        # detection when linking against a shared libavcodec with
        # a libavutil not in one of your ld.so.conf directories.
	# (for example a local install)
        ],[${IMGRESAMPLE_LIBS} `echo ${IMGRESAMPLE_LIBS}|sed s'/-L/-Wl,-rpath=/'`])
      AC_MSG_WARN([Could not find libavcodec.])
hartman's avatar
hartman committed

Christophe Mutricy's avatar
Christophe Mutricy committed
[  --enable-postproc       libpostproc image post-processing (default enabled)])
if test "${enable_postproc}" != "no"
then
  PKG_CHECK_MODULES(POSTPROC,[libpostproc libavutil],
    [
      VLC_SAVE_FLAGS
      CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
      CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
      AC_CHECK_HEADERS(libpostproc/postproc.h postproc/postprocess.h)
      VLC_ADD_PLUGIN([postproc])
      VLC_ADD_LIBS([postproc],[$POSTPROC_LIBS])
      VLC_ADD_CFLAGS([postproc],[$POSTPROC_CFLAGS])
    ],[
      AC_MSG_ERROR([Could not find libpostproc.])
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_PLUGIN([faad])
      VLC_ADD_LIBS([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} ${LIBS_faad}"
    AC_CHECK_HEADERS(faad.h, ,
      [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
    AC_CHECK_LIB(faad, faacDecOpen, [
      VLC_ADD_PLUGIN([faad])
      VLC_ADD_LIBS([faad],[-lfaad]) ],
      AC_CHECK_LIB(faad, NeAACDecOpen, [
        VLC_ADD_PLUGIN([faad])
        VLC_ADD_LIBS([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}/libtwolame/.libs/libtwolame.a"
      AC_MSG_RESULT(${real_twolame_tree}/libtwolame/.libs/libtwolame.a)
      VLC_ADD_PLUGIN([twolame])
      VLC_ADD_LIBS([twolame],[${real_twolame_tree}/libtwolame/.libs/libtwolame.a])
      VLC_ADD_CPPFLAGS([twolame],[-I${real_twolame_tree}/libtwolame -DLIBTWOLAME_STATIC])
      AC_MSG_ERROR([cannot find ${real_twolame_tree}/libtwolame/.libs/libtwolame.a, make sure you compiled libtwolame in ${with_twolame_tree}])
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_twolame} -DLIBTWOLAME_STATIC"
    LDFLAGS="${LDFLAGS_save} ${LIBS_twolame}"
    AC_CHECK_HEADERS(twolame.h, ,
      [ AC_MSG_ERROR([Cannot find development header for libtwolame...]) ])
    AC_CHECK_LIB(twolame, twolame_init, [
      VLC_ADD_PLUGIN([twolame])
      VLC_ADD_CPPFLAGS([twolame],[-DLIBTWOLAME_STATIC])
      VLC_ADD_LIBS([twolame],[-ltwolame]) ],
        [ AC_MSG_ERROR([Cannot find libtwolame library...]) ])
    LDFLAGS="${LDFLAGS_save}"
dnl
dnl  QuickTime plugin
dnl
AC_ARG_ENABLE(quicktime,
  [  --enable-quicktime      QuickTime module (default enabled on MacOS X)])
if test "${enable_quicktime}" != "no" &&
  (test "${SYS}" = "darwin" || test "${enable_quicktime}" = "yes")
gbazin's avatar
 
gbazin committed
  if test "${SYS}" = "mingw32"; then
    VLC_ADD_PLUGIN([quicktime])
gbazin's avatar
 
gbazin committed
  else
  AC_CHECK_HEADERS(QuickTime/QuickTime.h,
      VLC_ADD_LDFLAGS([quicktime],[-Wl,-framework,QuickTime,-framework,Carbon])
hartman's avatar
hartman committed
    ], [ AC_MSG_ERROR([cannot find QuickTime headers]) ])
gbazin's avatar
 
gbazin committed
  fi
  [  --enable-real           Real media module (default disabled)])
if test "${enable_real}" = "yes"; then
  VLC_ADD_PLUGIN([realaudio])
  VLC_ADD_PLUGIN([realvideo])
dnl
dnl  Real RTSP plugin
dnl
AC_ARG_ENABLE(realrtsp,
  [  --enable-realrtsp       Real RTSP module (default disabled)])
if test "${enable_realrtsp}" = "yes"; then
  VLC_ADD_PLUGIN([access_realrtsp])
AC_ARG_ENABLE(libsysfs,
  [  --enable-libsysfs       Get user key from firewire connected iPod via libsysfs (default enabled)])

AS_IF([test "${enable_libsysfs}" != "no"],[
  AC_CHECK_HEADERS(sysfs/libsysfs.h, [
    VLC_ADD_LIBS([mp4 mkv],[-lsysfs])
  ] )
])
ipkiss's avatar
ipkiss committed
dnl skins2 module
Christophe Mutricy's avatar
Christophe Mutricy committed
  [  --enable-libtar         libtar support for skins2 (default enabled)])
AS_IF([test "${enable_libtar}" != "no"],[
  AC_CHECK_HEADERS(libtar.h, [
    VLC_ADD_LIBS([skins2],[-ltar])
gbazin's avatar
 
gbazin committed
dnl
gbazin's avatar
 
gbazin committed
dnl A52/AC3 decoder plugin
gbazin's avatar
 
gbazin committed
dnl
gbazin's avatar
 
gbazin committed
AC_ARG_ENABLE(a52,
  [  --enable-a52            A/52 support with liba52 (default enabled)])
if test "${enable_a52}" != "no"
gbazin's avatar
 
gbazin committed
then
    [    --with-a52=PATH       a52 headers and libraries])
gbazin's avatar
 
gbazin committed
  AC_ARG_WITH(a52-tree,
    [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
Samuel Hocevar's avatar
Samuel Hocevar committed
  if test "${with_a52_tree}" != "no" -a -n "${with_a52_tree}"
gbazin's avatar
 
gbazin committed
  then
gbazin's avatar
 
gbazin committed
    real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
Samuel Hocevar's avatar
Samuel Hocevar committed
    if test -z "${real_a52_tree}"
gbazin's avatar
 
gbazin committed
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
    fi
    dnl  Use a custom a52dec
    AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
    if test -f ${real_a52_tree}/include/a52.h
    then
      AC_MSG_RESULT(yes)
      VLC_ADD_CPPFLAGS([a52tofloat32],[-I${real_a52_tree}])
      VLC_ADD_LIBS([a52tofloat32],[-L${real_a52_tree}/liba52/.libs])
      LDFLAGS="${LDFLAGS_save} ${LIBS_a52tofloat32}"
gbazin's avatar
 
gbazin committed
      AC_CHECK_LIB(a52, a52_free, [
        VLC_ADD_PLUGIN([a52tofloat32])
        VLC_ADD_CPPFLAGS([a52tofloat32],[-DUSE_A52DEC_TREE])
        VLC_ADD_LIBS([a52tofloat32],[-la52])
gbazin's avatar
 
gbazin committed
        ],[
        if test -f ${real_a52_tree}/liba52/.libs/liba52.a
        then
          AC_MSG_ERROR([make sure you have at least a52dec-0.7.3 ($real_a52_tree)])
gbazin's avatar
 
gbazin committed
        else
          AC_MSG_ERROR([the specified tree hasn't been compiled])
        fi
gbazin's avatar
 
gbazin committed
    else
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([the specified tree doesn't have a52.h])
    fi
Samuel Hocevar's avatar
Samuel Hocevar committed
    if test -z "${with_a52}"
      LDFLAGS_test="-L${with_a52}/lib"
      CPPFLAGS_test="-I${with_a52}/include"
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_test} ${LIBS_a52tofloat32}"
gbazin's avatar
 
gbazin committed
      AC_CHECK_LIB(a52, a52_free, [
        VLC_ADD_PLUGIN([a52tofloat32])
        VLC_ADD_LIBS([a52tofloat32],[${LDFLAGS_test} -la52])
        VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
gbazin's avatar
 
gbazin committed
        AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
    ],[
      AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
gbazin's avatar
 
gbazin committed
    ])
    CPPFLAGS="${CPPFLAGS_save}"
    LDFLAGS="${LDFLAGS_save}"
gbazin's avatar
 
gbazin committed
  fi
gbazin's avatar
 
gbazin committed
fi

AC_ARG_WITH(a52-fixed,
      [    --with-a52-fixed      specify if liba52 has been compiled with fixed point support],
      [
        VLC_ADD_CPPFLAGS([a52tofloat32],[-DLIBA52_FIXED]) ])

gbazin's avatar
 
gbazin committed
dnl
dnl DTS Coherent Acoustics decoder plugin
dnl
AS_IF([test "x${enable_dts}" != "x"], [
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
  AC_MSG_ERROR([--enable-dts is obsolete. Please use libdca and --enable-dca.])
])
AS_IF([test "x${with_dts_tree}" != "x"], [
  AC_MSG_ERROR([--with-dts-tree is obsolete. Please use libdca and --with-dca-tree.])
])

AC_ARG_ENABLE(dca,
  AS_HELP_STRING([--enable-dca],[DTS Coherent Acoustics support with libdca
Christophe Mutricy's avatar
Christophe Mutricy committed
		  (default enabled)]))
AS_IF([test "${enable_dca}" != "no"], [
  AC_ARG_WITH(dca-tree,
    [    --with-dca-tree=PATH  libdca tree for static linking],,
    [with_dca_tree="no"])
  AS_IF([test "${with_dca_tree}" != "no"], [
    real_dca_tree="`cd ${with_dca_tree} 2>/dev/null && pwd`"
    AS_IF([test -z "${real_dca_tree}"], [
gbazin's avatar
 
gbazin committed
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([${with_dca_tree} directory doesn't exist])
    ])
    dnl  Use a custom libdca
    AC_MSG_CHECKING(for libdca in ${real_dca_tree})
    AS_IF([test -f "${real_dca_tree}/libdca/.libs/libdca.a"], [
gbazin's avatar
 
gbazin committed
      AC_MSG_RESULT(yes)
      VLC_ADD_LIBS([dtstofloat32],[${real_dca_tree}/libdca/.libs/libdca.a])
      AS_IF([test -f "${real_dca_tree}/include/dca.h"], [
        VLC_ADD_CPPFLAGS([dtstofloat32],[-I${real_dca_tree}/include])
      ], [
        VLC_ADD_CPPFLAGS([dtstofloat32],[-I${real_dca_tree}/../include])
      ])
    ], [
gbazin's avatar
 
gbazin committed
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([the specified tree doesn't have libdca/.libs/libdca.a])
gbazin's avatar
 
gbazin committed
    ])
  ], [
    PKG_CHECK_MODULES([DCA], [libdca >= 0.0.5], [
      VLC_ADD_PLUGIN([dtstofloat32])
      VLC_ADD_CPPFLAGS([dtstofloat32], [${DCA_CFLAGS}])
      VLC_ADD_LIBS([dtstofloat32], [${DCA_LIBS}])
    ], [
      AS_IF([test "x${enable_dca}" != "x"], [
        AC_MSG_ERROR([${DCA_PKG_ERRORS}])
      ])
    ])
  ])
])
gbazin's avatar
 
gbazin committed

gbazin's avatar
 
gbazin committed
dnl  Flac plugin
  [  --enable-flac           libflac decoder/encoder support (default disabled)])
if test "${enable_flac}" = "yes"
  AC_ARG_WITH(flac-tree,
  [    --with-flac-tree=PATH flac tree for static linking])
  if test -n "${with_flac_tree}"
  then
    AC_MSG_CHECKING(for libFLAC.a in ${with_flac_tree})
    real_flac_tree="`cd ${with_flac_tree} 2>/dev/null && pwd`"
    if test -z "${real_flac_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_flac_tree}])
    fi
    if test -f "${real_flac_tree}/src/libFLAC/.libs/libFLAC.a"
    then
      dnl  Use a custom flac
      AC_MSG_RESULT(${real_flac_tree}/src/libFLAC/.libs/libFLAC.a)
      VLC_ADD_LIBS([flac],[${real_flac_tree}/src/libFLAC/.libs/libFLAC.a])
      VLC_ADD_CFLAGS([flac],[-I${real_flac_tree}/include])
      AC_DEFINE(HAVE_FLAC_STREAM_DECODER_H, 1, [Define if you have FLAC])
    else
      dnl  The given flac wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_flac_tree}/src/libFLAC/.libs/libFLAC.a, make sure you compiled flac in ${with_flac_tree}])
    fi
  else
    AC_CHECK_HEADERS(FLAC/stream_decoder.h, [
      VLC_ADD_LIBS([flac],[-lFLAC -logg])
gbazin's avatar
 
gbazin committed
dnl
dnl  Libmpeg2 plugin
dnl
AC_ARG_ENABLE(libmpeg2,
gbazin's avatar
 
gbazin committed
  [  --enable-libmpeg2       libmpeg2 decoder support (default enabled)])
if test "${enable_libmpeg2}" != "no"
gbazin's avatar
 
gbazin committed
then
  AC_ARG_WITH(libmpeg2-tree,
  [    --with-libmpeg2-tree=PATH libmpeg2 tree for static linking])
  AS_IF([test -n "${with_libmpeg2_tree}"],[
    AC_MSG_CHECKING(for libmpeg2.a in ${with_libmpeg2_tree})
    real_libmpeg2_tree="`cd ${with_libmpeg2_tree} 2>/dev/null && pwd`"
Samuel Hocevar's avatar
Samuel Hocevar committed
    if test -z "${real_libmpeg2_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_libmpeg2_tree}])
    fi
    if test -f "${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a"
    then
      dnl  Use a custom libmpeg2
      AC_MSG_RESULT(${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a)
      VLC_ADD_PLUGIN([libmpeg2])
      VLC_ADD_LIBS([libmpeg2],[-L${real_libmpeg2_tree}/libmpeg2/.libs -lmpeg2])
      VLC_ADD_CFLAGS([libmpeg2],[-I${real_libmpeg2_tree}/include])
    else
      dnl  The given libmpeg2 wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a, make sure you compiled libmpeg2 in ${with_libmpeg2_tree}])
    fi
   PKG_CHECK_MODULES(LIBMPEG2,[libmpeg2 > 0.3.2],[
          VLC_ADD_PLUGIN([libmpeg2])
Vincent Penquerc'h's avatar
Vincent Penquerc'h committed
          VLC_ADD_LIBS([libmpeg2], $LIBMPEG2_LIBS)
          VLC_ADD_CFLAGS([libmpeg2], $LIBMPEG2_CFLAGS)
      AC_MSG_WARN([Could not find libmpeg2 on your system: you may get it from http://libmpeg2.sf.net/ . Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.]))
  ])
gbazin's avatar
 
gbazin committed
fi

gbazin's avatar
 
gbazin committed
dnl
dnl  Vorbis plugin
dnl
AC_ARG_ENABLE(vorbis,
gbazin's avatar
 
gbazin committed
  [  --enable-vorbis         Vorbis decoder support (default enabled)])
if test "${enable_vorbis}" != "no"
gbazin's avatar
 
gbazin committed
then
  AC_ARG_WITH(vorbis-tree,
  [    --with-vorbis-tree=PATH vorbis tree for static linking])
  if test -n "${with_vorbis_tree}"
  then
    AC_MSG_CHECKING(for libvorbis.a in ${with_vorbis_tree})
    real_vorbis_tree="`cd ${with_vorbis_tree} 2>/dev/null && pwd`"
    if test -z "${real_vorbis_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_vorbis_tree}])
    fi
    if test -f "${real_vorbis_tree}/lib/.libs/libvorbis.a"
    then
      dnl  Use a custom vorbis
      AC_MSG_RESULT(${real_vorbis_tree}/lib/.libs/libvorbis.a)
      VLC_ADD_PLUGIN([vorbis])
      VLC_ADD_LIBS([vorbis],[${real_vorbis_tree}/lib/.libs/libvorbis.a ${real_vorbis_tree}/lib/.libs/libvorbisenc.a])
      VLC_ADD_CFLAGS([vorbis],[-I${real_vorbis_tree}/include])
    else
      dnl  The given vorbis wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_vorbis_tree}/lib/.libs/libvorbis.a, make sure you compiled vorbis in ${with_vorbis_tree}])
    fi
  else
    AC_CHECK_HEADERS(vorbis/codec.h, [
      VLC_ADD_PLUGIN([vorbis])
      VLC_ADD_LIBS([vorbis],[-lvorbis -logg -lm]) ],[])
gbazin's avatar
 
gbazin committed

    AC_CHECK_HEADERS(vorbis/vorbisenc.h, [
      VLC_ADD_LIBS([vorbis],[-lvorbisenc -lm]) ],[])
gbazin's avatar
 
gbazin committed
fi
gbazin's avatar
 
gbazin committed

gbazin's avatar
 
gbazin committed
dnl
dnl  Tremor plugin
dnl
AC_ARG_ENABLE(tremor,
  [  --enable-tremor         Tremor decoder support (default disabled)])
if test "${enable_tremor}" = "yes"
gbazin's avatar
 
gbazin committed
then
  AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
    VLC_ADD_PLUGIN([tremor])
    VLC_ADD_LIBS([tremor],[-lvorbisidec -logg])
gbazin's avatar
 
gbazin committed
   ],[])
fi

gbazin's avatar
 
gbazin committed
dnl
dnl  Speex plugin
dnl
AC_ARG_ENABLE(speex,
hartman's avatar
hartman committed
  [  --enable-speex          Speex decoder support (default enabled)])
gbazin's avatar
 
gbazin committed
if test "${enable_speex}" != "no"
then
  AC_ARG_WITH(speex-tree,
  [    --with-speex-tree=PATH speex tree for static linking])
  if test -n "${with_speex_tree}"
  then
    AC_MSG_CHECKING(for libspeex.a in ${with_speex_tree})
    real_speex_tree="`cd ${with_speex_tree} 2>/dev/null && pwd`"
    if test -z "${real_speex_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_speex_tree}])
    fi
    if test -f "${real_speex_tree}/libspeex/.libs/libspeex.a"
    then
      dnl  Use a custom speex
      AC_MSG_RESULT(${real_speex_tree}/libspeex/.libs/libspeex.a)
      VLC_ADD_PLUGIN([speex])
      VLC_ADD_LIBS([speex],[${real_speex_tree}/libspeex/.libs/libspeex.a])
      VLC_ADD_CFLAGS([speex],[-I${real_speex_tree}/include])
    else
      dnl  The given speex wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_speex_tree}/libspeex/.libs/libspeex.a, make sure you compiled speex in ${with_speex_tree}])
    fi
  else
    AC_CHECK_HEADERS(speex/speex.h, [
      LDFLAGS="${LDFLAGS_save} ${LIBS_speex}"
      AC_CHECK_LIB(speex, speex_decode_int, [
        VLC_ADD_PLUGIN([speex])
        VLC_ADD_LIBS([speex],[-lspeex]) ],
        [ AC_MSG_RESULT([no])
          AC_MSG_WARN([Your libspeex is too old, please get the development
                       version.]) ],[])
      LDFLAGS="${LDFLAGS_save}"
      ],[])
  fi
gbazin's avatar
 
gbazin committed
fi

gbazin's avatar
 
gbazin committed
dnl
dnl  tarkin decoder plugin
dnl
AC_ARG_ENABLE(tarkin,
[  --enable-tarkin         experimental tarkin codec (default disabled)])
if test "${enable_tarkin}" = "yes"
gbazin's avatar
 
gbazin committed
then
  AC_ARG_WITH(tarkin-tree,
  [    --with-tarkin-tree=PATH tarkin tree for static linking])
Samuel Hocevar's avatar
Samuel Hocevar committed
  if test -n "${with_tarkin_tree}"
gbazin's avatar
 
gbazin committed
  then
    AC_MSG_CHECKING(for tarkin.o in ${with_tarkin_tree})
    real_tarkin_tree="`cd ${with_tarkin_tree} 2>/dev/null && pwd`"
    if test -f "${real_tarkin_tree}/tarkin.o"
    then
      VLC_ADD_PLUGIN([tarkin])
      VLC_ADD_CPPFLAGS([tarkin],[-I${real_tarkin_tree}])
      VLC_ADD_LIBS([tarkin],[${real_tarkin_tree}/mem.o ${real_tarkin_tree}/pnm.o ${real_tarkin_tree}/wavelet.o ${real_tarkin_tree}/wavelet_xform.o ${real_tarkin_tree}/wavelet_coeff.o ${real_tarkin_tree}/yuv.o ${real_tarkin_tree}/tarkin.o ${real_tarkin_tree}/info.o -logg])
gbazin's avatar
 
gbazin committed
      AC_MSG_RESULT(yes)
gbazin's avatar
 
gbazin committed
    else
      dnl  The given tarkin tree wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_tarkin_tree}/tarkin.o,
                    make sure you compiled tarkin in ${with_tarkin_tree}])
    fi
  fi
fi

gbazin's avatar
 
gbazin committed
dnl
dnl  theora decoder plugin
dnl
AC_ARG_ENABLE(theora,
[  --enable-theora         experimental theora codec (default disabled)])
if test "${enable_theora}" = "yes"
gbazin's avatar
 
gbazin committed
then
  AC_CHECK_HEADERS(theora/theora.h, [
    AC_CHECK_LIB(theora, theora_granule_time, [
      VLC_ADD_PLUGIN([theora])
      theora_libs="-ltheora -logg"
      VLC_ADD_LIBS([theora],[${theora_libs}]) ],[
      AC_MSG_ERROR([libtheora doesn't appear to be installed on your system.
gbazin's avatar
 
gbazin committed
You also need to check that you have a libogg posterior to the 1.0 release.])],
      [-logg])
  ])
fi

dnl
dnl  dirac decoder plugin
dnl
AC_ARG_ENABLE(dirac,
[  --enable-dirac          experimental dirac codec (default disabled)])
if test "${enable_dirac}" = "yes"; then
  PKG_CHECK_MODULES(DIRAC,[dirac >= 0.10.0], [
      VLC_ADD_PLUGIN([dirac])
Christophe Mutricy's avatar
Christophe Mutricy committed
      VLC_ADD_CFLAGS([dirac],[$DIRAC_CFLAGS])
      VLC_ADD_LIBS([dirac],[$DIRAC_LIBS -lstdc++]) ],[
      AC_MSG_ERROR([libdirac >= 0.10.0 doesn't appear to be installed on your system.])
dnl
dnl  schroedinger decoder plugin (for dirac format video)
dnl
AC_ARG_ENABLE(schroedinger,
Christophe Mutricy's avatar
Christophe Mutricy committed
[  --disable-schroedinger  high performance dirac codec (default enabled)])
if test "${enable_schroedinger}" != "no"; then
  PKG_CHECK_MODULES(SCHROEDINGER,[schroedinger-1.0 >= 1.0.6], [
      VLC_ADD_PLUGIN([schroedinger])
      VLC_ADD_CFLAGS([schroedinger],[$SCHROEDINGER_CFLAGS])
      VLC_ADD_LIBS([schroedinger],[$SCHROEDINGER_LIBS]) ], [
        AS_IF([test "x${enable_schroedinger}" != "x"], [
          AC_MSG_ERROR([${SCHROEDINGER_PKG_ERRORS}])
        ])
])
fi

dnl
dnl  PNG decoder module
dnl
AC_ARG_ENABLE(png,
  [  --enable-png            PNG support (default enabled)])
if test "${enable_png}" != "no"; then
AC_CHECK_HEADERS(png.h, [
  LDFLAGS="${LDFLAGS_save} -lz"
  AC_CHECK_LIB(png, png_set_rows, [
    VLC_ADD_LIBS([png],[-lpng -lz])
    VLC_ADD_PLUGIN([png])
    VLC_ADD_PLUGIN([osdmenu])
    VLC_ADD_PLUGIN([osd_parser])
    AC_DEFINE(HAVE_LIBPNG, 1, [Define if you have the PNG library: libpng])],
AM_CONDITIONAL(BUILD_OSDMENU, [test "${enable_png}" != "no"])
dnl
dnl H264 encoder plugin (using libx264)
dnl
AC_ARG_ENABLE(x264,
  [  --enable-x264           H264 encoding support with libx264 (default enabled)])
if test "${enable_x264}" != "no"; then
  AC_ARG_WITH(x264-tree,
    [    --with-x264-tree=PATH x264 tree for static linking ],[],[])
  if test "${with_x264_tree}" != "no" -a -n "${with_x264_tree}"
  then
    real_x264_tree="`cd ${with_x264_tree} 2>/dev/null && pwd`"
    if test -z "${real_x264_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([${with_x264_tree} directory doesn't exist])
    fi
    dnl  Use a custom libx264
    AC_MSG_CHECKING(for x264.h in ${real_x264_tree})
    if test -f ${real_x264_tree}/x264.h
    then
      AC_MSG_RESULT(yes)
      VLC_ADD_CPPFLAGS([x264],[-I${real_x264_tree}])
      VLC_ADD_LIBS([x264],[-L${real_x264_tree}])
bigben's avatar
 
bigben committed
      PKG_CHECK_MODULES(X264,x264, [
        VLC_ADD_PLUGIN([x264])
        VLC_ADD_LDFLAGS([x264],[${X264_LIBS}])
bigben's avatar
 
bigben committed
        VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
ssbssa's avatar
ssbssa committed
        if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
          VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
        fi
      ],[
        AC_MSG_ERROR([the specified tree hasn't been compiled])
      ])
      LDFLAGS="${LDFLAGS_save}"
    else
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([the specified tree doesn't have x264.h])
    fi
  else
bigben's avatar
 
bigben committed
      PKG_CHECK_MODULES(X264,x264, [
        VLC_ADD_PLUGIN([x264])
        VLC_ADD_LDFLAGS([x264],[${X264_LIBS}])

        AC_CACHE_CHECK([if linker supports -Bsymbolic],
          [ac_cv_ld_bsymbolic],
          [LDFLAGS="${LDFLAGS_vlc} -Wl,-Bsymbolic"
            AC_TRY_LINK([],,ac_cv_ld_bsymbolic=yes,ac_cv_ld_bsymbolic=no)
            LDFLAGS="${LDFLAGS_save}"
          ])
        AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
          VLC_ADD_LDFLAGS([x264],[-Wl,-Bsymbolic])
        ])

bigben's avatar
 
bigben committed
        VLC_ADD_CFLAGS([x264],[${X264_CFLAGS}])
ssbssa's avatar
ssbssa committed
        if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
          VLC_ADD_CFLAGS([x264], [-DPTW32_STATIC_LIB])
        fi
      ],[
        if test "${enable_x264}" = "yes"; then
            AC_MSG_ERROR([Could not find libx264 on your system: you may get it from http://www.videolan.org/x264.html])
          fi
      ])
    LDFLAGS="${LDFLAGS_save}"
  fi
fi

dnl
dnl libfluidsynth (MIDI synthetizer) plugin
dnl
AC_ARG_ENABLE(fluidsynth,
  [  --enable-fluidsynth     MIDI synthesisr with libfluidsynth (default enabled)])
AS_IF([test "x${enable_fluidsynth}" != "xno"], [
  PKG_CHECK_MODULES(FLUIDSYNTH, fluidsynth, [
    VLC_ADD_PLUGIN(fluidsynth)
    VLC_ADD_CFLAGS(fluidsynth, [${FLUIDSYNTH_CFLAGS}])
    VLC_ADD_LIBS(fluidsynth, [${FLUIDSYNTH_LIBS}])
  ], [
    AS_IF([test "x${enable_fluidsynth}" != "x"], [
      AC_MSG_ERROR([${FLUIDSYNTH_PKG_ERRORS}])
    ])
  ])
])

  AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
Christophe Mutricy's avatar
Christophe Mutricy committed
		  libzvbi (default enabled)]))
  AS_HELP_STRING([--enable-telx],[Teletext decoding module (conflicting with
		  zvbi) (default enabled if zvbi is absent)]))

AS_IF( [test "${enable_zvbi}" != "no"],[
    PKG_CHECK_MODULES(ZVBI,
    	zvbi-0.2 >= 0.2.25,
    	[
    	  VLC_ADD_LIBS([zvbi],[$ZVBI_LIBS])
          VLC_ADD_PLUGIN([zvbi])
	  AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
	  AS_IF( [test "${enable_telx}" = "yes"],[
		  AC_MSG_WARN([The zvbi and telx modules are uncompatibles.
	],[
	  AC_MSG_WARN(ZVBI library not found. Enabling the telx module instead)
	])
AS_IF( [test "${enable_telx}" != "no" ],[
  VLC_ADD_PLUGIN([telx])
dnl
dnl asa/csri subtitle rendering module
dnl
AC_ARG_ENABLE(csri,
Christophe Mutricy's avatar
Christophe Mutricy committed
  [  --enable-csri           Subtitle support using CSRI / asa (default disabled)])
Christophe Mutricy's avatar
Christophe Mutricy committed
AS_IF( [test "${enable_csri}" = "yes"], [
  PKG_CHECK_MODULES(CSRI,
      csri >= 0.1.0,
      [
        VLC_ADD_LDFLAGS([csri],[$CSRI_LIBS])
        VLC_ADD_CFLAGS([csri],[$CSRI_CFLAGS])
        VLC_ADD_PLUGIN([csri])
      ],[
        AC_MSG_WARN([CSRI helper library not found])
      ])
  ])

Laurent Aimar's avatar
Laurent Aimar committed
dnl
dnl libass subtitle rendering module
dnl
AC_ARG_ENABLE(libass,
Christophe Mutricy's avatar
Christophe Mutricy committed
  [  --enable-libass         Subtitle support using libass (default disabled)])
Laurent Aimar's avatar
Laurent Aimar committed
AS_IF( [test "${enable_libass}" = "yes"], [
  PKG_CHECK_MODULES(LIBASS, libass >= 0.9.5,
Laurent Aimar's avatar
Laurent Aimar committed
      [
        VLC_ADD_LDFLAGS([libass],[$LIBASS_LIBS])
        VLC_ADD_CFLAGS([libass],[$LIBASS_CFLAGS])
        VLC_ADD_PLUGIN([libass])

        AC_CHECK_HEADERS(fontconfig/fontconfig.h,
          [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
        if test "${SYS}" = "mingw32"; then
           VLC_ADD_LIBS([libass],[-lfontconfig -lfreetype -liconv -lz -lxml2])
        else
           VLC_ADD_LIBS([libass],[-lfontconfig])
Laurent Aimar's avatar
Laurent Aimar committed
      ],[
        AC_MSG_WARN([LIBASS library not found])
      ])
  ])

dnl
dnl asa demuxer
dnl
AC_ARG_ENABLE(asademux,
Christophe Mutricy's avatar
Christophe Mutricy committed
  [  --enable-asademux       asa subtitle demuxing (default disabled)])
Christophe Mutricy's avatar
Christophe Mutricy committed
AS_IF( [test "${enable_asademux}" = "yes"], [
  PKG_CHECK_MODULES(PCRE,
      libpcre >= 6.5,
      [
        VLC_ADD_LDFLAGS([asademux],[$PCRE_LIBS])
        VLC_ADD_CFLAGS([asademux],[$PCRE_CFLAGS])
	if test "${SYS}" = "mingw32"; then
	        VLC_ADD_CPPFLAGS([asademux],[-DPCRE_STATIC])
        fi
        VLC_ADD_PLUGIN([asademux])
      ],[
        AC_MSG_WARN([PCRE library not found (required for asademux)])
      ])
  ])

dnl
dnl  CMML plugin
dnl
AC_ARG_ENABLE(cmml,
  [  --enable-cmml           CMML support (default enabled)])
if test "${enable_cmml}" != "no"
then
  VLC_ADD_PLUGIN([cmml])
dnl
dnl  kate decoder plugin
dnl
AC_ARG_ENABLE(kate,
[  --enable-kate           kate codec (default enabled)])
AS_IF([test "${enable_kate}" != "no"], [
      VLC_ADD_PLUGIN([kate])
      VLC_ADD_CFLAGS([kate],[$KATE_CFLAGS])
      VLC_ADD_LIBS([kate],[$KATE_LIBS]) ],[
        AC_CHECK_HEADERS(kate/kate.h, [
          AC_CHECK_LIB(kate, kate_decode_init, [
            VLC_ADD_PLUGIN([kate])
            kate_libs="-lkate -logg"
            VLC_ADD_LDFLAGS([kate],[${kate_libs}]) ],[
            AS_IF([test "x${enable_kate}" != "x"], [
              AC_MSG_ERROR([libkate doesn't appear to be installed on your system.
              You also need to check that you have a libogg posterior to the 1.0 release.])
          AS_IF([test "x${enable_kate}" != "x"], [
            AC_MSG_ERROR([libkate headers do not appear to be installed on your system.
            You also need to check that you have a libogg posterior to the 1.0 release.])
dnl
dnl  tiger decoder plugin
dnl
AC_ARG_ENABLE(tiger,
[  --enable-tiger          Tiger rendering library for Kate streams (default enabled)])
AS_IF([test "${enable_tiger}" != "no"], [
  PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
      AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])
      VLC_ADD_CFLAGS([kate],[$TIGER_CFLAGS])
      VLC_ADD_LIBS([kate],[$TIGER_LIBS]) ],[
        AS_IF([test "x${enable_tiger}" != "x"], [
          AC_MSG_ERROR([libtiger does not appear to be installed on your system.])
        ])
  ])
])


Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  Video plugins
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl