Commit 472b2f19 authored by Christophe Mutricy's avatar Christophe Mutricy

Reorder the ffmpeg detection. Please test, there is so many corner case :(

parent 3004ad4e
......@@ -2348,35 +2348,13 @@ AC_CHECK_HEADERS(id3tag.h, [
dnl
dnl ffmpeg decoder/demuxer plugin
dnl
dnl we try to find ffmpeg using : 1- ffmpeg-config, 2- pkg-config
dnl 3- default place, 4- given tree
dnl we try to find ffmpeg using : 1- given tree 2- ffmpeg-config, 3- pkg-config
dnl 4- default place,
AC_ARG_ENABLE(ffmpeg,
[ --enable-ffmpeg ffmpeg codec (default enabled)])
if test "${enable_ffmpeg}" != "no"
then
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
AC_CHECK_HEADERS(ffmpeg/avcodec.h)
AC_CHECK_HEADERS(postproc/postprocess.h)
VLC_ADD_PLUGINS([ffmpeg])
if test "${enable_sout}" != "no"; 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
dnl Those options have to be here because the .pc can be bogus for ffmpeg previous nov 05
......@@ -2412,53 +2390,12 @@ dnl Those options have to be here because the .pc can be bogus for ffmpeg previo
VLC_ADD_LDFLAGS([ffmpeg],[-lz])
fi])
dnl Trying with pkg-config
PKG_CHECK_MODULES(FFMPEG,[libavcodec, libavformat],
[
AC_CHECK_HEADERS(ffmpeg/avcodec.h)
AC_CHECK_HEADERS(postproc/postprocess.h)
VLC_ADD_BUILTINS([ffmpeg])
if test "${enable_sout}" != "no"; then
VLC_ADD_BUILTINS([stream_out_switcher])
fi
VLC_ADD_CFLAGS([ffmpeg stream_out_switcher],[${FFMPEG_CFLAGS}])
VLC_ADD_LDFLAGS([ffmpeg],[${FFMPEG_LIBS}])
],[
dnl
dnl test for !(--with-ffmpeg-tree)
dnl
if test "${with_ffmpeg_tree}" = "no" -o -z "${with_ffmpeg_tree}"; then
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(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
AC_CHECK_LIB(avutil, av_add_i, [
VLC_ADD_LDFLAGS([ffmpeg],[-lavutil])
LDAVUTIL="-lavutil"])
AC_CHECK_LIB(avcodec, avcodec_init, [
VLC_ADD_BUILTINS([ffmpeg])
VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
if test "${enable_sout}" != "no"; then
VLC_ADD_BUILTINS([stream_out_switcher])
fi],
[ AC_MSG_ERROR([Could not find ffmpeg on your system: you may get it from http://ffmpeg.sf.net/ (cvs version is recommended). Alternatively you can use --disable-ffmpeg to disable the ffmpeg plugins.]) ], [$LDAVUTIL])
AC_CHECK_LIB(avformat, av_open_input_stream, [
AC_DEFINE(HAVE_LIBAVFORMAT, 1,
[Define if you have ffmpeg's libavformat.])
VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz]) ], [], [-lavcodec -lz $LDAVUTIL])
LDFLAGS="${LDFLAGS_save}"
CPPFLAGS="${CPPFLAGS_save}"
fi
dnl
dnl test for --with-ffmpeg-tree
dnl
AC_ARG_WITH(ffmpeg-tree,
[ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
if test "${with_ffmpeg_tree}" != "no" -a -n "${with_ffmpeg_tree}"; then
AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
......@@ -2532,16 +2469,79 @@ dnl Trying with pkg-config
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
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
AC_CHECK_HEADERS(ffmpeg/avcodec.h)
AC_CHECK_HEADERS(postproc/postprocess.h)
VLC_ADD_PLUGINS([ffmpeg])
if test "${enable_sout}" != "no"; 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
dnl Trying with pkg-config
PKG_CHECK_MODULES(FFMPEG,[libavcodec, libavformat],
[
AC_CHECK_HEADERS(ffmpeg/avcodec.h)
AC_CHECK_HEADERS(postproc/postprocess.h)
VLC_ADD_BUILTINS([ffmpeg])
if test "${enable_sout}" != "no"; then
VLC_ADD_BUILTINS([stream_out_switcher])
fi
])
AC_ARG_WITH(ffmpeg-tree,
[ --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
VLC_ADD_CFLAGS([ffmpeg stream_out_switcher],[${FFMPEG_CFLAGS}])
VLC_ADD_LDFLAGS([ffmpeg],[${FFMPEG_LIBS}])
],[
dnl
dnl last chance: at the default place
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(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
AC_CHECK_LIB(avutil, av_add_i, [
VLC_ADD_LDFLAGS([ffmpeg],[-lavutil])
LDAVUTIL="-lavutil"])
AC_CHECK_LIB(avcodec, avcodec_init, [
VLC_ADD_BUILTINS([ffmpeg])
VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
if test "${enable_sout}" != "no"; then
VLC_ADD_BUILTINS([stream_out_switcher])
fi],
[ AC_MSG_ERROR([Could not find ffmpeg on your system: you may get it from http://ffmpeg.sf.net/ (cvs version is recommended). Alternatively you can use --disable-ffmpeg to disable the ffmpeg plugins.]) ], [$LDAVUTIL])
AC_CHECK_LIB(avformat, av_open_input_stream, [
AC_DEFINE(HAVE_LIBAVFORMAT, 1,
[Define if you have ffmpeg's libavformat.])
VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz]) ], [], [-lavcodec -lz $LDAVUTIL])
LDFLAGS="${LDFLAGS_save}"
CPPFLAGS="${CPPFLAGS_save}"
])
fi
fi
fi
dnl
dnl ffmpeg decoder/demuxer plugin
dnl ffmpegaltivec plugin
dnl
AC_ARG_ENABLE(ffmpegaltivec,
[ --enable-ffmpegaltivec ffmpegaltivec codec (DO NOT USE)])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment