Skip to content
Snippets Groups Projects
configure.ac 169 KiB
Newer Older
      ],[
        AC_MSG_ERROR([Could not find libva.])
    ])
  ],[
    AC_MSG_ERROR([libva VAAPI support depends on libavcodec.])
  ])
])

dnl
dnl stream_out switcher needs libavcodec
dnl
AC_ARG_ENABLE(switcher,
  [  --enable-switcher       Stream-out switcher plugin (default disabled)])
AS_IF([test "${enable_switcher}" = "yes"], [
  AS_IF([test "x${have_avcodec}" = "xyes"], [
    VLC_ADD_PLUGIN([stream_out_switcher])
    VLC_ADD_LIBS([stream_out_switcher],[$AVCODEC_LIBS $AVUTIL_LIBS])
    VLC_ADD_CFLAGS([stream_out_switcher],[$AVCODEC_CFLAGS $AVUTIL_CFLAGS])
  ],[AC_MSG_ERROR([Stream_out switcher depends on avcodec])
  ])
])


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)
      AS_IF([test "$enable_merge_ffmpeg" = "no"], [
        VLC_ADD_PLUGIN([avformat])
        VLC_ADD_LIBS([avformat],[$AVFORMAT_LIBS $AVUTIL_LIBS])
        VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])

        VLC_ADD_PLUGIN([access_avio])
        VLC_ADD_LIBS([access_avio],[$AVFORMAT_LIBS $AVUTIL_LIBS])
        VLC_ADD_CFLAGS([access_avio],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
      ], [
        VLC_ADD_LIBS([avcodec],[$AVFORMAT_LIBS $AVUTIL_LIBS])
        VLC_ADD_CFLAGS([avcodec],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
      ])
      AC_MSG_ERROR([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])
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
      AC_MSG_ERROR([Could not find libswscale. Use --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
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(postproc/postprocess.h)
      VLC_ADD_LIBS([postproc],[$POSTPROC_LIBS $AVUTIL_LIBS])
      VLC_ADD_CFLAGS([postproc],[$POSTPROC_CFLAGS $AVUTIL_CFLAGS])
      AC_MSG_ERROR([Could not find libpostproc. Use --disable-postproc to ignore this error.])
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}"
Christophe Mutricy's avatar
Christophe Mutricy committed
PKG_ENABLE_MODULES_VLC([TWOLAME], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
dnl
dnl  QuickTime plugin
dnl
AC_ARG_ENABLE(quicktime,
  [  --enable-quicktime      QuickTime module (deprecated)])
if test "${enable_quicktime}" = "yes"; then
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.])
PKG_ENABLE_MODULES_VLC([DCA], [dtstofloat32], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
gbazin's avatar
 
gbazin committed

gbazin's avatar
 
gbazin committed
dnl  Flac plugin
PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
gbazin's avatar
 
gbazin committed
dnl
dnl  Libmpeg2 plugin
dnl
PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
gbazin's avatar
 
gbazin committed

gbazin's avatar
 
gbazin committed
dnl
dnl  Vorbis plugin
dnl
PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
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
PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex decoder support], [auto])
gbazin's avatar
 
gbazin committed

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
PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theora >= 1.0], [experimental theora codec], [auto])
gbazin's avatar
 
gbazin committed

PKG_ENABLE_MODULES_VLC([DIRAC], [], [dirac >= 0.10.0], [dirac encoder], [auto])
dnl
dnl  schroedinger decoder plugin (for dirac format video)
dnl
PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.6], [dirac decoder using schroedinger], [auto])
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])],
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
      PKG_CHECK_MODULES(X264,x264 >= 0.76, [
        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 >= 0.76 on your system: you may get it from http://www.videolan.org/x264.html])
dnl
dnl libfluidsynth (MIDI synthetizer) plugin
dnl
PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth], [MIDI synthetiser with libfluidsynth], [auto])
  AS_HELP_STRING([--enable-zvbi],[VBI (inc. Teletext) decoding support with
                  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])
          if test "${SYS}" = "mingw32"; then
              VLC_ADD_LIBS([zvbi],[ -lpthreadGC2])
          VLC_ADD_CFLAGS([zvbi],[$ZVBI_CFLAGS])
          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.
                               Using zvbi.])
                  ])
        ],[
          AC_MSG_WARN(ZVBI library not found. Enabling the telx module instead)
        ])
AS_IF( [test "${enable_telx}" != "no" ],[
  VLC_ADD_PLUGIN([telx])
Laurent Aimar's avatar
Laurent Aimar committed
dnl
dnl libass subtitle rendering module
dnl
AC_ARG_ENABLE(libass,
  [  --enable-libass         Subtitle support using libass (default enabled)])
AS_IF( [test "${enable_libass}" != "no"], [
  PKG_CHECK_MODULES(LIBASS, libass >= 0.9.6,
        VLC_ADD_LIBS([libass],[$LIBASS_LIBS])
Laurent Aimar's avatar
Laurent Aimar committed
        VLC_ADD_CFLAGS([libass],[$LIBASS_CFLAGS])
        VLC_ADD_PLUGIN([libass])

        AC_CHECK_HEADERS(fontconfig/fontconfig.h,
          [VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
           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])
        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  tiger rendering for kate 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

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

dnl
dnl  X C Bindings modules
dnl
AC_ARG_ENABLE(xcb,
  [  --enable-xcb            X11 support with XCB (default enabled)],, [
  AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"], [
    enable_xcb="yes"
  ], [
    enable_xcb="no"
  ])
])
AC_ARG_ENABLE(xvideo,
  [  --enable-xvideo         XVideo support (default enabled)],, [
    enable_xvideo="$enable_xcb"
])
need_xid_provider="no"
AS_IF([test "${enable_xcb}" != "no"], [
  dnl libxcb
  PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
  VLC_ADD_PLUGIN([xcb_x11])
  VLC_ADD_PLUGIN([xcb_screen])
  VLC_ADD_PLUGIN([xcb_apps])
  VLC_SET_CFLAGS_WERROR([xcb_screen], [-Wno-error=uninitialized]) # some gcc report a warning which doesn't reveal an error
  AS_IF([test "${enable_xvideo}" != "no"], [
    PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [
      VLC_ADD_PLUGIN([xcb_xv])
    ], [
      PKG_CHECK_MODULES(XCB_XV, [xcb-xv], [
        VLC_ADD_PLUGIN([xcb_xv])
        VLC_ADD_CFLAGS([xcb_xv], [-DXCB_XV_OLD])
      ])
  PKG_CHECK_MODULES(XCB_RANDR, [xcb-randr >= 1.3], [
    VLC_ADD_PLUGIN([panoramix])
    VLC_ADD_LIBS([panoramix],[${XCB_RANDR_LIBS} ${XCB_LIBS}])
    VLC_ADD_CFLAGS([panoramix],[${XCB_RANDR_CFLAGS} ${XCB_CFLAGS}])
  ], [true])

  dnl xcb-utils
  PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [
    have_xcb_keysyms="yes"
  ], [
    PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms], [
      have_xcb_keysyms="yes"
      VLC_ADD_CFLAGS([globalhotkeys], [-DXCB_KEYSYM_OLD_API])
    ], [
      have_xcb_keysyms="no"
      need_xid_provider="yes"
    ])
  ])
  AS_IF([test "${have_xcb_keysyms}" = "yes"], [
    PKG_CHECK_MODULES(XPROTO, [xproto])
    VLC_ADD_PLUGIN([xcb_window])
    VLC_ADD_PLUGIN([globalhotkeys])
    VLC_ADD_CFLAGS([globalhotkeys], [${XCB_KEYSYMS_CFLAGS} ${XCB_CFLAGS}])
    VLC_ADD_LIBS([globalhotkeys], [${XCB_KEYSYMS_LIBS} ${XCB_LIBS}])
  ])
  VLC_ADD_PLUGIN([xdg_screensaver])
AC_ARG_ENABLE(glx,
  [  --enable-glx            X11 OpenGL (GLX) support (default enabled)],, [
  enable_glx="$enable_xcb"
])
AS_IF([test "${enable_glx}" != "no"], [
  PKG_CHECK_MODULES(XLIB_XCB, [x11-xcb])
  PKG_CHECK_MODULES(GL, [gl],, [
    AC_CHECK_HEADER([GL/gl.h], [
      GL_CFLAGS=""
      GL_LIBS="-lGL"
    ], [
      AC_MSG_ERROR([GLX (libGL) cannot be found. If you do not need OpenGL with X11, use --disable-glx.])
    ])
  ])
  VLC_ADD_PLUGIN([xcb_glx])
])
AC_SUBST([GL_CFLAGS])
AC_SUBST([GL_LIBS])
dnl  OpenGL module
dnl  (enabled by default except on beos)
  [  --enable-opengl         OpenGL support (default enabled)])
if test "${enable_opengl}" != "no" &&
   test "${SYS}" != "beos" -a "${SYS}" != "mingwce"; then
  if test "${SYS}" != "darwin"; then
      VLC_ADD_PLUGIN([opengl])
      if test "${SYS}" != "mingw32"; then
        VLC_ADD_LIBS([opengl],[${X_LIBS} -lGL -lGLU])
        VLC_ADD_LIBS([opengl],[-lopengl32 -lglu32])
      fi
    ])
  else
    dnl OS X special case (no GL/gl.h but OpenGL/gl.h)
    VLC_ADD_PLUGIN([opengl])
    VLC_ADD_LIBS([opengl],[-Wl,-framework,OpenGL])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
dnl  SDL module
dnl
AC_ARG_ENABLE(sdl,
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  [  --enable-sdl            SDL support (default enabled)])
Rafaël Carré's avatar
Rafaël Carré committed
  [  --enable-sdl-image      SDL image support (default enabled)])
if test "${enable_sdl}" != "no"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
    [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
    [ if test "${with_sdl_config_path}" != "no"
        SDL_PATH="${with_sdl_config_path}:${PATH}"
  AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
  SDL_HEADER="SDL/SDL.h"
  SDL_IMAGE="SDL/SDL_image.h"

  if test "${SDL_CONFIG}" != "no";  then
     PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [
        # SDL on Darwin is heavily patched and can only run SDL_image
        if test "${SYS}" != "darwin"; then
          VLC_ADD_PLUGIN([vout_sdl])
          VLC_ADD_PLUGIN([aout_sdl])
        fi
        VLC_ADD_CFLAGS([vout_sdl aout_sdl sdl_image],[`${SDL_CONFIG} --cflags | sed 's,SDL,,'`])
        VLC_ADD_LIBS([vout_sdl aout_sdl sdl_image],[`${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`])

        # SDL_image
        AS_IF([ test "${enable_sdl_image}" != "no"],[
          AC_CHECK_HEADERS("SDL/SDL_image.h", [
            VLC_ADD_PLUGIN([sdl_image])
            AC_CHECK_LIB(png, png_set_rows, [VLC_ADD_LIBS([sdl_image],[-lpng -lz])],[],[-lz])
            AC_CHECK_LIB(jpeg, jpeg_start_decompress, [VLC_ADD_LIBS([sdl_image],[-ljpeg])])
            AC_CHECK_LIB(tiff, TIFFClientOpen, [VLC_ADD_LIBS([sdl_image],[-ltiff])])
            VLC_ADD_LIBS([sdl_image], [-lSDL_image])],
            [ AC_MSG_WARN([The development package for SDL_image is not installed.
      You should install it alongside your SDL package.])
            ])
        ])
     ],[
       AC_MSG_ERROR([The development package for SDL is too old. You need 1.2.10.
                    Alternatively you can also configure with --disable-sdl.])
     ])
  else if test "${enable_sdl}" =  "yes"; then
    AC_MSG_ERROR([I could not find the SDL package. You can download libSDL
from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
    ])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

dnl
dnl  freetype module
dnl
AC_ARG_ENABLE(freetype,
  [  --enable-freetype       freetype support (default enabled)])
gbazin's avatar
 
gbazin committed
AC_ARG_ENABLE(fribidi,
  [  --enable-fribidi        fribidi support (default enabled)])
AC_ARG_ENABLE(fontconfig,
  [  --enable-fontconfig,    fontconfig support (default enabled)])
if test "${enable_freetype}" != "no"
      VLC_ADD_PLUGIN([freetype])
      VLC_ADD_CPPFLAGS([freetype skins2],[${FREETYPE_CFLAGS}])
        VLC_ADD_LIBS([freetype],[-liconv -lz])
      VLC_ADD_LIBS([freetype skins2],[${FREETYPE_LIBS}])
      if test "${enable_fontconfig}" != "no"
      then
        AC_CHECK_HEADERS(fontconfig/fontconfig.h,
          [VLC_ADD_CPPFLAGS([freetype],[-DHAVE_FONTCONFIG])
           VLC_ADD_LIBS([freetype],[-lfontconfig])])
        AC_CHECK_HEADERS(Carbon/Carbon.h,
          [VLC_ADD_LDFLAGS([freetype],[-Wl,-framework,Carbon])])
      fi

     dnl fribidi support
      if test "${enable_fribidi}" != "no"
      then
        PKG_CHECK_MODULES(FRIBIDI, fribidi, [
          VLC_ADD_CPPFLAGS([freetype skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
          VLC_ADD_LIBS([freetype skins2], [${FRIBIDI_LIBS}])
        ])
      fi

  ],[
  have_freetype=no
  AS_IF([ test "${enable_freetype}" =  "yes"],[
    AC_MSG_ERROR([I couldn't find the freetype package. You can download libfreetype2
from http://www.freetype.org/, or configure with --disable-freetype. Have a nice day.
gbazin's avatar
 
gbazin committed

gbazin's avatar
gbazin committed
dnl
dnl  libxml2 module
dnl
Christophe Mutricy's avatar
Christophe Mutricy committed
PKG_ENABLE_MODULES_VLC([LIBXML2], [xml], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
dnl
dnl Snapshot vout module (with cache)
dnl
AC_ARG_ENABLE(snapshot,
  [  --enable-snapshot       snapshot module (default disabled)])
if test "${enable_snapshot}" = "yes"
  VLC_ADD_PLUGIN([snapshot])
Jean-Paul Saman's avatar
Jean-Paul Saman committed
dnl
dnl Roku HD1000 Video output module
dnl
AC_ARG_ENABLE(hd1000v,
  [  --enable-hd1000v        HD1000 Video Output module (default enabled on HD1000)])
if test "${enable_hd1000v}" != "no" -a "${CXX}" != "" &&
  (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
   test "${enable_hd1000v}" = "yes"); then
Jean-Paul Saman's avatar
Jean-Paul Saman committed
  AC_LANG_PUSH([C++])
  AC_CHECK_HEADERS([cascade/graphics/CascadeScreen.h cascade/graphics/CascadeBitmap.h],
  [
    can_build_roku="yes"
  ],
  [
    can_build_roku="no"
    AC_MSG_WARN([Not building Roku HD1000 compatible video output])
  ])
  if test "$can_build_roku" = "yes"
  then
    VLC_ADD_PLUGIN([hd1000v])
    VLC_ADD_LIBS([hd1000v],[-lCascade -ldvbpsi -lmad])
Jean-Paul Saman's avatar
Jean-Paul Saman committed
  fi
  AC_LANG_POP([C++])
fi

Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
dnl  Windows DirectX module
dnl
if test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"
  VLC_ADD_PLUGIN([panoramix])
AC_ARG_ENABLE(directx,
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
if test "${enable_directx}" != "no"
  if test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"
gbazin's avatar
 
gbazin committed
      AC_CHECK_HEADERS(ddraw.h,
      [ VLC_ADD_PLUGIN([directx])
        VLC_ADD_PLUGIN([aout_directx])
        VLC_ADD_LIBS([directx],[-lgdi32])
      ],[AC_MSG_ERROR([Cannot find DirectX headers!])]
      )
      AC_CHECK_HEADERS(GL/gl.h,
      [ VLC_ADD_PLUGIN([glwin32])
        VLC_ADD_LIBS([glwin32],[-lopengl32 -lgdi32])
      ])
      AC_CHECK_HEADERS(d3d9.h,
      [ VLC_ADD_PLUGIN([direct3d])
        VLC_ADD_LIBS([direct3d],[-lgdi32])
      VLC_ADD_LIBS([direct3d directx glwin32],[-lole32])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

dnl
dnl  win32 GDI plugin
dnl
AC_ARG_ENABLE(wingdi,
  [  --enable-wingdi         Win32 GDI module (default enabled on Win32)])
if test "${enable_wingdi}" != "no"; then
  if test "${SYS}" = "mingw32"; then
    VLC_ADD_PLUGIN([wingdi])
    VLC_ADD_LIBS([wingdi],[-lgdi32 -lole32])
  fi
  if test "${SYS}" = "mingwce"; then
    VLC_ADD_PLUGIN([wingdi])
    VLC_ADD_PLUGIN([wingapi])
    VLC_ADD_LIBS([wingdi],[-laygshell])
    VLC_ADD_LIBS([wingapi],[-laygshell])
  fi
fi


gbazin's avatar
 
gbazin committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  Linux framebuffer module
gbazin's avatar
 
gbazin committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
    if test "${enable_fb}" != "no"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
    then
      AC_CHECK_HEADERS(linux/fb.h, [
        VLC_ADD_PLUGIN([fb])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
      ])
    fi
gbazin's avatar
 
gbazin committed

Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  Linux MGA module
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_ARG_ENABLE(mga,
  [  --enable-mga            Linux kernel Matrox support (default disabled)],
  [ if test "${enable_mga}" = "yes"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
    then
      VLC_ADD_PLUGIN([mga])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
    fi ])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

dnl
dnl  OMAP Framebuffer module
dnl
AC_ARG_ENABLE(omapfb,
  [  --enable-omapfb         OMAP framebuffer support (default disabled)])
    if test "${enable_omapfb}" = "yes"
    then
      AC_CHECK_HEADERS(asm/arch-omap/omapfb.h, [
        VLC_ADD_PLUGIN([omapfb])
        AC_CHECK_HEADERS(X11/Xlib.h, [
          VLC_ADD_LIBS([omapfb],[${X_LIBS} ${X_PRE_LIBS} -lX11]) ])
      ])
      VLC_ADD_PLUGIN([swscale_omap])
dnl
dnl  SVGAlib module
dnl
AC_ARG_ENABLE(svgalib,
  [  --enable-svgalib        SVGAlib support (default disabled)])
if test "${enable_svgalib}" = "yes"
  VLC_ADD_PLUGIN([svgalib])
  VLC_ADD_LIBS([svgalib],[-lvgagl -lvga])
dnl  try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
dnl  TODO: support for static linking
  [  --enable-directfb       DirectFB support (default disabled)])
AC_ARG_WITH(directfb,
  [    --with-directfb=PATH  path to DirectFB headers and libraries])

if test "${enable_directfb}" = "yes"; then
    have_directfb="false"
    CPPFLAGS_mydirectfb=
    LIBS_mydirectfb=
    if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
        dnl Trying the given location
        CPPFLAGS_save="${CPPFLAGS}"
        LIBS_save="${LIBS}"

        CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
        LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/"
        LIBS_new="${LIBS_new} -L${with_directfb}/src/.libs/"

        CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
        LIBS="${LIBS} ${LIBS_new}"

        dnl FIXME: too obscure
        AC_CHECK_HEADER([directfb.h], [
            AC_CHECK_LIB([direct],[direct_initialize], [
                AC_CHECK_LIB([fusion], [fusion_enter], [
                    AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
                ], have_directfb="false")