Skip to content
Snippets Groups Projects
configure.ac 204 KiB
Newer Older

   if test -f "${real_ffmpeg_tree}/libavutil/libavutil.a"; then
     VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavutil ${real_ffmpeg_tree}/libavutil/libavutil.a])
     VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavutil])
   fi

   VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavcodec ${real_ffmpeg_tree}/libavcodec/libavcodec.a])
   VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavcodec])

   if test -f "${real_ffmpeg_tree}/libavformat/libavformat.a"; then
     AC_DEFINE(HAVE_LIBAVFORMAT_TREE, 1, [Define if you have ffmpeg's libavformat.])
     VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavformat ${real_ffmpeg_tree}/libavformat/libavformat.a])
     VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavformat])
   fi
hartman's avatar
hartman committed

   if test -f "${real_ffmpeg_tree}/libswscale/libswscale.a"; then
     AC_DEFINE(HAVE_LIBSWSCALE_TREE, 1, [Define if you have ffmpeg's libswscale.])
     VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libswscale ${real_ffmpeg_tree}/libswscale/libswscale.a])
     VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libswscale])
   fi
else    
    
dnl Look for a ffmpeg-config (we are on debian )
 
  FFMPEG_PATH="${PATH}"
  AC_ARG_WITH(ffmpeg-config-path,
    [    --with-ffmpeg-config-path=PATH ffmpeg-config path (default search in \$PATH)],
    [ if test "${with_ffmpeg_config_path}" != "no"
      then
        FFMPEG_PATH="${with_ffmpeg_config_path}"
      fi ])
  AC_PATH_PROG(FFMPEG_CONFIG, ffmpeg-config, no, ${FFMPEG_PATH})
  if test "${FFMPEG_CONFIG}" != "no"
  then
hartman's avatar
hartman committed
    AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
    AC_CHECK_HEADERS(ffmpeg/avformat.h)
    AC_CHECK_HEADERS(ffmpeg/avutil.h)
    AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
    if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then
        VLC_ADD_PLUGINS([stream_out_switcher])
    fi
    VLC_ADD_CFLAGS([ffmpeg stream_out_switcher],[`${FFMPEG_CONFIG} --cflags`])
    VLC_ADD_LDFLAGS([ffmpeg stream_out_switcher],[`${FFMPEG_CONFIG} --plugin-libs avcodec avformat postproc`])
 
 else
   PKG_CHECK_MODULES(FFMPEG,[libavcodec, libavformat],
     VLC_SAVE_FLAGS
     CPPFLAGS="${CPPFLAGS} ${FFMPEG_CFLAGS}"
     CFLAGS="${CFLAGS} ${FFMPEG_CFLAGS}"
     AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
     AC_CHECK_HEADERS(ffmpeg/avformat.h)
     AC_CHECK_HEADERS(ffmpeg/avutil.h)
     dnl newer ffmpeg have a separate libpostproc
     PKG_CHECK_MODULES(POSTPROC, libpostproc,[
       VLC_ADD_CFLAGS([ffmpeg],[${POSTPROC_CFLAGS}]) 
       VLC_ADD_LDFLAGS([ffmpeg],[${POSTPROC_LIBS}]) 
       ],[ true ])
     CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
     CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
     AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
     if test "${SYS}" = "darwin"; then
        VLC_ADD_BUILTINS([ffmpeg])
     else
        VLC_ADD_PLUGINS([ffmpeg])
     fi
     if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then
        if test "${SYS}" = "darwin"; then
            VLC_ADD_BUILTINS([stream_out_switcher])
        else
            VLC_ADD_PLUGINS([stream_out_switcher])
        fi
     fi
     VLC_ADD_CFLAGS([ffmpeg stream_out_switcher],[${FFMPEG_CFLAGS}])
     VLC_ADD_LDFLAGS([ffmpeg stream_out_switcher],[${FFMPEG_LIBS}])
     dnl even newer ffmpeg has a libswscale
     PKG_CHECK_MODULES(SWSCALE, libswscale,[
       VLC_ADD_CFLAGS([ffmpeg],[${SWSCALE_CFLAGS}]) 
       VLC_ADD_LDFLAGS([ffmpeg],[${SWSCALE_LIBS}]) 
    dnl
      CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
      AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
      AC_CHECK_HEADERS(ffmpeg/avformat.h)
      AC_CHECK_HEADERS(ffmpeg/avutil.h)
      AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
        VLC_ADD_LDFLAGS([ffmpeg],[-lavutil])
        LDAVUTIL="-lavutil"])
        VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
        if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then
            VLC_ADD_BUILTINS([stream_out_switcher])
Christophe Mutricy's avatar
Christophe Mutricy committed
         [ AC_MSG_ERROR([Could not find ffmpeg on your system: you may get it from http://ffmpeg.sf.net/ (svn version is recommended). Alternatively you can use --disable-ffmpeg to disable the ffmpeg plugins.]) ], [$LDAVUTIL])
      AC_CHECK_LIB(postproc, pp_postprocess, [
        VLC_ADD_LDFLAGS([ffmpeg],[-lpostproc])],
	AC_MSG_ERROR([Could not find libpostproc inside FFmpeg. You should configure FFmpeg with --enable-gpl --enable-pp.]),
	[$LDAVUTIL])

      AC_CHECK_LIB(avformat, av_open_input_stream, [
        VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz]) ], [], [-lavcodec -lz $LDAVUTIL])
      LDFLAGS="${LDFLAGS_save}"
      CPPFLAGS="${CPPFLAGS_save}"
hartman's avatar
hartman committed

      AC_CHECK_LIB(swscale, sws_getContext, [
hartman's avatar
hartman committed
        VLC_ADD_LDFLAGS([ffmpeg],[-lswscale]) ], [], [-lavcodec $LDAVUTIL])
      LDFLAGS="${LDFLAGS_save}"
      CPPFLAGS="${CPPFLAGS_save}"
gbazin's avatar
 
gbazin committed
  fi
dnl
AC_ARG_ENABLE(ffmpegaltivec,
[  --enable-ffmpegaltivec  ffmpegaltivec codec (DO NOT USE)])
if test "${enable_ffmpegaltivec}" = "yes"
then
  if test "${with_ffmpeg_tree}" != "no" -a -n "${with_ffmpeg_tree}"; then
    AC_MSG_CHECKING(for libavcodecaltivec.a in ${with_ffmpeg_tree})
    real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
    if test -z "${real_ffmpeg_tree}"; then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
    fi
    if ! test -f "${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a"; then
      dnl  The given libavcodecaltivec wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a, make sure you compiled libavcodecaltivec in ${with_ffmpeg_tree}])
    fi
    if ! fgrep -s "pp_get_context" "${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a"; then
      dnl  The given libavcodecaltivec wasn't built with --enable-pp
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a was not compiled with postprocessing support, make sure you configured ffmpeg with --enable-pp])
    fi
    dnl  Use a custom libffmpeg
    AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a)
    VLC_ADD_BUILTINS([ffmpegaltivec])
    VLC_ADD_LDFLAGS([ffmpegaltivec],[-L${real_ffmpeg_tree}/libavcodec -lavcodecaltivec])
    VLC_ADD_CPPFLAGS([ffmpeg],[-DNO_ALTIVEC_IN_FFMPEG])
    VLC_ADD_CPPFLAGS([ffmpegaltivec],[-I${real_ffmpeg_tree}/libavcodec -I${real_ffmpeg_tree}/libavformat])

    if test -f "${real_ffmpeg_tree}/libavformat/libavformat.a"; then
      AC_DEFINE(HAVE_LIBAVFORMAT_TREE, 1, [Define if you have ffmpeg's libavformat.])
      VLC_ADD_LDFLAGS([ffmpegaltivec],[-L${real_ffmpeg_tree}/libavformat -lavformataltivec -lz])
      VLC_ADD_CPPFLAGS([ffmpegaltivec],[-I${real_ffmpeg_tree}/libavformat])
    fi
    VLC_ADD_LDFLAGS([stream_out_switcher],[-L${real_ffmpeg_tree}/libavcodec])
    VLC_ADD_CPPFLAGS([stream_out_switcher],[-I${real_ffmpeg_tree}/libavcodec -I${real_ffmpeg_tree}/libavformat])
dnl
dnl  faad decoder plugin
dnl
AC_ARG_ENABLE(faad,
[  --enable-faad           faad codec (default disabled)])
if test "${enable_faad}" = "yes"
  [    --with-faad-tree=PATH faad tree for static linking])
Samuel Hocevar's avatar
Samuel Hocevar committed
  if test -n "${with_faad_tree}"
  then
    AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
    real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
Samuel Hocevar's avatar
Samuel Hocevar committed
    if test -z "${real_faad_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
    fi
    if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
    then
      dnl  Use a custom faad
      AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
      VLC_ADD_BUILTINS([faad])
      VLC_ADD_LDFLAGS([faad],[${real_faad_tree}/libfaad/.libs/libfaad.a])
      VLC_ADD_CPPFLAGS([faad],[-I${real_faad_tree}/include])
    else
      dnl  The given libfaad wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
    AC_CHECK_HEADERS(faad.h, ,
      [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
    AC_CHECK_LIB(faad, faacDecOpen, [
      VLC_ADD_PLUGINS([faad])
      VLC_ADD_LDFLAGS([faad],[-lfaad]) ],
      AC_CHECK_LIB(faad, NeAACDecOpen, [
        VLC_ADD_PLUGINS([faad])
        VLC_ADD_LDFLAGS([faad],[-lfaad]) ],
        [ AC_MSG_ERROR([Cannot find libfaad library...]) ]))
    LDFLAGS="${LDFLAGS_save}"
    CPPFLAGS="${CPPFLAGS_save}"
AC_ARG_ENABLE(twolame,
[  --enable-twolame        twolame codec (default disabled)])
if test "${enable_twolame}" = "yes"
  AC_ARG_WITH(twolame-tree,
  [    --with-twolame-tree=PATH twolame tree for static linking])
  if test -n "${with_twolame_tree}"
    AC_MSG_CHECKING(for libtwolame.a in ${with_twolame_tree})
    real_twolame_tree="`cd ${with_twolame_tree} 2>/dev/null && pwd`"
    if test -z "${real_twolame_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_twolame_tree}])
    if test -f "${real_twolame_tree}/libtwolame/.libs/libtwolame.a"
      AC_MSG_RESULT(${real_twolame_tree}/libtwolame/.libs/libtwolame.a)
      VLC_ADD_LDFLAGS([twolame],[${real_twolame_tree}/libtwolame/.libs/libtwolame.a])
      VLC_ADD_CPPFLAGS([twolame],[-I${real_twolame_tree}/libtwolame -DLIBTWOLAME_STATIC])
      AC_MSG_ERROR([cannot find ${real_twolame_tree}/libtwolame/.libs/libtwolame.a, make sure you compiled libtwolame in ${with_twolame_tree}])
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_twolame} -DLIBTWOLAME_STATIC"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_twolame}"
    AC_CHECK_HEADERS(twolame.h, ,
      [ AC_MSG_ERROR([Cannot find development header for libtwolame...]) ])
    AC_CHECK_LIB(twolame, twolame_init, [
      VLC_ADD_PLUGINS([twolame])
      VLC_ADD_CPPFLAGS([twolame],[-DLIBTWOLAME_STATIC])
      VLC_ADD_LDFLAGS([twolame],[-ltwolame]) ],
        [ AC_MSG_ERROR([Cannot find libtwolame library...]) ])
    LDFLAGS="${LDFLAGS_save}"  
dnl
dnl  QuickTime plugin
dnl
AC_ARG_ENABLE(quicktime,
  [  --enable-quicktime      QuickTime module (default enabled on MacOS X)])
if test "${enable_quicktime}" != "no" &&
  (test "${SYS}" = "darwin" || test "${enable_quicktime}" = "yes")
gbazin's avatar
 
gbazin committed
  if test "${SYS}" = "mingw32"; then
    VLC_ADD_BUILTINS([quicktime])
gbazin's avatar
 
gbazin committed
  else
  AC_CHECK_HEADERS(QuickTime/QuickTime.h,
    [ VLC_ADD_BUILTINS([quicktime])
      VLC_ADD_LDFLAGS([quicktime],[-framework QuickTime -framework Carbon])
hartman's avatar
hartman committed
    ], [ AC_MSG_ERROR([cannot find QuickTime headers]) ])
gbazin's avatar
 
gbazin committed
  fi
dnl
dnl  Real plugin
dnl
AC_ARG_ENABLE(real,
  [  --enable-real           Real audio module (default disabled)])
if test "${enable_real}" = "yes"; then
  VLC_ADD_PLUGINS([realaudio])
fi

dnl
dnl  Real RTSP plugin
dnl
AC_ARG_ENABLE(realrtsp,
  [  --enable-realrtsp       Real RTSP module (default disabled)])
if test "${enable_realrtsp}" = "yes"; then
  VLC_ADD_PLUGINS([access_realrtsp])
fi

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

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

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

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

gbazin's avatar
 
gbazin committed
dnl  Flac plugin
  [  --enable-flac           libflac decoder/encoder support (default disabled)])
if test "${enable_flac}" = "yes"
  AC_ARG_WITH(flac-tree,
  [    --with-flac-tree=PATH flac tree for static linking])
  if test -n "${with_flac_tree}"
  then
    AC_MSG_CHECKING(for libFLAC.a in ${with_flac_tree})
    real_flac_tree="`cd ${with_flac_tree} 2>/dev/null && pwd`"
    if test -z "${real_flac_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_flac_tree}])
    fi
    if test -f "${real_flac_tree}/src/libFLAC/.libs/libFLAC.a"
    then
      dnl  Use a custom flac
      AC_MSG_RESULT(${real_flac_tree}/src/libFLAC/.libs/libFLAC.a)
      VLC_ADD_LDFLAGS([flac],[${real_flac_tree}/src/libFLAC/.libs/libFLAC.a])
      VLC_ADD_CFLAGS([flac],[-I${real_flac_tree}/include])
      AC_DEFINE(HAVE_FLAC_STREAM_DECODER_H, 1, [Define if you have FLAC])
    else
      dnl  The given flac wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_flac_tree}/src/libFLAC/.libs/libFLAC.a, make sure you compiled flac in ${with_flac_tree}])
    fi
  else
    AC_CHECK_HEADERS(FLAC/stream_decoder.h, [
      VLC_ADD_LDFLAGS([flac],[-lFLAC])
gbazin's avatar
 
gbazin committed
dnl
dnl  Libmpeg2 plugin
dnl
AC_ARG_ENABLE(libmpeg2,
gbazin's avatar
 
gbazin committed
  [  --enable-libmpeg2       libmpeg2 decoder support (default enabled)])
if test "${enable_libmpeg2}" != "no"
gbazin's avatar
 
gbazin committed
then
  AC_ARG_WITH(libmpeg2-tree,
  [    --with-libmpeg2-tree=PATH libmpeg2 tree for static linking])
Samuel Hocevar's avatar
Samuel Hocevar committed
  if test -n "${with_libmpeg2_tree}"
  then
    AC_MSG_CHECKING(for libmpeg2.a in ${with_libmpeg2_tree})
    real_libmpeg2_tree="`cd ${with_libmpeg2_tree} 2>/dev/null && pwd`"
Samuel Hocevar's avatar
Samuel Hocevar committed
    if test -z "${real_libmpeg2_tree}"
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_libmpeg2_tree}])
    fi
    if test -f "${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a"
    then
      dnl  Use a custom libmpeg2
      AC_MSG_RESULT(${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a)
      VLC_ADD_LDFLAGS([libmpeg2],[-L${real_libmpeg2_tree}/libmpeg2/.libs -lmpeg2])
      VLC_ADD_CFLAGS([libmpeg2],[-I${real_libmpeg2_tree}/include])
      eval "`cd ${real_libmpeg2_tree}/include && ln -sf . mpeg2dec 2>/dev/null`"
    else
      dnl  The given libmpeg2 wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a, make sure you compiled libmpeg2 in ${with_libmpeg2_tree}])
    fi
  else
    AC_CHECK_HEADERS(mpeg2dec/mpeg2.h, [
      AC_MSG_CHECKING(for libmpeg2 version >= 0.3.2)
      AC_EGREP_CPP(yes,
        [#include <mpeg2dec/mpeg2.h>
         #ifdef MPEG2_RELEASE
         #if MPEG2_RELEASE >= MPEG2_VERSION(0,3,2)
         yes
         #endif
         #endif],
        [AC_MSG_RESULT([yes])
          VLC_ADD_PLUGINS([libmpeg2])
          VLC_ADD_LDFLAGS([libmpeg2],[-lmpeg2])],
        [AC_MSG_RESULT([no])
          AC_MSG_ERROR([Your libmpeg2 is too old (you need the cvs version): you may get a more recent one from http://libmpeg2.sf.net/. Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.])])],

      [AC_MSG_ERROR([Could not find libmpeg2 on your system: you may get it from http://libmpeg2.sf.net/ (you need the cvs version). Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.])]
    )
  fi
gbazin's avatar
 
gbazin committed
fi

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

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

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

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

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

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

dnl
dnl  dirac decoder plugin
dnl
AC_ARG_ENABLE(dirac,
[  --enable-dirac          experimental dirac codec (default disabled)])
if test "${enable_dirac}" = "yes"; then
  PKG_CHECK_MODULES(DIRAC,[dirac >= 0.6.0], [
Christophe Mutricy's avatar
Christophe Mutricy committed
      VLC_ADD_CFLAGS([dirac],[$DIRAC_CFLAGS])
      VLC_ADD_LDFLAGS([dirac],[$DIRAC_LIBS -lstdc++]) ],[
      AC_MSG_ERROR([libdirac doesn't appear to be installed on you system.])
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_LDFLAGS([png],[-lpng -lz])
    VLC_ADD_PLUGINS([png])
    AC_DEFINE(HAVE_LIBPNG, [], [Define if you have the PNG library: libpng])],
    [],[-lz])
  LDFLAGS="${LDFLAGS_save}"
  ])
fi

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_LDFLAGS([x264],[-L${real_x264_tree}])
      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_x264} ${THREAD_LIB}"
      AC_CHECK_LIB(x264, x264_encoder_open, [
        VLC_ADD_BUILTINS([x264])
        VLC_ADD_LDFLAGS([x264],[-lx264])
      ],[
        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
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_x264} ${THREAD_LIB}"
    AC_CHECK_HEADERS(x264.h, [
      AC_CHECK_LIB(x264, x264_encoder_open, [
        VLC_ADD_PLUGINS([x264])
        VLC_ADD_LDFLAGS([x264],[-lx264])
      ],[
        if test "${enable_x264}" = "yes"; then
            AC_MSG_ERROR([Could not find libx264 on your system: you may get it from http://www.videolan.org/x264.html])
          fi
      ])
    ])
    LDFLAGS="${LDFLAGS_save}"
  fi
fi

dnl
dnl  CMML plugin
dnl
AC_ARG_ENABLE(cmml,
  [  --enable-cmml           CMML support (default enabled)])
if test "${enable_cmml}" != "no"
then
  VLC_ADD_PLUGINS([cmml])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  Video plugins
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl

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

gbazin's avatar
 
gbazin committed
dnl Check for DPMS
if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
  CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
gbazin's avatar
 
gbazin committed
  AC_CHECK_HEADERS(X11/extensions/dpms.h, [
    AC_MSG_CHECKING(for DPMSInfo in X11/extensions/dpms.h)
    AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
      AC_MSG_RESULT(yes)
      AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
                Define if <X11/extensions/dpms.h> defines DPMSInfo.)
    ],[
      AC_MSG_RESULT(no)
    ])
  ],,[
    #include <X11/Xlib.h>
  ])
  CPPFLAGS="${CPPFLAGS_save}"
fi

Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl  X11 module
dnl  (enabled by default except on win32)
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
Samuel Hocevar's avatar
 
Samuel Hocevar committed
AC_ARG_ENABLE(x11,
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  [  --enable-x11            X11 support (default enabled)])
if test "${enable_x11}" != "no" &&
  (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
   test "${enable_x11}" = "yes"); then
  CPPFLAGS="${CPPFLAGS_save} ${X_FLAGS}"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  AC_CHECK_HEADERS(X11/Xlib.h, [
    VLC_ADD_PLUGINS([panoramix])
    VLC_ADD_LDFLAGS([panoramix],[${X_LIBS} ${X_PRE_LIBS} -lX11])
    VLC_ADD_CPPFLAGS([panoramix],[${X_CFLAGS}])
      VLC_ADD_PLUGINS([x11])
      VLC_ADD_LDFLAGS([x11],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext])
      VLC_ADD_CPPFLAGS([x11],[${X_CFLAGS}])
    ])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  ])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
fi

dnl
dnl  XVideo module
dnl  (enabled by default except on win32)
dnl
AC_ARG_ENABLE(xvideo,
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  [  --enable-xvideo         XVideo support (default enabled)])
if test "${enable_xvideo}" != "no" &&
  (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
   test "${enable_xvideo}" = "yes"); then
  CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  AC_CHECK_HEADERS(X11/extensions/Xv.h, [
    CFLAGS="${CFLAGS_save} ${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext"
Samuel Hocevar's avatar
Samuel Hocevar committed
    AC_CHECK_LIB(Xv,XvPutImage,[
      # If libXv.so is available, xvideo can be a plugin. Otherwise, we
      # test for libXv_pic.
      if test -f /usr/X11R6/lib/libXv.so -o -f /usr/lib/libXv.so -o -f "${x_libraries}"/libXv.so; then
        VLC_ADD_PLUGINS([xvideo])
        VLC_ADD_CPPFLAGS([xvideo],[${X_CFLAGS}])
        VLC_ADD_LDFLAGS([xvideo],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext -lXv])
Samuel Hocevar's avatar
Samuel Hocevar committed
      else
        AC_CHECK_LIB(Xv_pic,XvPutImage,[
          VLC_ADD_PLUGINS([xvideo])
          VLC_ADD_CPPFLAGS([xvideo],[${X_CFLAGS}])
          VLC_ADD_LDFLAGS([xvideo],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext -lXv_pic])
Samuel Hocevar's avatar
Samuel Hocevar committed
        ],[
          VLC_ADD_BUILTINS([xvideo])
          VLC_ADD_LDFLAGS([xvideo],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext -lXv])
          VLC_ADD_CPPFLAGS([xvideo],[${X_CFLAGS}])
Samuel Hocevar's avatar
Samuel Hocevar committed
        ])
      fi
gbazin's avatar
 
gbazin committed
    ])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
  ]
Samuel Hocevar's avatar
 
Samuel Hocevar committed
fi
Samuel Hocevar's avatar
 
Samuel Hocevar committed

dnl
dnl  GLX module
dnl  (enabled by default except on win32)
dnl
AC_ARG_ENABLE(glx,
  [  --enable-glx            X11 OpenGL (GLX) support (default enabled)])
if test "${enable_glx}" != "no" &&
  (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
   test "${enable_glx}" = "yes"); then
  CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
Rafaël Carré's avatar
Rafaël Carré committed
  AC_CHECK_HEADERS(X11/Xlib.h GL/glu.h GL/glx.h)
  AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
    [[#if !defined(HAVE_X11_XLIB_H) || !defined(HAVE_GL_GLU_H) || !defined(HAVE_GL_GLX_H)
    choke me
    #endif]]),
    [
      VLC_ADD_LDFLAGS([glx],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext -lGL -lGLU])
      VLC_ADD_CPPFLAGS([glx],[${X_CFLAGS}])
Rafaël Carré's avatar
Rafaël Carré committed
    ],[AC_MSG_ERROR([Please install GL development package. Alternatively you can also configure with --disable-glx.])])
Jean-Paul Saman's avatar
Jean-Paul Saman committed
dnl
dnl  XVMC module
dnl  (enabled by default except on win32)
dnl
AC_ARG_ENABLE(xvmc,
  [  --enable-xvmc            XVMC support (default disabled)])
if test "${enable_xvmc}" = "yes" &&
  (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
   test "${enable_xvmc}" = "yes"); then
  CPPFLAGS="${CPPFLAGS_save} ${X_FLAGS}"
  AC_CHECK_HEADERS(X11/extensions/vldXvMC.h, [
    VLC_ADD_PLUGINS([xvmc])
    VLC_ADD_LDFLAGS([xvmc],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext])
    VLC_ADD_CPPFLAGS([xvmc],[${X_CFLAGS}])
  ])
  CPPFLAGS="${CPPFLAGS_save}"
fi

AC_ARG_ENABLE(xinerama,
  [  --enable-xinerama       Xinerama support (default enabled)])
if test "${enable_xvideo}" != "no" && test "${enable_xinerama}" != "no" &&
  (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
   test "${enable_xvideo}" = "yes"); then
Samuel Hocevar's avatar
Samuel Hocevar committed
  ac_cv_have_xinerama="no"
  CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
  CFLAGS="${CFLAGS_save} ${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext"
Samuel Hocevar's avatar
Samuel Hocevar committed
  AC_CHECK_HEADERS(X11/extensions/Xinerama.h,[
    AC_CHECK_LIB(Xinerama_pic, XineramaQueryExtension,[
      VLC_ADD_LDFLAGS([xvideo],[-lXinerama_pic])
      VLC_ADD_LDFLAGS([x11],[-lXinerama_pic])
      VLC_ADD_LDFLAGS([glx],[-lXinerama_pic])
Samuel Hocevar's avatar
Samuel Hocevar committed
      ac_cv_have_xinerama="yes"
    ],[
      AC_CHECK_LIB(Xinerama, XineramaQueryExtension,[
        VLC_ADD_LDFLAGS([xvideo],[-lXinerama])
        VLC_ADD_LDFLAGS([x11],[-lXinerama])
        VLC_ADD_LDFLAGS([glx],[-lXinerama])
Samuel Hocevar's avatar
Samuel Hocevar committed
        ac_cv_have_xinerama="yes"
      ])
    ])
  ])
  if test "${ac_cv_have_xinerama}" = "yes"; then
    AC_DEFINE(HAVE_XINERAMA, 1, [Define this if you have libXinerama installed])
  fi
  CFLAGS="${CFLAGS_save}"
  CPPFLAGS="${CPPFLAGS_save}"

dnl
dnl  Check for XF86VidMode extension
dnl
  ac_cv_have_xf86vidmode="no"
  CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
  CFLAGS="${CFLAGS_save} ${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext"
  AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,[
    AC_CHECK_LIB(Xxf86vm_pic, XF86VidModeGetViewPort,[
      VLC_ADD_LDFLAGS([xvideo],[-lXxf86vm_pic])
      VLC_ADD_LDFLAGS([x11],[-lXxf86vm_pic])
      VLC_ADD_LDFLAGS([glx],[-lXxf86vm_pic])
      ac_cv_have_xf86vidmode="yes"
    ],[
      AC_CHECK_LIB(Xxf86vm, XF86VidModeGetViewPort,[
        VLC_ADD_LDFLAGS([xvideo],[-lXxf86vm])
        VLC_ADD_LDFLAGS([x11],[-lXxf86vm])
        VLC_ADD_LDFLAGS([glx],[-lXxf86vm])
        ac_cv_have_xf86vidmode="yes"
      ])
    ])
  ],[true],
[#ifdef HAVE_X11_XLIB_H
# include <X11/Xlib.h>
#endif]
   )
  AS_IF([test "${ac_cv_have_xf86vidmode}" = "yes"],
    [AC_DEFINE(HAVE_XF86VIDMODE, 1, [Define this if you have libXxf86vm installed])
  ])
  CFLAGS="${CFLAGS_save}"
  CPPFLAGS="${CPPFLAGS_save}"

dnl  OpenGL module
dnl  (enabled by default except on beos)
  [  --enable-opengl         OpenGL support (default enabled)])
if test "${enable_opengl}" != "no" &&
   test "${SYS}" != "beos" -a "${SYS}" != "mingwce"; then
  if test "${SYS}" != "darwin"; then
      VLC_ADD_PLUGINS([opengl])
      if test "${SYS}" != "mingw32"; then
dionoea's avatar
dionoea committed
        VLC_ADD_LDFLAGS([opengl],[${X_LIBS} -lGL -lGLU])
dionoea's avatar
dionoea committed
        VLC_ADD_LDFLAGS([opengl],[-lopengl32 -lglu32])
      fi
    ])
  else
    dnl OS X special case (no GL/gl.h but OpenGL/gl.h)
dionoea's avatar
dionoea committed
    VLC_ADD_LDFLAGS([opengl],[-framework OpenGL])
Samuel Hocevar's avatar
 
Samuel Hocevar committed
dnl
dnl  SDL module
dnl