+dnl
+dnl ffmpeg decoder/demuxer plugin
+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 stream_out_transcodealtivec])
+ 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, 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
+
+ dnl XXX: we don't link with -lavcodec a 2nd time because the OS X
+ dnl linker would miserably barf on multiple definitions.
+ VLC_ADD_LDFLAGS([stream_out_transcodealtivec],[-L${real_ffmpeg_tree}/libavcodec])
+ VLC_ADD_CPPFLAGS([stream_out_transcode],[-DNO_ALTIVEC_IN_FFMPEG])
+ VLC_ADD_CPPFLAGS([stream_out_transcodealtivec],[-I${real_ffmpeg_tree}/libavcodec -I${real_ffmpeg_tree}/libavformat])
+ fi
+fi
+