Skip to content
Snippets Groups Projects
configure.ac 127 KiB
Newer Older
Pierre Ynard's avatar
Pierre Ynard committed
    PKG_CHECK_MODULES(SID, [libsidplay2], [
        AC_LANG_PUSH(C++)
        oldCPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $SID_CFLAGS"
        AC_CHECK_HEADER([sidplay/builders/resid.h], [
            VLC_ADD_PLUGIN([sid])
            VLC_ADD_CFLAGS([sid], [$SID_CFLAGS])
            VLC_ADD_LIBS([sid], [$SID_LIBS] [-lresid-builder])
        ], [
            AS_IF([test -n "${enable_sid}"],
                [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
                [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
                )
        ])
        CPPFLAGS="$oldCPPFLAGS"
        AC_LANG_POP(C++)
    ], [
        AS_IF([test "x${enable_sid}" = "xyes"],
            [AC_MSG_ERROR([${SID_PKG_ERRORS} (required for sid).])],
            [AC_MSG_WARN([${SID_PKG_ERRORS} (required for sid).])]
gbazin's avatar
 
gbazin committed
dnl
gbazin's avatar
 
gbazin committed
dnl  ogg demux plugin
gbazin's avatar
 
gbazin committed
dnl
PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto])
if test "${enable_sout}" != "no"; then
    PKG_ENABLE_MODULES_VLC([MUX_OGG], [], [ogg >= 1.0], [Ogg mux support], [auto])
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
dnl Check for libshout
    PKG_ENABLE_MODULES_VLC([SHOUT], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
gbazin's avatar
 
gbazin committed
dnl
dnl  matroska demux plugin
dnl
AC_ARG_ENABLE(mkv,
  [AS_HELP_STRING([--disable-mkv],
    [do not use libmatroska (default auto)])])
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 >= 1.0.0)
    AC_EGREP_CPP(yes,
      [#include <ebml/EbmlVersion.h>
       #ifdef LIBEBML_VERSION
       #if LIBEBML_VERSION >= 0x010000
       yes
       #endif
       #endif],
      [AC_MSG_RESULT([yes])
        AC_CHECK_HEADERS(matroska/KaxVersion.h, [
          AC_MSG_CHECKING(for libmatroska version >= 1.0.0)
          AC_EGREP_CPP(yes,
            [#include <matroska/KaxVersion.h>
             #ifdef LIBMATROSKA_VERSION
             #if LIBMATROSKA_VERSION >= 0x010000
             yes
             #endif
             #endif],
            [AC_MSG_RESULT([yes])
              AC_CHECK_HEADERS(matroska/KaxAttachments.h)
              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,
  [AS_HELP_STRING([--disable-mod],
    [do not use libmodplug (default auto)])])
if test "${enable_mod}" != "no" ; then
    PKG_CHECK_MODULES(LIBMODPLUG, [libmodplug >= 0.8.4 libmodplug != 0.8.8], [
          VLC_ADD_PLUGIN([mod])
          VLC_ADD_CXXFLAGS([mod],[$LIBMODPLUG_CFLAGS])
          VLC_ADD_LIBS([mod],[$LIBMODPLUG_LIBS])
       AS_IF([test -n "${enable_mod}"],
         [AC_MSG_ERROR([${LIBMODPLUG_PKG_ERRORS}.])],
         [AC_MSG_WARN([${LIBMODPLUG_PKG_ERRORS}.])])
gbazin's avatar
 
gbazin committed
fi

  [AS_HELP_STRING([--disable-mpc], [do not use libmpcdec (default auto)])])
Yavor Doganov's avatar
Yavor Doganov committed
  AC_CHECK_HEADERS([mpc/mpcdec.h], [
    VLC_ADD_PLUGIN([mpc])
Yavor Doganov's avatar
Yavor Doganov committed
    VLC_ADD_LIBS([mpc],[-lmpcdec])],
    [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [
    VLC_ADD_PLUGIN([mpc])
    VLC_ADD_LIBS([mpc],[-lmpcdec])])])
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

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

dnl
dnl wmafixed plugin
dnl
AC_ARG_ENABLE(wma-fixed,
  [  --enable-wma-fixed      libwma-fixed module (default disabled)])
if test "${enable_wma_fixed}" = "yes"
then
  VLC_ADD_PLUGIN([wma_fixed])
fi

dnl
dnl shine fixed point mp3 encoder
dnl
AC_ARG_ENABLE(shine,
  [  --enable-shine          shine mp3 encoding module (default disabled)])
if test "${enable_shine}" = "yes"
then
  VLC_ADD_PLUGIN([shine])
fi

dnl
dnl openmax il codec plugin
dnl
AC_ARG_ENABLE(omxil,
  [  --enable-omxil          openmax il codec module (default disabled)])
if test "${enable_omxil}" = "yes"
then
  VLC_ADD_PLUGIN([omxil])
  VLC_ADD_LIBS([omxil], [$LIBDL])
dnl
dnl iomx codec plugin
dnl
AC_ARG_ENABLE(iomx,
  [  --enable-iomx           iomx codec module (default disabled)])
if test "${enable_iomx}" = "yes"
then
  VLC_ADD_PLUGIN([iomx])
dnl
dnl CrystalHD codec plugin
dnl
AC_ARG_ENABLE(crystalhd,
  [  --enable-crystalhd      crystalhd codec plugin (default auto)])
if test "${enable_crystalhd}" != "no"; then
    AC_CHECK_HEADER(libcrystalhd/libcrystalhd_if.h, [
      VLC_ADD_PLUGIN([crystalhd])
      VLC_ADD_LIBS([crystalhd], [-lcrystalhd])
    ],[
      if test "${SYS}" = "mingw32" ; then
        AC_CHECK_HEADERS(libcrystalhd/bc_dts_defs.h, [
          VLC_ADD_PLUGIN([crystalhd])
          AC_CHECK_HEADERS(libcrystalhd/bc_drv_if.h, [
            VLC_ADD_LIBS([crystalhd], [-lbcmDIL])
            ])
          AS_IF([test x"${enable_crystalhd}" = "xyes"],
                [AC_MSG_ERROR("Could not find CrystalHD development headers")],
                [AC_MSG_WARN("Could not find CrystalHD development headers")])
        ],[#define __LINUX_USER__
               #include <libcrystalhd/bc_dts_types.h>
       #include <libcrystalhd/bc_dts_types.h>
      ])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  mad plugin
AC_ARG_ENABLE(mad,
  [  --enable-mad            libmad module (default enabled)])
if test "${enable_mad}" != "no"
then
  AC_ARG_WITH(mad,
    [  --with-mad=PATH         path to libmad],[],[])
  if test "${with_mad}" != "no" -a -n "${with_mad}"
  then
    VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${with_mad}/include])
    VLC_ADD_LIBS([mpgatofixed32],[-L${with_mad}/lib])
  fi

  AC_ARG_WITH(mad-tree,
    [  --with-mad-tree=PATH    mad tree for static linking],[],[])
  if test "${with_mad_tree}" != "no" -a -n "${with_mad_tree}"
  then
    real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
    if test -z "${real_mad_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
Rafaël Carré's avatar
Rafaël Carré committed
      AC_MSG_ERROR([${with_mad_tree} directory does not 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
    then
      AC_MSG_RESULT(yes)
      VLC_ADD_CPPFLAGS([mpgatofixed32],[-I${real_mad_tree}])
      VLC_ADD_LIBS([mpgatofixed32],[-L${real_mad_tree}/.libs])
      VLC_SAVE_FLAGS
      LDFLAGS="${LDFLAGS} ${LIBS_mpgatofixed32}"
      AC_CHECK_LIB(mad, mad_bit_init, [
        VLC_ADD_PLUGIN([mpgatofixed32])
        VLC_ADD_LIBS([mpgatofixed32],[-lmad])
Rafaël Carré's avatar
Rafaël Carré committed
        ],[ AC_MSG_ERROR([the specified tree has not been compiled ])
    else
      AC_MSG_RESULT(no)
Rafaël Carré's avatar
Rafaël Carré committed
      AC_MSG_ERROR([the specified tree does not have mad.h])
    VLC_SAVE_FLAGS
    CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_mpgatofixed32}"
    LDFLAGS="${LDFLAGS} ${LIBS_mpgatofixed32}"
    AC_CHECK_HEADERS(mad.h, ,
      [ 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])],
      [ AC_MSG_ERROR([Cannot find libmad library...]) ])
[  --enable-merge-ffmpeg   merge FFmpeg-based plugins (default disabled)],, [
  enable_merge_ffmpeg="no"
])
AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])

VLC_SAVE_FLAGS
LDFLAGS="${LDFLAGS} -Wl,-Bsymbolic"
AC_CACHE_CHECK([if linker supports -Bsymbolic],
  [ac_cv_ld_bsymbolic],
  [AC_TRY_LINK([],,ac_cv_ld_bsymbolic=yes,ac_cv_ld_bsymbolic=no)])
VLC_RESTORE_FLAGS
Christophe Mutricy's avatar
Christophe Mutricy committed
[  --enable-avcodec        libavcodec codec (default enabled)])
AS_IF([test "${enable_avcodec}" != "no"], [
  PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 52.25.0 libavutil],
    [
      VLC_SAVE_FLAGS
      CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
      CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
      AC_CHECK_HEADERS(libavcodec/avcodec.h)
      AC_CHECK_HEADERS(libavutil/avutil.h)
      VLC_ADD_PLUGIN([avcodec])
      VLC_ADD_LIBS([avcodec],[$AVCODEC_LIBS])
      AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
      VLC_ADD_CFLAGS([avcodec],[$AVCODEC_CFLAGS])
      VLC_RESTORE_FLAGS
      AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
dnl
dnl libva needs avcodec
dnl
AC_ARG_ENABLE(libva,
  [  --enable-libva          VAAPI GPU decoding support (libVA) (default auto)])
AS_IF([test "${enable_libva}" = "yes" -a "${have_avcodec}" != "yes" ], [
  AC_MSG_ERROR([--enable-libva and --disable-avcodec options are mutually exclusive. Use --enable-avcodec.])
])
AS_IF([test "${enable_libva}" != "no"], [
  PKG_CHECK_MODULES(LIBVA, [libva libva-x11], [
    VLC_SAVE_FLAGS
    CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
    CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
    AC_CHECK_HEADERS(libavcodec/vaapi.h, [
      VLC_ADD_LIBS([avcodec],[$LIBVA_LIBS ${X_LIBS} ${X_PRE_LIBS} -lX11])
      VLC_ADD_CFLAGS([avcodec],[$LIBVA_CFLAGS ${X_CFLAGS}])
      AC_DEFINE(HAVE_AVCODEC_VAAPI, 1, [Define if avcodec has to be built with VAAPI support.])
      AC_MSG_NOTICE([VAAPI acceleration activated])
    ],[
      AS_IF([test -n "${enable_libva}"], [
        AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])
      ], [
        AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
    AS_IF([test -n "${enable_libva}"], [
      AC_MSG_ERROR([${LIBVA_PKG_ERRORS}.])
    ], [
      AC_MSG_WARN([${LIBVA_PKG_ERRORS}.])
dnl
dnl dxva2 needs avcodec
dnl
AC_ARG_ENABLE(dxva2,
  [  --enable-dxva2          DxVA2 GPU decoding support (default auto)])

AS_IF([test "${enable_dxva2}" != "no"], [
  if test "${SYS}" = "mingw32"; then
  AS_IF([test "x${have_avcodec}" = "xyes"], [
    AC_CHECK_HEADERS(dxva2api.h,
      [
        AC_CHECK_HEADERS(libavcodec/dxva2.h, [
           VLC_ADD_LIBS([avcodec],[-lole32 -lshlwapi -luuid])
           AC_DEFINE(HAVE_AVCODEC_DXVA2, 1, [Define if avcodec has to be built with DxVA2 support.])
           echo "DxVA2 acceleration activated"
        ],[
    AS_IF([test "${enable_dxva2}" = "yes"],
          [AC_MSG_ERROR([dxva2 is present but libavcodec/dxva2.h is missing])],
              [AC_MSG_WARN([dxva2 is present but libavcodec/dxva2.h is missing ])])
        ], [#undef _WIN32_WINNT
            /* DXVA2 is only available in Vista and above */
            #define _WIN32_WINNT 0x600])
    AS_IF([test "${enable_dxva2}" = "yes"],
              [AC_MSG_ERROR([Could not find required dxva2api.h])],
              [AC_MSG_WARN([dxva2api.h not found])])
      ])
  ],[
    AS_IF([test "x${enable_dxva2}" != "x"], [
      AC_MSG_ERROR([--enable-dxva2 and --disable-avcodec options are mutually exclusive.])
    ])
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])
Rafaël Carré's avatar
Rafaël Carré committed
    VLC_ADD_LIBS([stream_out_switcher],[$AVCODEC_LIBS $AVUTIL_LIBS $LIBM])
    VLC_ADD_CFLAGS([stream_out_switcher],[$AVCODEC_CFLAGS $AVUTIL_CFLAGS])
  ],[AC_MSG_ERROR([Stream_out switcher depends on avcodec])
  ])
])


[  --enable-avformat       libavformat containers (default enabled)],, [
  enable_avformat="${have_avcodec}"
])
if test "${enable_avformat}" != "no"
then
  PKG_CHECK_MODULES(AVFORMAT,[libavformat > 52.30.0 libavcodec libavutil],
      VLC_SAVE_FLAGS
      CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
      CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
      AC_CHECK_HEADERS(libavformat/avformat.h libavformat/avio.h)
      AC_CHECK_HEADERS(libavutil/avutil.h)
      AS_IF([test "$enable_merge_ffmpeg" = "no"], [
        VLC_ADD_PLUGIN([avformat access_avio])
        VLC_ADD_LIBS([avformat access_avio],[$AVFORMAT_LIBS $AVUTIL_LIBS])
        VLC_ADD_CFLAGS([avformat access_avio],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
        AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
          VLC_ADD_LIBS([avformat access_avio],[-Wl,-Bsymbolic])
      ], [
        VLC_ADD_LIBS([avcodec],[$AVFORMAT_LIBS $AVUTIL_LIBS])
        VLC_ADD_CFLAGS([avcodec],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
      ])
      AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --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
          (default enabled)]))
  PKG_CHECK_MODULES(SWSCALE,[libswscale],
      CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}"
      CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}"
      AC_CHECK_HEADERS(libswscale/swscale.h)
      VLC_ADD_PLUGIN([swscale])
      VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS])
      VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
      AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
      AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --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([${POSTPROC_PKG_ERRORS}. Pass --disable-postproc to ignore this error.])
dnl
dnl  faad decoder plugin
dnl
AC_ARG_ENABLE(faad,
[  --enable-faad           faad codec (default auto)])
if test "${enable_faad}" != "no"; then
  AC_ARG_WITH(faad-tree,  [  --with-faad-tree=PATH   faad tree for static linking])
  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`"
    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 the 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}])
    VLC_SAVE_FLAGS
    CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_faad}"
    LDFLAGS="${LDFLAGS} ${LIBS_faad}"
    AC_CHECK_HEADERS(faad.h,
      [ 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]) ], [
                AS_IF([test "${enable_faad}" = "yes"],
                [ AC_MSG_ERROR([Cannot find libfaad library...]) ],
                [ AC_MSG_WARN([Cannot find libfaad library...]) ]) ]) ])
      ] , [ AS_IF([test "${enable_faad}" = "yes"],
        [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ],
        [ AC_MSG_WARN([Cannot find development headers for libfaad...]) ]) ])
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_LIBS([quicktime],[-Wl,-framework,QuickTime,-framework,Carbon])
hartman's avatar
hartman committed
    ], [ AC_MSG_ERROR([cannot find QuickTime headers]) ])
gbazin's avatar
 
gbazin committed
  fi
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)
Rafaël Carré's avatar
Rafaël Carré committed
      AC_MSG_ERROR([${with_a52_tree} directory does not exist])
gbazin's avatar
 
gbazin committed
    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])
      VLC_SAVE_FLAGS
      LDFLAGS="${LDFLAGS} ${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
Rafaël Carré's avatar
Rafaël Carré committed
          AC_MSG_ERROR([the specified tree has not been compiled])
gbazin's avatar
 
gbazin committed
        fi
gbazin's avatar
 
gbazin committed
    else
      AC_MSG_RESULT(no)
Rafaël Carré's avatar
Rafaël Carré committed
      AC_MSG_ERROR([the specified tree does not have a52.h])
gbazin's avatar
 
gbazin committed
    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"
    VLC_SAVE_FLAGS
    CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_test} ${CPPFLAGS_a52tofloat32}"
    LDFLAGS="${LDFLAGS} ${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.])
        ], [$LIBM])
    ],[
      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
    ])
gbazin's avatar
 
gbazin committed
  fi
gbazin's avatar
 
gbazin committed
fi

      [  --with-a52-fixed        specify if liba52 has been compiled with fixed point support],
gbazin's avatar
 
gbazin committed
dnl
dnl DTS Coherent Acoustics decoder plugin
dnl
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 plugins
gbazin's avatar
 
gbazin committed
dnl
PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex support], [auto])
have_speexdsp="no"
AS_IF([test "${enable_speex}" != "no"], [
  PKG_CHECK_MODULES([SPEEXDSP], [speexdsp], [
    have_speexdsp="yes"
  ], [
    AC_MSG_WARN([${SPEEXDSP_PKG_ERRORS}.])
  ])
])
AM_CONDITIONAL([HAVE_SPEEXDSP], [test "$have_speexdsp" = "yes"])
gbazin's avatar
 
gbazin committed

gbazin's avatar
 
gbazin committed
dnl
dnl  theora decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theoradec >= 1.0 theoraenc], [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.10], [dirac decoder and encoder 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} -lz $LIBM"
  AC_CHECK_LIB(png, png_set_rows, [
    VLC_ADD_LIBS([png],[-lpng -lz $LIBM])
    VLC_ADD_PLUGIN([png osdmenu osd_parser])],
    [],[-lz $LIBM] )
AM_CONDITIONAL(BUILD_OSDMENU, [test "${enable_png}" != "no"])
dnl
dnl H264 encoder plugin (10-bit lib264)
dnl
AC_ARG_ENABLE(x26410b,
  [  --enable-x26410b           H264 10-bit encoding support with static libx264 (default disabled)])
if test "${enable_x26410b}" != "no"; then
AC_ARG_WITH(x26410b-tree,
  [ --with-x26410b-tree=PATH      H264 10-bit encoding module with libx264 (static linking)],[],[])
  if test "${with_x26410b_tree}" != "no" -a -n "${with_x26410b_tree}"
  then
    real_x26410b_tree="̧`cd ${with_x26410b_tree} 2>/dev/null && pwd`"
    if test -z "${real_x26410b_tree}"
    then
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([${with_x26410b_tree} directory does not exist])
    fi
    AC_MSG_CHECKING(for x264.h in ${real_x26410b_tree})
    if test -f ${with_x26410b_tree}/x264_config.h
    then
      AC_MSG_RESULT(yes)
      AC_MSG_CHECKING(for 10-bit build of x264)
      if grep -q "BIT_DEPTH.*10"  ${with_x26410b_tree}/x264_config.h ;then
        AC_MSG_RESULT(yes)
        VLC_ADD_PLUGIN([x26410b])
        VLC_ADD_CFLAGS([x26410b],[-I${with_x26410b_tree}])
        VLC_ADD_LIBS([x26410b],[-L${with_x26410b_tree} -lm -lpthread -lx264])
      else
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([${with_x26410b_tree} isnt build 10-bit])
      fi
    else
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([${with_x26410b_tree} doesnt have x264_config.h])
    fi
  else
    PKG_CHECK_MODULES(X26410B, x26410b, [
        VLC_ADD_PLUGIN([x26410b])
        VLC_ADD_LDFLAGS([x26410b],[${X26410B_LIBS}])
        AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
          VLC_ADD_LIBS([x26410b],[-Wl,-Bsymbolic])
        ])
        VLC_ADD_CFLAGS([x26410b],[${X26410B_CFLAGS}])
        if echo ${X26410B_LIBS} |grep -q 'pthreadGC2'; then
          VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
        fi
    ], [
Rafaël Carré's avatar
Rafaël Carré committed
       if test "${enable_x26410b}" = "yes"; then
        AC_MSG_ERROR([x26410b module doesn't work without staticly compiled libx264.a])
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)
Rafaël Carré's avatar
Rafaël Carré committed
      AC_MSG_ERROR([${with_x264_tree} directory does not 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])
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
Rafaël Carré's avatar
Rafaël Carré committed
        AC_MSG_ERROR([the specified tree has not been compiled])
      ])
    else
      AC_MSG_RESULT(no)
Rafaël Carré's avatar
Rafaël Carré committed
      AC_MSG_ERROR([the specified tree does not have x264.h])
      PKG_CHECK_MODULES(X264,x264 >= 0.86, [
        VLC_ADD_PLUGIN([x264])
        VLC_ADD_LDFLAGS([x264],[${X264_LIBS}])

        AS_IF([test "${ac_cv_ld_bsymbolic}" != "no"], [
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([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
dnl
dnl libfluidsynth (MIDI synthetizer) plugin
dnl
PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [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)]))
    PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
        [
          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 incompatible. Using zvbi.])
          AC_MSG_WARN([${ZVBI_PKG_ERRORS}. 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.8],
        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_PKG_ERRORS}.])
dnl
dnl  kate decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([KATE], [], [kate >= 0.3.0], [kate codec], [auto])
dnl  tiger rendering for kate decoder plugin
dnl
AC_ARG_ENABLE(tiger,
[  --enable-tiger          Tiger rendering library for Kate streams (default auto)])
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 -n "${enable_tiger}"], [
          AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
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

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

dnl
dnl  OpenGL
dnl
PKG_CHECK_MODULES([GL], [gl], [
  have_gl="yes"
], [
  AC_CHECK_HEADER([GL/gl.h], [
    have_gl="yes"
    GL_CFLAGS=""
    GL_LIBS="-lGL"
  ], [
    have_gl="no"
  ])
])

dnl OpenGL ES 2: depends on EGL 1.1 and is currently unfinished
dnl PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [auto])
dnl OpenGL ES 1: depends on EGL 1.0 and is currently broken
dnl PKG_ENABLE_MODULES_VLC([GLES1], [], [glesv1_cm], [OpenGL ES v1 support], [auto])

AC_ARG_ENABLE(egl,
  [  --enable-egl            OpenGL support through EGL (default disabled)],, [
  enable_egl="no"
])
AS_IF([test "$enable_egl" != "no"], [
  PKG_CHECK_MODULES([EGL], [egl], [
    VLC_ADD_PLUGIN([gl])
    VLC_ADD_PLUGIN([egl])
  ])
])

AC_CHECK_HEADERS(X11/Xlib.h)
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" -a "${SYS}" != "darwin" -a "${SYS}" != "symbian"], [
AC_ARG_ENABLE(xvideo,
  [  --enable-xvideo         XVideo support (default enabled)],, [
    enable_xvideo="$enable_xcb"
])
AC_ARG_ENABLE(glx,
  [  --enable-glx            OpenGL support through GLX (default enabled)],, [
  enable_glx="$enable_xcb"
])
have_xcb="no"
AS_IF([test "${enable_xcb}" != "no"], [
  dnl libxcb
  PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
  have_xcb="yes"
  PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
  PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
  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_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}])
    AC_MSG_WARN([${XCB_RANDR_PKG_ERRORS}. Panoramix filter will not be supported.])
  dnl xcb-utils
  PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms >= 0.3.4], [
    PKG_CHECK_MODULES(XPROTO, [xproto])
    VLC_ADD_PLUGIN([globalhotkeys])
    VLC_ADD_CFLAGS([globalhotkeys], [${XCB_KEYSYMS_CFLAGS} ${XCB_CFLAGS}])
    VLC_ADD_LIBS([globalhotkeys], [${XCB_KEYSYMS_LIBS} ${XCB_LIBS}])
    VLC_ADD_CFLAGS([xcb_window], [-DHAVE_XCB_KEYSYMS])
    AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Hotkeys will not work.])
  AS_IF([test "${enable_glx}" != "no"], [
    AS_IF([test "${have_gl}" != "yes"], [
      AC_MSG_ERROR([${GL_PKG_ERRORS}. Pass --disable-glx if you do not need OpenGL X11 support.])
    ])
    VLC_ADD_PLUGIN([xcb_glx])
AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
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)])