Skip to content
Snippets Groups Projects
configure.ac 156 KiB
Newer Older
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

      [  --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 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  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 osdmenu 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.86, [
        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.86 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.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 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  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

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

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"], [
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([screensaver xcb_x11 xcb_window xcb_screen xcb_apps])
  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"
      AC_MSG_WARN([libxcb-keysyms not found. Hotkeys will not be supported.])
  AS_IF([test "${have_xcb_keysyms}" = "yes"], [
    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])
  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])
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"
   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 aout_sdl])
      if test "${SYS}" != "mingw32"; then
        VLC_ADD_LIBS([vout_sdl],[${X_LIBS} ${X_PRE_LIBS} -lX11])
      fi
      VLC_ADD_CFLAGS([vout_sdl aout_sdl],[${SDL_CFLAGS}])
      VLC_ADD_LIBS([vout_sdl aout_sdl],[${SDL_LIBS}])

      # SDL_image
      AS_IF([ test "${enable_sdl_image}" != "no"],[
        PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [
          VLC_ADD_PLUGIN([sdl_image])
          VLC_ADD_LIBS([sdl_image],[${SDL_IMAGE_LIBS}])
          VLC_ADD_CFLAGS([sdl_image], [${SDL_IMAGE_CFLAGS}])],
          [ AC_MSG_WARN([The development package for SDL_image is not installed.
    You should install it alongside your SDL package.])
          ])
      ])
   ],[
     AC_MSG_WARN([The development package for SDL is not present or too old.
                  You need 1.2.10. Alternatively you can also configure with
                  --disable-sdl.])
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])
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 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 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

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")
            ], have_directfb="false")
        ], have_directfb="false")

        dnl Restore flags
        CPPFLAGS="${CPPFLAGS_save}"
        LIBS="${LIBS_save}"

        if test "${have_directfb}" = "true"; then
            LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
            CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
        fi
        dnl Look for directfb-config
        AC_PATH_PROG(DIRECTFB_CONFIG, directfb-config, no, ${PATH})
        if test "${DIRECTFB_CONFIG}" != "no"; then
            CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
            LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
            have_directfb="true"
            dnl Trying with pkg-config
            PKG_CHECK_MODULES(DIRECTFB, directfb, [
                CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
                LIBS_mydirectfb="${DIRECTFB_LIBS}"
                have_directfb="true"
                ], [have_directfb="false"])
        fi
    fi
    if test "${have_directfb}" = "true"; then
        VLC_ADD_PLUGIN([directfb])
        VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
        VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
        AC_MSG_ERROR([cannot find directfb headers and/or libraries ])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
dnl  AA plugin
dnl
AC_ARG_ENABLE(aa,
  [  --enable-aa             aalib output (default disabled)])
if test "${enable_aa}" = "yes"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
then
  AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
  if test "${have_aa}" = "true"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  then
    VLC_ADD_PLUGIN([aa])
    VLC_ADD_LIBS([aa],[-laa])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  fi
fi

Samuel Hocevar's avatar
Samuel Hocevar committed
dnl
dnl  libcaca plugin
dnl
PKG_ENABLE_MODULES_VLC([CACA], [], [caca >= 0.99.beta14], [libcaca output],[auto])
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

dnl
dnl  OSS /dev/dsp module (enabled by default except on win32)
dnl
AC_ARG_ENABLE(oss,
  [  --enable-oss            Linux OSS /dev/dsp support (enabled on Linux)])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

if test "${enable_oss}" != "no" &&
  (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
   test "${enable_oss}" = "yes")
Samuel Hocevar's avatar
 
Samuel Hocevar committed
then
  AC_CHECK_HEADERS([soundcard.h sys/soundcard.h], [
    VLC_ADD_PLUGIN([oss access_oss])
    AC_CHECK_LIB(ossaudio,main,[VLC_ADD_LIBS([oss access_oss],[-lossaudio])])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  ])
fi

AS_IF([test "${no_x}" = "yes"], [
  AS_IF([test "${enable_pulse}" = "yes"], [
    AC_MSG_ERROR([Xlib is required for VLC PulseAudio support
(see http://www.pulseaudio.org/ticket/799 for further reference).])
  ])
], [
  PKG_ENABLE_MODULES_VLC([PULSE], [], [libpulse >= 0.9.11], [Pulseaudio support], [auto])
  VLC_ADD_LIBS([pulse], [${X_LIBS} ${X_PRE_LIBS} -lX11])
PKG_ENABLE_MODULES_VLC([PORTAUDIO], [], [portaudio-2.0], [Portaudio library support], [auto])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  ALSA module
dnl
PKG_ENABLE_MODULES_VLC([ALSA], [alsa access_alsa], [alsa >= 1.0.0], [Alsa sound support for linux], [auto])
Samuel Hocevar's avatar
 
Samuel Hocevar committed

dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  win32 waveOut plugin
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_ARG_ENABLE(waveout,
  [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
if test "${enable_waveout}" != "no"; then
  if test "${SYS}" = "mingw32"; then
    VLC_ADD_PLUGIN([waveout])
    VLC_ADD_LIBS([waveout],[-lwinmm])
gbazin's avatar
 
gbazin committed
  fi
gbazin's avatar
gbazin committed
  if test "${SYS}" = "mingwce"; then
    VLC_ADD_PLUGIN([waveout])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
fi

hartman's avatar
hartman committed
AC_ARG_ENABLE(macosx-audio,
  [  --enable-macosx-audio   Mac OS X audio module (default enabled on MacOS X)])
if test "x${enable_macosx_audio}" != "xno" &&
  (test "${SYS}" = "darwin" || test "${enable_macosx_audio}" = "yes")
  AC_CHECK_HEADERS(CoreAudio/CoreAudio.h,
      VLC_ADD_LDFLAGS([auhal],[-Wl,-framework,CoreAudio,-framework,AudioUnit,-framework,AudioToolbox,-framework,Carbon])
    ], [ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
dnl
dnl  Roku HD1000 audio
dnl
AC_ARG_ENABLE(hd1000a,
  [  --enable-hd1000a        HD1000 audio module (default enabled on HD1000)])
if test "${enable_hd1000a}" != "no" -a "${CXX}" != "" &&
  (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
   test "${enable_hd1000a}" = "yes")
then
  AC_LANG_PUSH([C++])
  AC_CHECK_HEADERS(deschutes/libraries/hdmachinex225/PCMAudioPlayer.h, [
    VLC_ADD_PLUGIN([hd1000a])
    AC_CHECK_LIB(HDMachineX225,main,VLC_ADD_LIBS([hd1000a],[-lHDMachineX225]))  ])
  AC_LANG_POP([C++])
fi

PKG_ENABLE_MODULES_VLC([JACK], [jack access_jack], [jack], [JACK audio I/O modules],[auto])
dnl
dnl  CyberLink for C++ UPnP stack
dnl
AC_ARG_ENABLE(cyberlink,
  [  --enable-cyberlink      CyberLink for C++ UPnP stack (default disabled)])
  AS_IF([test "${enable_cyberlink}" = "yes" ], [
  AC_ARG_WITH(cyberlink-tree,
    [  --with-cyberlink-tree=PATH CyberLink for C++ tree for static linking])

  dnl
  dnl test for --with-cyberlink-tree
  dnl
  AS_IF([test ! -z "${with_cyberlink_tree}" -a "${CXX}" != ""], [
    AC_LANG_PUSH(C++)
    real_cyberlink_tree="`cd ${with_cyberlink_tree} 2>/dev/null && pwd`"
    AS_IF([test -z "${real_cyberlink_tree}"], [
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_cyberlink_tree}])
    ])
    CPPFLAGS_save="${CPPFLAGS}"
    CPPFLAGS_cyberlink="-I${real_cyberlink_tree}/include"
    CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_cyberlink}"
    AC_CHECK_HEADERS([cybergarage/upnp/MediaServer.h],
      [ VLC_ADD_CXXFLAGS([upnp_cc], [${CPPFLAGS_cyberlink}])
        VLC_ADD_PLUGIN([upnp_cc])
      ],[
        AC_MSG_ERROR([cannot find CyberLink for C++ headers])
      ])
    AC_MSG_CHECKING(for libclink.a in ${with_cyberlink_tree})
    AS_IF([test -f "${real_cyberlink_tree}/lib/unix/libclink.a"], [
      AC_MSG_RESULT(${real_cyberlink_tree}/lib/unix/libclink.a)
      dnl The mere fact that we have to make such an ugly check sucks
      AC_MSG_CHECKING(for XML parser to link CyberLink with)
      LIBS_save="$LIBS"
      LIBS_cclink="no"
      for l in "`xml2-config --libs`" -lexpat -lxerces-c; do
        LIBS="$LIBS_save ${real_cyberlink_tree}/lib/unix/libclink.a -lpthread $l"
        AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <cybergarage/upnp/media/player/MediaPlayer.h>
using namespace CyberLink;

class testclass : public SearchResponseListener, public MediaPlayer
{
    virtual void deviceSearchResponseReceived( SSDPPacket *)
    {
    }

    public:
      testclass (void)
      {
        addSearchResponseListener (this);
	start ();
      }
};
],[testclass l;])],[LIBS_cclink="$l"])
      done
      LIBS="${LIBS_save}"
      dnl should not happen - otherwise this needs fixing - hence FAILURE
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
      AS_IF([test "${LIBS_cclink}" = "no"],
        [AC_MSG_FAILURE([cannot find XML parser for CyberLink])])
      AC_MSG_RESULT([${LIBS_cclink}])
      VLC_ADD_LIBS([upnp_cc], [${real_cyberlink_tree}/lib/unix/libclink.a -lpthread ${LIBS_cclink}])
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_cyberlink_tree}/lib/unix/libclink.a, make sure you compiled CyberLink for C++ in ${with_cyberlink_tree}])
    ])
    CPPFLAGS="${CPPFLAGS_save}"
    AC_LANG_POP([C++])
PKG_ENABLE_MODULES_VLC([UPNP], [upnp_intel], [libupnp], [Intel UPnp SDK],[auto])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
dnl  Interface plugins
dnl

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

dnl
dnl Skins2 module
dnl
AC_ARG_ENABLE(skins2,
  [AS_HELP_STRING([--enable-skins2],[Skins2 interface module (default
   enabled except on MacOSX, BeOS and WinCE)])])
if test "${enable_skins2}" = "yes" ||
  (test "${SYS}" != "darwin" && test "${SYS}" != "beos" &&
   test "${SYS}" != "mingwce" && test "${enable_skins2}" != "no"); then
gbazin's avatar
 
gbazin committed
  dnl test for the required libraries
  skins2_missing_lib="no"
gbazin's avatar
 
gbazin committed
  dnl freetype
gbazin's avatar
 
gbazin committed
    skins2_missing_lib="yes"
    if test "${enable_skins2}" = "yes"; then
      AC_MSG_ERROR([Could not find freetype (required for skins2)])
    fi
  fi

  if test "${skins2_missing_lib}" = "no" && (test "${SYS}" = "mingw32"); then
    VLC_ADD_PLUGIN([skins2])
gbazin's avatar
 
gbazin committed
    ALIASES="${ALIASES} svlc"
    VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -Imodules/gui/skins2 -DWIN32_SKINS])
    VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
    VLC_ADD_LIBS([skins2],[-loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32])
gbazin's avatar
 
gbazin committed

  else if test "${skins2_missing_lib}" = "no" && (test "${SYS}" = "darwin"); then
    VLC_ADD_PLUGIN([skins2])
    ALIASES="${ALIASES} svlc"
    VLC_ADD_CPPFLAGS([skins2],[-Imodules/gui/skins2 -DMACOSX_SKINS])
    VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
    VLC_ADD_LDFLAGS([skins2],[-Wl,-framework,Carbon])
gbazin's avatar
 
gbazin committed
  else if test "${skins2_missing_lib}" = "no"; then
    VLC_ADD_PLUGIN([skins2])
gbazin's avatar
 
gbazin committed
    ALIASES="${ALIASES} svlc"
    VLC_ADD_CPPFLAGS([skins2],[-Imodules/gui/skins2 ${X_CFLAGS} -DX11_SKINS])
    VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
    VLC_ADD_LIBS([skins2],[${X_LIBS} ${X_PRE_LIBS} -lXext -lX11])
    need_xid_provider="no"
AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes" ||
	 (test "${SYS}" != "darwin" && test "${SYS}" != "beos" &&
	  test "${SYS}" != "mingwce" && test "${enable_skins2}" != "no")])
dnl Hildon UI
AC_ARG_ENABLE(hildon,
  [  --enable-hildon         Hildon touchscreen UI (default disabled)])
AS_IF([test "${enable_hildon}" = "yes"], [
  PKG_CHECK_MODULES(HILDON, [hildon-1], [
    PKG_CHECK_MODULES(HILDON_FM, hildon-fm-2, [
gbazin's avatar
gbazin committed
      VLC_ADD_CFLAGS([hildon],[${HILDON_FM_CFLAGS} -DHAVE_HILDON_FM])
      VLC_ADD_LIBS([hildon],[${HILDON_FM_LIBS}])
    ], [
      AC_MSG_WARN(hildon-fm-2 not found)
    ])
Christophe Mutricy's avatar
Christophe Mutricy committed
    VLC_ADD_CFLAGS([hildon],[${HILDON_CFLAGS} ${X_CFLAGS}])
    VLC_ADD_LIBS([hildon],[${HILDON_LIBS} ${X_LIBS} ${X_PRE_LIBS} -lX11])
    VLC_ADD_PLUGIN([hildon])
    ALIASES="${ALIASES} mvlc"
    need_xid_provider="no"
    AS_IF([test "${enable_hildon}" = "yes"],[
      AC_MSG_ERROR([Hildon libraries not found])
    ])
    enable_hildon="no"
])
AM_CONDITIONAL(BUILD_HILDON, [test "${enable_hildon}" = "yes"])
zorglub's avatar
zorglub committed
dnl
dnl QT 4
dnl
AC_ARG_ENABLE(qt4,
  [  --enable-qt4            Qt 4 support (default enabled) ],, [
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
  AS_IF([test "${SYS}" = "darwin"], [enable_qt4=no])
])
AS_IF([test "${enable_qt4}" != "no"], [
  PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.4.0], [
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
    VLC_ADD_PLUGIN([qt4])
    ALIASES="${ALIASES} qvlc"
    AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" -a "${SYS}" != "darwin"], [
        VLC_ADD_LIBS([qt4],[$QT4_LIBS ${X_LIBS} ${X_PRE_LIBS} -lX11])
        need_xid_provider="no"
Christophe Mutricy's avatar
Christophe Mutricy committed
        VLC_ADD_CXXFLAGS([qt4],[$QT4_CFLAGS ${X_CFLAGS}])
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
    ], [
        VLC_ADD_LIBS([qt4],[$QT4_LIBS -lole32])
Christophe Mutricy's avatar
Christophe Mutricy committed
        VLC_ADD_CXXFLAGS([qt4],[$QT4_CFLAGS])
    AC_PATH_PROGS(MOC, [moc-qt4 moc], moc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
    AC_PATH_PROG(RCC, rcc, rcc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
    AC_PATH_PROGS(UIC, [uic-qt4 uic], uic,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
  ], [
    AS_IF([test "${enable_qt4}" = "yes"],[
      AC_MSG_ERROR([Qt 4 library not found])
    ],[
      AC_MSG_WARN([Qt 4 library not found])
    ])
    enable_qt4="no"
  ])
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
AM_CONDITIONAL(ENABLE_QT4, [test "x$enable_qt4" != "xno"])
zorglub's avatar
zorglub committed

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
AS_IF([test "${enable_skins2}" != "no" && test "x$enable_qt4" = "xno"], [
  AC_MSG_ERROR([The skins2 module depends on a the Qt4 development package. Without it you won't be able to open any dialog box from the interface, which makes the skins2 interface rather useless. Install the Qt4 development package or alternatively you can also configure with: --disable-qt4 --disable-skins2.])
])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Pierre d'Herbemont's avatar
Pierre d'Herbemont committed
dnl  MacOS X video output/gui modules
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
  [  --enable-macosx         Mac OS X gui support (default enabled on Mac OS X)])
Pierre d'Herbemont's avatar
Pierre d'Herbemont committed
if test "x${enable_macosx}" = "xyes"
then
Pierre's avatar
Pierre committed
  VLC_ADD_LDFLAGS([macosx minimal_macosx],[-Wl,-framework,Cocoa])
  VLC_ADD_LDFLAGS([macosx minimal_macosx],[-Wl,-framework,OpenGL])
Pierre d'Herbemont's avatar
Pierre d'Herbemont committed
  VLC_ADD_LDFLAGS([macosx minimal_macosx],            [-Wl,-framework,Carbon])
  VLC_ADD_LDFLAGS([macosx minimal_macosx],            [-Wl,-framework,CoreServices])
Pierre d'Herbemont's avatar
Pierre d'Herbemont committed
  VLC_ADD_LDFLAGS([macosx minimal_macosx],            [-Wl,-framework,AGL])
  VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,IOKit])
  VLC_ADD_LDFLAGS([macosx],                           [-F${CONTRIB_DIR}/Sparkle -Wl,-framework,Sparkle])
  VLC_ADD_OBJCFLAGS([macosx],                         [-F${CONTRIB_DIR}/Sparkle])
  dnl For bug report
  VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,AddressBook])
Pierre d'Herbemont's avatar
Pierre d'Herbemont committed
  VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,WebKit])
Pierre's avatar
Pierre committed
  VLC_ADD_OBJCFLAGS([macosx minimal_macosx], [-fobjc-exceptions] )
Pierre d'Herbemont's avatar
Pierre d'Herbemont committed

  VLC_ADD_PLUGIN([macosx minimal_macosx])
Pierre d'Herbemont's avatar
Pierre d'Herbemont committed
fi
Samuel Hocevar's avatar
 
Samuel Hocevar committed

dnl  MacOS X related modules
  [  --enable-macosx-vout    Mac OS X video output module (default enabled on Mac OS X)])
if test "x${enable_macosx_vout}" != "xno" &&
  (test "${SYS}" = "darwin" || test "${enable_macosx_vout}" = "yes")
  VLC_ADD_LDFLAGS([vout_macosx],[-Wl,-framework,Cocoa])
  VLC_ADD_LDFLAGS([vout_macosx],[-Wl,-framework,OpenGL])
  VLC_ADD_PLUGIN([vout_macosx])
fi
AC_ARG_ENABLE(macosx-dialog-provider,
  [  --enable-macosx-dialog-provider Mac OS X dialog module (default enabled on Mac OS X)])
if test "x${enable_macosx_dialog_provider}" != "xno" &&
  (test "${SYS}" = "darwin" || test "${enable_macosx_dialog_provider}" = "yes")
then
  VLC_ADD_LDFLAGS([macosx_dialog_provider],[-Wl,-framework,Cocoa])
  VLC_ADD_PLUGIN([macosx_dialog_provider])
fi
AC_ARG_ENABLE(macosx-qtcapture,
  [  --enable-macosx-qtcapture Mac OS X qtcapture (iSight) module (default enabled on Mac OS X)])
if test "x${enable_macosx_qtcapture}" != "xno" &&
  (test "${SYS}" = "darwin" || test "${enable_macosx_qtcapture}" = "yes")
then
  VLC_ADD_LDFLAGS([qtcapture], [-Wl,-framework,Cocoa])
  VLC_ADD_LDFLAGS([qtcapture], [-Wl,-framework,QTKit])
  VLC_ADD_LDFLAGS([qtcapture], [-Wl,-framework,CoreAudio])
  VLC_ADD_LDFLAGS([qtcapture], [-Wl,-framework,QuartzCore])
  VLC_ADD_LDFLAGS([qtcapture], [-Wl,-framework,CoreVideo])
AC_ARG_ENABLE(macosx-eyetv,
  [  --enable-macosx-eyetv   Mac OS X EyeTV (TNT Tuner) module (default enabled on Mac OS X)])
if test "x${enable_macosx_eyetv}" != "xno" &&
  (test "${SYS}" = "darwin" || test "${enable_macosx_eyetv}" = "yes")
then
  VLC_ADD_LDFLAGS([access_eyetv], [-Wl,-framework,Foundation])
  VLC_ADD_PLUGIN([access_eyetv])
fi

AC_ARG_ENABLE(macosx-vlc-app,
  [  --enable-macosx-vlc-app build the VLC media player (default enabled on Mac OS X)])
AM_CONDITIONAL(BUILD_MACOSX_VLC_APP, [test "${enable_macosx_vlc_app}" != "no" &&
    (test "${SYS}" = "darwin" || test "${enable_macosx_vlc_app}" = "yes") ])