Skip to content
Snippets Groups Projects
configure.ac 137 KiB
Newer Older
gbazin's avatar
 
gbazin committed

Timothy B. Terriberry's avatar
Timothy B. Terriberry committed
dnl
dnl  Opus plugin
dnl
Tristan Matthews's avatar
Tristan Matthews committed
PKG_ENABLE_MODULES_VLC([OPUS], [], [ogg opus >= 1.0.3], [Opus support], [auto])
dnl
dnl  Ambisonic channel mixer and binauralizer plugin
dnl
PKG_ENABLE_MODULES_VLC([SPATIALAUDIO], [], [spatialaudio], [Ambisonic channel mixer and binauralizer], [auto])

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

dnl
dnl  OggSpots decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([OGGSPOTS], [], [ogg], [experimental OggSpots codec], [auto])

dnl
dnl  Daala decoder plugin
dnl
PKG_ENABLE_MODULES_VLC([DAALA], [], [daaladec daalaenc], [experimental daala codec], [disabled])
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
  AS_HELP_STRING([--enable-png], [PNG support (default enabled)]))
AS_IF([test "${enable_png}" != "no"], [
AC_CHECK_HEADERS([png.h], [
  LDFLAGS="${LDFLAGS} -lz $LIBM"
  AC_CHECK_LIB([png], [png_set_alpha_mode], [
    VLC_ADD_PLUGIN([png])
  ], [], [-lz $LIBM])
dnl
dnl  JPEG decoder module
dnl
  AS_HELP_STRING([--enable-jpeg], [JPEG support (default enabled)]))
AS_IF([test "${enable_jpeg}" != "no"], [
AC_CHECK_HEADERS([jpeglib.h], [
  VLC_ADD_PLUGIN([jpeg])
  ])
])

dnl
dnl  BPG decoder module
dnl
  AS_HELP_STRING([--enable-bpg], [BPG support (default disabled)]))
AS_IF([test "${enable_bpg}" != "no"], [
AC_CHECK_HEADERS([libbpg.h], [
  VLC_ADD_PLUGIN([bpg])
  ])
])

dnl
dnl H262 encoder plugin (lib262)
dnl
  AS_HELP_STRING([--enable-x262], [H262 encoding support with static libx262 (default disabled)]))
if test "${enable_x262}" != "no"; then
    PKG_CHECK_MODULES(X262, x262, [
        VLC_ADD_PLUGIN([x262])
        VLC_ADD_LDFLAGS([x262],[${X262_LIBS}])
        AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
          VLC_ADD_LIBS([x262],[${av_cv_ld_bsymbolic}])
        ])
        VLC_ADD_CFLAGS([x262],[${X262_CFLAGS}])
        if echo ${X262_LIBS} |grep -q 'pthreadGC2'; then
          VLC_ADD_CFLAGS([x262], [-DPTW32_STATIC_LIB])
        fi
    ], [
       if test "${enable_x262}" = "yes"; then
        AC_MSG_ERROR([x262 module doesn't work without staticly compiled libx262.a])
       fi
    ])
fi

Rafaël Carré's avatar
Rafaël Carré committed
dnl x265 encoder
PKG_ENABLE_MODULES_VLC([X265],, [x265], [HEVC/H.265 encoder], [auto])
dnl
dnl H264 encoder plugin (using libx264)
dnl
  AS_HELP_STRING([--enable-x264], [H264 encoding support with libx264 (default enabled)]))
if test "${enable_x264}" != "no"; then
      PKG_CHECK_MODULES(X264,x264 >= 0.148, [
        VLC_ADD_PLUGIN([x264])
        VLC_ADD_LIBS([x264],[${X264_LIBS}])
        AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
          VLC_ADD_LDFLAGS([x264],[${ac_cv_ld_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([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
dnl
dnl H264 encoder plugin (libx264 > 153)
dnl
AC_ARG_ENABLE([x26410b],
  AS_HELP_STRING([--enable-x26410b], [H264 10-bit encoding support with libx264 (default enabled)]))
if test "${enable_x26410b}" != "no"; then
      PKG_CHECK_MODULES(X26410b,x264 >= 0.153, [
        VLC_ADD_PLUGIN([x26410b])
        VLC_ADD_LIBS([x26410b],[${X264_LIBS}])

        AS_IF([test -n "${ac_cv_ld_bsymbolic}"], [
          VLC_ADD_LDFLAGS([x26410b],[${ac_cv_ld_bsymbolic}])
        ])

        VLC_ADD_CFLAGS([x26410b],[${X264_CFLAGS}])
        if echo ${X264_LIBS} |grep -q 'pthreadGC2'; then
          VLC_ADD_CFLAGS([x26410b], [-DPTW32_STATIC_LIB])
        fi
      ],[
        if test "${enable_x26410b}" = "yes"; then
            AC_MSG_ERROR([${X264_PKG_ERRORS}: you may get it from http://www.videolan.org/x264.html])
          fi
      ])
fi


dnl
dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
dnl
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
dnl
dnl libfluidsynth (MIDI synthetizer) plugin
dnl
PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth >= 1.1.2], [MIDI synthetiser with libfluidsynth], [auto])
PKG_ENABLE_MODULES_VLC([FLUIDLITE], [fluidsynth], [fluidlite], [MIDI synthetiser with libfluidsynth], [auto])
AC_CHECK_HEADERS([fluidlite.h], [AC_SUBST([FLUIDSYNTH_LIBS], ${FLUIDLITE_LIBS})])
  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_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.])
AM_CONDITIONAL([HAVE_ZVBI], [test "x${have_zvbi}" = x"yes"])

AS_IF( [test "${enable_telx}" != "no" ],[
  VLC_ADD_PLUGIN([telx])
  have_telx="yes"
  AC_DEFINE(TELX_COMPILED, 1, [Define if the telx module is built])
AM_CONDITIONAL([HAVE_TELX], [test "x${have_telx}" = x"yes"])
dnl
dnl ARIB subtitles rendering module
dnl
AC_ARG_ENABLE([aribsub],
  AS_HELP_STRING([--enable-aribsub],[ARIB Subtitles support (default enabled)]))
AS_IF( [test "${enable_aribsub}" != "no" ],[
  PKG_CHECK_MODULES(ARIBB24, [aribb24 >= 1.0.1], [
      have_aribb24="yes"
      VLC_ADD_PLUGIN([aribsub])
      VLC_ADD_LIBS([aribsub],[-laribb24])
      AC_DEFINE(HAVE_ARIBB24, 1, [Define if libaribb24 is available.])
    ],[
      AC_MSG_WARN(Library [aribb24] needed for [aribsub] was not found)
      have_aribb24="no"
  ])
])
AM_CONDITIONAL([HAVE_ARIBB24], [test x"${have_aribb24}" = x"yes"])
dnl
dnl ARIB B25
dnl
PKG_ENABLE_MODULES_VLC([ARIBB25], [aribcam], [aribb25 >= 0.2.6], [ARIB STD-B25], [auto])

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],
AS_HELP_STRING([--enable-tiger], [Tiger rendering library for Kate streams (default auto)]))
AS_IF([test "${enable_tiger}" != "no"], [
  PKG_CHECK_MODULES(TIGER,[tiger >= 0.3.1], [
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
      AC_DEFINE(HAVE_TIGER, 1, [Define if libtiger is available.])],[
        AS_IF([test -n "${enable_tiger}"], [
          AC_MSG_ERROR([${TIGER_PKG_ERRORS}.])
David's avatar
David committed
dnl  check if we can build the css selector engine
AS_HELP_STRING([--enable-css], [CSS selector engine (default auto)]))
AS_IF([test "${enable_css}" != "no"], [
  with_css="yes"
  AC_DEFINE(HAVE_CSS, 1, [Define if CSS engine is built])
])
AM_CONDITIONAL([ENABLE_CSS], [test "${with_css}" = "yes"])

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  libplacebo support
dnl
AC_ARG_ENABLE([libplacebo],
  AS_HELP_STRING([--disable-libplacebo],
      [disable libplacebo support (default auto)]))

AS_IF([test "$enable_libplacebo" != "no"], [
  PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 0.5], [
    AC_DEFINE([HAVE_LIBPLACEBO], [1], [Define to 1 if libplacebo is enabled.])
    PKG_CHECK_MODULES([LIBPLACEBO], [libplacebo >= 1.7],
      [have_libplacebo_vk="yes"], [have_libplacebo_vk="no"])
  ], [
    AS_IF([test -n "${enable_libplacebo}"], [
      AC_MSG_ERROR([${LIBPLACEBO_PKG_ERRORS}.])
    ])
    enable_libplacebo="no"
  ])
])
AM_CONDITIONAL([HAVE_LIBPLACEBO], [test "$enable_libplacebo" != "no"])

dnl
dnl  OpenGL
dnl
PKG_CHECK_MODULES([EGL], [egl], [
  have_egl="yes"
], [
  have_egl="no"
])
AM_CONDITIONAL([HAVE_EGL], [test "${have_egl}" = "yes"])

PKG_CHECK_MODULES([GL], [gl], [
  have_gl="yes"
], [
  AC_MSG_CHECKING([for OpenGL])
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef _WIN32
# include <GL/glew.h>
#endif
#include <GL/gl.h>
]], [
    [int t0 = GL_TEXTURE0;]])
  ], [
    GL_CFLAGS=""
    AS_IF([test "${SYS}" != "mingw32"], [
      GL_LIBS="-lGL"
    ], [
  AC_MSG_RESULT([${have_gl}])
AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
AS_IF([test "${have_gl}" = "yes"], [
  AC_DEFINE([HAVE_GL], 1, [Defined if having OpenGL])
])
dnl OpenGL ES 2: depends on EGL 1.1
PKG_ENABLE_MODULES_VLC([GLES2], [], [glesv2], [OpenGL ES v2 support], [disabled])
dnl
dnl Vulkan
dnl
AC_ARG_ENABLE(vulkan,
  [AS_HELP_STRING([--disable-vulkan],
      [disable Vulkan support (default auto)])])

AS_IF([test "$enable_vulkan" != "no"], [
  AS_IF([test "$have_libplacebo_vk" = "yes"], [
    PKG_CHECK_MODULES([VULKAN], [vulkan >= 1.0.26], [
      AC_DEFINE([HAVE_VULKAN], [1], [Define to 1 if vulkan is enabled.])
    ], [
      AS_IF([test -n "${enable_vulkan}"], [
        AC_MSG_ERROR([${VULKAN_PKG_ERRORS}.])
      ])
      enable_vulkan="no"
    ])
  ], [
    AS_IF([test -n "${enable_vulkan}"], [
      AC_MSG_ERROR([Vulkan support requires libplacebo 1.7 as well. Do not use --disable-libplacebo.])
    ])
    enable_vulkan="no"
  ])
])
AM_CONDITIONAL(HAVE_VULKAN, [test "$enable_vulkan" != "no"])

AC_CHECK_HEADERS([X11/Xlib.h])
dnl
dnl  X C Bindings modules
dnl
  AS_HELP_STRING([--enable-xcb], [X11 support with XCB (default enabled)]),, [
  AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
have_xcb="no"
have_xkbcommon_x11="no"
have_xcb_keysyms="no"
AS_IF([test "${enable_xcb}" != "no"], [
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed

  dnl libxcb
  PKG_CHECK_MODULES([XCB], [xcb >= 1.6],, [
    xcb_err="$xcb_err ${XCB_PKG_ERRORS}."])
  PKG_CHECK_MODULES([XCB_COMPOSITE], [xcb-composite],, [
    xcb_err="$xcb_err ${XCB_COMPOSITE_PKG_ERRORS}."])
  PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr >= 1.3],, [
    xcb_err="$xcb_err ${XCB_RANDR_PKG_ERRORS}."])
  PKG_CHECK_MODULES([XCB_RENDER], [xcb-render],, [
    xcb_err="$xcb_err ${XCB_RENDER_PKG_ERRORS}."])
  PKG_CHECK_MODULES([XCB_SHM], [xcb-shm >= 1.9.2],, [
    xcb_err="$xcb_err ${XCB_SHM_PKG_ERRORS}."])
  PKG_CHECK_MODULES([XCB_XKB], [xcb-xkb],, [
    xcb_err="$xcb_err ${XCB_XKB_PKG_ERRORS}."])

  dnl xproto
  PKG_CHECK_MODULES(XPROTO, [xproto],, [
    xcb_err="$xcb_err ${XPROTO_PKG_ERRORS}."])

  AS_IF([test -n "$xcb_err"], [
    AC_MSG_ERROR([$xcb_err Pass --disable-xcb to skip X11 support.])
  ])

  dnl xkbcommon
  PKG_CHECK_MODULES([XKBCOMMON_X11], [xkbcommon-x11], [
    have_xkbcommon_x11="yes"
    AC_MSG_WARN([${XKBCOMMON_X11_PKG_ERRORS}. Hotkeys are disabled.])
  dnl xcb-utils
  PKG_CHECK_MODULES([XCB_KEYSYMS], [xcb-keysyms >= 0.3.4], [
    have_xcb_keysyms="yes"
  ], [
    AC_MSG_WARN([${XCB_KEYSYMS_PKG_ERRORS}. Global hotkeys are disabled.])
AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
AM_CONDITIONAL([HAVE_XKBCOMMON_X11], [test "${have_xkbcommon_x11}" = "yes"])
AM_CONDITIONAL([HAVE_XCB_KEYSYMS], [test "${have_xcb_keysyms}" = "yes"])
AC_ARG_ENABLE([vdpau],
  [AS_HELP_STRING([--enable-vdpau], [VDPAU hardware support (default auto)])])
AS_IF([test "${enable_vdpau}" != "no"], [
  PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.6], [
    AS_IF([test "${no_x}" = "yes"], [
      AC_MSG_ERROR([VDPAU requires Xlib (X11).])
    ])
  ], [
    AS_IF([test -n "${enable_vdpau}"], [
      AC_MSG_ERROR([${VDPAU_PKG_ERRORS}.])
    ])
  ])
])
AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
  case "${avfork}" in
    libav) av_vdpau_ver="56.10.0" ;;
    ffmpeg) av_vdpau_ver="56.19.100" ;;
  PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
    have_avcodec_vdpau="yes"
    AC_MSG_NOTICE([VDPAU decoding acceleration activated])
  ], [
    AS_IF([test -n "${enable_vdpau}"], [
      AC_MSG_ERROR([libavcodec >= 56.10.0 is required for VDPAU decoding.])
      AC_MSG_WARN([libavcodec >= 56.10.0 are required for VDPAU decoding.])
    ])
  ])
])
AM_CONDITIONAL([HAVE_AVCODEC_VDPAU], [test "${have_avcodec_vdpau}" = "yes"])


AC_ARG_ENABLE([wayland],
  AS_HELP_STRING([--enable-wayland], [Wayland support (default auto)]))
have_wayland="no"
AS_IF([test "${enable_wayland}" != "no"], [
  dnl wayland
  PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= 1.5.91],, [
    wl_err="$wl_err ${WAYLAND_CLIENT_PKG_ERRORS}."
  ])
  PKG_CHECK_MODULES([WAYLAND_CURSOR], [wayland-cursor],, [
    wl_err="$wl_err ${WAYLAND_CURSOR_PKG_ERRORS}."
  ])
  PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl],, [
    wl_err="$wl_err ${WAYLAND_EGL_PKG_ERRORS}."
  ])
  PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner >= 1.15], [
    WAYLAND_SCANNER="$(${PKG_CONFIG} wayland-scanner --variable wayland_scanner)"
  ], [
    wl_err="$wl_err ${WAYLAND_SCANNER_PKG_ERRORS}."
  ])

  dnl wayland-protocols
  PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= 1.15], [
    WAYLAND_PROTOCOLS="$(${PKG_CONFIG} wayland-protocols --variable pkgdatadir)"
  ], [
    wl_err="$wl_err ${WAYLAND_PROTOCOLS_PKG_ERRORS}."
  ])
  AS_IF([test -n "$wl_err"], [
    AS_IF([test -n "$enable_wayland"], [
      AC_MSG_ERROR([$wl_err])
      AC_MSG_WARN([$wl_err])
  dnl xkbcommon
  PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon], [
    have_xkbcommon="yes"
    AC_MSG_WARN([${XKBCOMMON_PKG_ERRORS}. Hotkeys are disabled.])
AM_CONDITIONAL([HAVE_WAYLAND], [test "${have_wayland}" = "yes"])
AC_SUBST([WAYLAND_PROTOCOLS])
AC_SUBST([WAYLAND_SCANNER])
AM_CONDITIONAL([HAVE_XKBCOMMON], [test "${have_xkbcommon}" = "yes"])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
dnl  SDL image decoder module
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
AC_ARG_ENABLE([sdl-image],
  AS_HELP_STRING([--enable-sdl-image], [SDL image support (default enabled)]))
AS_IF([test "${enable_sdl_image}" != "no"],[
  PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
    VLC_ADD_PLUGIN([sdl_image])
  ], [
    AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])
  ])
])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

AC_ARG_ENABLE([freetype],
  AS_HELP_STRING([--enable-freetype],   [freetype support   (default auto)]))
AC_ARG_ENABLE([fribidi],
  AS_HELP_STRING([--enable-fribidi],    [fribidi support    (default auto)]))
AC_ARG_ENABLE([harfbuzz],
  AS_HELP_STRING([--enable-harfbuzz],   [harfbuzz support   (default auto)]))
AC_ARG_ENABLE([fontconfig],
  AS_HELP_STRING([--enable-fontconfig], [fontconfig support (default auto)]))
AC_ARG_WITH([default-font],
    AS_HELP_STRING([--with-default-font=PATH],
        [Path to the default font]),
        [AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
            "$withval", [Default font])])
AC_ARG_WITH([default-monospace-font],
    AS_HELP_STRING([--with-default-monospace-font=PATH],
        [Path to the default font]),
        [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
            "$withval", [Default monospace font])])

AC_ARG_WITH([default-font-family],
    AS_HELP_STRING([--with-default-font-family=NAME],
        [Name of the default font family]),
        [AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
            "$withval", [Default font family])])
AC_ARG_WITH([default-monospace-font-family],
    AS_HELP_STRING([--with-default-monospace-font-family=NAME],
        [Name of the default font family]),
        [AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
            "$withval", [Default monospace font family])])

have_freetype="no"
have_fontconfig="no"
have_fribidi="no"
have_harfbuzz="no"
if test "${enable_freetype}" != "no"; then
   PKG_CHECK_MODULES(FREETYPE, freetype2, [
      have_freetype="yes"
      VLC_ADD_CPPFLAGS([skins2],[${FREETYPE_CFLAGS}])
      VLC_ADD_LIBS([skins2],[${FREETYPE_LIBS}])
    dnl fontconfig support
    AS_IF([test "${enable_fontconfig}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "darwin"], [
      PKG_CHECK_MODULES(FONTCONFIG, [fontconfig >= 2.11], [
        have_fontconfig="yes"
      ], [
        AC_MSG_WARN([${FONTCONFIG_PKG_ERRORS}. Styles will be disabled in FreeType.])
      ])
    ])
      if test "${enable_fribidi}" != "no"; then
        PKG_CHECK_MODULES(FRIBIDI, fribidi, [
          have_fribidi="yes"
          VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -DHAVE_FRIBIDI])
          VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
        ],[AC_MSG_WARN([${FRIBIDI_PKG_ERRORS}. Bidirectional text and complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
      fi

      dnl harfbuzz support
      if test "${have_fribidi}" != "no"; then
        if test "${enable_harfbuzz}" != "no"; then
          PKG_CHECK_MODULES(HARFBUZZ, harfbuzz, [
            have_harfbuzz="yes"
            VLC_ADD_CPPFLAGS([skins2], [${HARFBUZZ_CFLAGS} -DHAVE_HARFBUZZ])
            VLC_ADD_LIBS([skins2], [${HARFBUZZ_LIBS}])
          ],[AC_MSG_WARN([${HARFBUZZ_PKG_ERRORS}. Support for complex scripts (Arabic, Farsi, Thai...) will be disabled in FreeType.])])
        fi
  AS_IF([test -n "${enable_freetype}"],[
    AC_MSG_ERROR([${FREETYPE_PKG_ERRORS}. Install FreeType2 development or configure with --disable-freetype.])
AM_CONDITIONAL([HAVE_FREETYPE], [test "${have_freetype}" = "yes"])
AM_CONDITIONAL([HAVE_FONTCONFIG], [test "${have_fontconfig}" = "yes"])
AM_CONDITIONAL([HAVE_FRIBIDI], [test "${have_fribidi}" = "yes"])
AM_CONDITIONAL([HAVE_HARFBUZZ], [test "${have_harfbuzz}" = "yes"])
dnl
dnl libass subtitle rendering module
dnl
AC_ARG_ENABLE([libass],
  AS_HELP_STRING([--enable-libass], [Subtitle support using libass (default enabled)]))
AS_IF( [test "${enable_libass}" != "no"], [
  PKG_CHECK_MODULES(LIBASS, [libass >= 0.9.8],
      [
        VLC_ADD_PLUGIN([libass])

        if test "${have_fontconfig}" != "no"; then
            VLC_ADD_CPPFLAGS([libass],[-DHAVE_FONTCONFIG])
            VLC_ADD_LIBS([libass],[${FONTCONFIG_LIBS}])
        fi
      ],[
        AC_MSG_WARN([${LIBASS_PKG_ERRORS}.])
      ])
  ])

dnl
dnl SAPI (text to Speech renderer for Windows)
dnl
AC_CHECK_TYPES([ISpObjectToken],[
              have_sapi="yes"
            ],[AC_MSG_WARN([sapi.h not found. Text to Speech renderer for Windows disabled])],
              [#include <windows.h>
               #include <sapi.h>
               #include <sphelper.h>])
AM_CONDITIONAL([HAVE_SAPI], [test "${have_sapi}" = "yes"])
Jean-Paul Saman's avatar
Jean-Paul Saman committed
dnl  SVG module (text rendering and image decoding)
PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
Jean-Paul Saman's avatar
Jean-Paul Saman committed
PKG_ENABLE_MODULES_VLC([SVGDEC], [], [librsvg-2.0 >= 2.9.0 cairo >= 1.13.1], [SVG image decoder library],[auto])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
dnl  Windows DirectX module
dnl
AC_ARG_ENABLE([directx],
  AS_HELP_STRING([--enable-directx],
    [Microsoft DirectX support (default enabled on Windows)]),, [
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
  AS_IF([test "${SYS}" = "mingw32"], [
    enable_directx="yes"
  ], [
    enable_directx="no"
  ])
])
AS_IF([test "${enable_directx}" != "no"], [
  dnl OpenGL
  AC_CHECK_HEADERS([GL/glew.h], [
    AC_CHECK_HEADERS([GL/wglew.h], [
        VLC_ADD_PLUGIN([glwin32 wgl])
      ],, [
        #include <windows.h>
        #include <GL/glew.h>
      ])],, [
      #include <windows.h>
   ])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

Martell Malone's avatar
Martell Malone committed
  dnl Direct3D11
  AC_CHECK_HEADERS([d3d11.h], [
    VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
Martell Malone's avatar
Martell Malone committed
  ])

  dnl Direct3D9
  AC_CHECK_HEADERS([d3d9.h], [
    VLC_ADD_PLUGIN([direct3d9])
    AC_CHECK_HEADERS([d3dx9effect.h])
    AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
        [[#define COBJMACROS
          #include <d3d9.h>
          #include <dxva2api.h>
          #ifndef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids
          # error dxva2 too old
          #endif
        ]],[[;]])
      ],[
        VLC_ADD_PLUGIN([direct3d9_filters])
      [AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
gbazin's avatar
 
gbazin committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  Linux framebuffer module
gbazin's avatar
 
gbazin committed
dnl
AC_CHECK_HEADER([linux/fb.h], [
  VLC_ADD_PLUGIN([fb])
])

dnl
dnl  Linux kernel mode setting module
dnl
PKG_ENABLE_MODULES_VLC([KMS], [], [libdrm >= 2.4.83], [Linux kernel mode setting output], [auto])

Samuel Hocevar's avatar
Samuel Hocevar committed
dnl
dnl  libcaca plugin
dnl
PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
dnl
dnl  OS/2 KVA plugin
dnl
  AS_HELP_STRING([--enable-kva],
    [support the K Video Accelerator KVA (default enabled on OS/2)]),, [
  AS_IF([test "$SYS" = "os2"], [
    enable_kva="yes"
  ])
])
have_kva="no"
KVA_LIBS=""
AS_IF([test "$enable_kva" != "no"], [
  AC_CHECK_HEADERS([kva.h], [
    have_kva="yes"
    AC_CHECK_LIB([kva], [main], [
AC_SUBST([KVA_LIBS])
AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])

  AS_HELP_STRING([--enable-mmal],
    [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
if test "${enable_mmal}" != "no"; then
Julian Scheel's avatar
Julian Scheel committed
  LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
  CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
  AC_CHECK_HEADERS([interface/mmal/mmal.h],
    [ AC_CHECK_LIB([bcm_host], [vc_tv_unregister_callback_full], [
        have_mmal="yes"
        VLC_ADD_PLUGIN([mmal])
        VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
        VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
        VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm -lvchiq_arm ]) ], [
          AS_IF([test "${enable_mmal}" = "yes"],
            [ AC_MSG_ERROR([Cannot find bcm library...]) ],
            [ AC_MSG_WARN([Cannot find bcm library...]) ])
          ],
        [])
    ] , [ AS_IF([test "${enable_mmal}" = "yes"],
      [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
      [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
  VLC_RESTORE_FLAGS
fi
AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  Audio plugins
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed

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

AC_ARG_ENABLE([pulse],
  AS_HELP_STRING([--enable-pulse],
    [use the PulseAudio client library (default auto)]))
have_pulse="no"
AS_IF([test "${enable_pulse}" != "no"], [
  PKG_CHECK_MODULES([PULSE], [libpulse >= 1.0], [
    have_pulse="yes"
  ], [
    AS_IF([test "x${enable_pulse}" != "x"], [
      AC_MSG_ERROR([$PULSE_PKG_ERRORS. PulseAudio 1.0 or later required.])
    ])
  ])
])
AM_CONDITIONAL([HAVE_PULSE], [test "${have_pulse}" = "yes"])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  ALSA module
dnl
  AS_HELP_STRING([--enable-alsa],
    [support the Advanced Linux Sound Architecture (default auto)]),, [
  AS_IF([test "$SYS" = "linux" -a "${have_pulse}" = "no"], [
    enable_alsa="yes"
  ])
])
have_alsa="no"
AS_IF([test "${enable_alsa}" != "no"], [
  PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.24], [
    have_alsa="yes"
  ], [
    AS_IF([test "x${enable_alsa}" != "x"], [
      AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.24 or later required. Pass --disable-alsa to ignore this error.])
    ])
  ])
])
AM_CONDITIONAL([HAVE_ALSA], [test "${have_alsa}" = "yes"])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

  AS_HELP_STRING([--enable-oss],
    [support the Open Sound System OSS (default enabled on FreeBSD/NetBSD/DragonFlyBSD)]),, [
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
  AS_IF([test "$SYS" = "mingw32" -o "$SYS" = "linux" -o "$SYS" = "openbsd"], [
    enable_oss="no"
  ])
])
have_oss="no"
OSS_LIBS=""
AS_IF([test "$enable_oss" != "no"], [
  AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
    have_oss="yes"
    AC_CHECK_LIB([ossaudio], [main], [
AC_SUBST([OSS_LIBS])
AM_CONDITIONAL([HAVE_OSS], [test "${have_oss}" = "yes"])

dnl
dnl  OpenBSD sndio module
dnl
AC_ARG_ENABLE([sndio],
  AS_HELP_STRING([--disable-sndio],
    [support the OpenBSD sndio (default auto)]),, [
Alexandre Ratchov's avatar
Alexandre Ratchov committed
  AS_IF([test "$SYS" = "openbsd"], [
    enable_sndio="yes"
  ])
])
have_sndio="no"
AS_IF([test "$enable_sndio" != "no"], [
  AC_CHECK_HEADER([sndio.h], [
    have_sndio="yes"
  ])
])
AM_CONDITIONAL([HAVE_SNDIO], [test "${have_sndio}" = "yes"])

dnl
dnl  Windows Audio Session plugin
dnl
AC_ARG_ENABLE([wasapi],
  AS_HELP_STRING([--enable-wasapi],
    [use the Windows Audio Session API (default auto)])
have_wasapi="no"
AS_IF([test "$enable_wasapi" != "no"], [
  AC_CHECK_HEADER([audioclient.h], [
    have_wasapi="yes"
  ], [
    AS_IF([test "x${enable_wasapi}" != "x"], [
      AC_MSG_ERROR([Windows Audio Session API not found.])
    ])
  ])
])
AM_CONDITIONAL([HAVE_WASAPI], [test "${have_wasapi}" = "yes"])

  AS_HELP_STRING([--disable-jack],
    [do not use jack (default auto)]))
have_jack="no"
AS_IF([test "${enable_jack}" != "no"], [
    PKG_CHECK_MODULES(JACK, jack >= 1.9.7,
      [ have_jack=yes ],
      [
      AC_MSG_WARN([${JACK_PKG_ERRORS}, trying jack1 instead])

      PKG_CHECK_MODULES(JACK, jack >= 0.120.1 jack < 1.0,
      [ have_jack=yes ],
      [
      AS_IF([test -n "${enable_jack}"],
         [AC_MSG_ERROR([${JACK_PKG_ERRORS}.])],
         [AC_MSG_WARN([${JACK_PKG_ERRORS}.])])
      ])
    ])
])
AM_CONDITIONAL([HAVE_JACK], [test "${have_jack}" != "no"])
dnl
dnl  OpenSLES Android
dnl
AC_ARG_ENABLE([opensles],
  AS_HELP_STRING([--enable-opensles], [Android OpenSL ES audio module (default disabled)]))
if test "${HAVE_ANDROID}" = "1"; then
  if test "${enable_opensles}" = "yes"; then
      AC_CHECK_HEADERS([SLES/OpenSLES.h],
        [ VLC_ADD_PLUGIN([opensles_android]) ],
        [ AC_MSG_ERROR([cannot find OpenSLES headers])] )
  fi
fi

PKG_ENABLE_MODULES_VLC([SAMPLERATE], [], [samplerate], [Resampler with libsamplerate], [auto])
PKG_ENABLE_MODULES_VLC([SOXR], [], [soxr >= 0.1.2], [SoX Resampler library], [auto])
dnl
dnl  OS/2 KAI plugin
dnl
  AS_HELP_STRING([--enable-kai],
    [support the K Audio Interface KAI (default enabled on OS/2)]),, [
  AS_IF([test "$SYS" = "os2"], [
    enable_kai="yes"
  ])
])
have_kai="no"
KAI_LIBS=""
AS_IF([test "$enable_kai" != "no"], [
  AC_CHECK_HEADERS([kai.h], [
    have_kai="yes"
    AC_CHECK_LIB([kai], [main], [
AC_SUBST([KAI_LIBS])
AM_CONDITIONAL([HAVE_KAI], [test "${have_kai}" = "yes"])

dnl
dnl  chromaprint audio track fingerprinter
dnl
PKG_ENABLE_MODULES_VLC([CHROMAPRINT], [stream_out_chromaprint], [libchromaprint >= 0.6.0], [Chromaprint audio fingeprinter], [auto])
dnl
dnl  Chromecast streaming support
dnl
m4_pushdef([protobuf_lite_version], 2.5.0)
AC_ARG_VAR(PROTOC, [protobuf compiler])
AC_CHECK_PROGS(PROTOC, protoc, no)
PKG_WITH_MODULES([CHROMECAST],[protobuf-lite >= protobuf_lite_version], [
    AS_IF([test "x${PROTOC}" != "xno"], [
        build_chromecast="yes"
    ], [
    AC_MSG_ERROR(protoc compiler needed for [chromecast] was not found)
    ])
], [
    AS_IF([test "${enable_chromecast}" = "yes"],
        AC_MSG_ERROR(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found),
        AC_MSG_WARN(Library [protobuf-lite >= protobuf_lite_version] needed for [chromecast] was not found)
    )
    enable_chromecast="no"
], [(Chromecast streaming support)], [auto])
AM_CONDITIONAL([BUILD_CHROMECAST], [test "${build_chromecast}" = "yes"])
m4_popdef([protobuf_lite_version])

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

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

zorglub's avatar
zorglub committed
dnl
zorglub's avatar
zorglub committed
dnl
AC_ARG_ENABLE([qt],
  AS_HELP_STRING([--disable-qt], [Qt UI support (default enabled)]),, [
  AS_IF([test "${enable_vlc}" != "no"], [enable_qt="yes"])
  AS_IF([test "${SYS}" = "darwin"], [
    enable_qt="no"
  ])
])
AS_IF([test "${enable_qt}" != "no"], [
  PKG_CHECK_MODULES([QT], [Qt5Core >= 5.11.0 Qt5Widgets Qt5Gui Qt5Quick Qt5QuickWidgets Qt5QuickControls2 Qt5Svg], [
      PKG_CHECK_MODULES([QT5_X11], [Qt5X11Extras], [
          have_qt5_x11="yes"
      ],[
          AC_MSG_WARN([Not building Qt Interface with X11 helpers.])
      QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
      QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
      QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
      AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
      AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
      AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
      AC_PATH_PROGS(QMLCACHE, [qmlcachegen-qt5 qmlcachegen], no, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
      AS_IF([test "x${QMLCACHE}" = "xno"], [
          AC_MSG_WARN([qmlcachegen not found])
      ])
      AS_IF([test -n "${enable_qt}"],[