fix up broken with_ffmpeg check. Libraries were being linked on failure, which was very confusing, since it looked like it succeeded. Remove --with-static-ffmpeg-prefix; use --with-ffmpeg instead.
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
AC_DEFUN([SM_VIDEO], [
|
||||
AC_ARG_WITH(ffmpeg, AC_HELP_STRING([--without-ffmpeg], [Disable ffmpeg support]), with_ffmpeg=$withval, with_ffmpeg=yes)
|
||||
AC_ARG_WITH(static-ffmpeg-prefix, AC_HELP_STRING([--with-static-ffmpeg-prefix=path], [Path to ffmpeg prefix]), with_static_ffmpeg_prefix=$withval, with_static_ffmpeg_prefix=)
|
||||
|
||||
if test "$with_ffmpeg" = "yes"; then
|
||||
if test -n "$with_static_ffmpeg_prefix"; then
|
||||
if test $(echo $with_static_ffmpeg_prefix|cut -c 1) != /; then
|
||||
with_static_ffmpeg_prefix=$(/bin/pwd)/$with_static_ffmpeg_prefix
|
||||
old_LIBS="$LIBS"
|
||||
old_CFLAGS="$CFLAGS"
|
||||
old_CXXFLAGS="$CXXFLAGS"
|
||||
|
||||
if test "$with_ffmpeg" != "no"; then
|
||||
if test "$with_ffmpeg" != "yes"; then
|
||||
if test $(echo $with_ffmpeg|cut -c 1) != /; then
|
||||
with_ffmpeg=$(/bin/pwd)/$with_ffmpeg
|
||||
fi
|
||||
CFLAGS="-I$with_static_ffmpeg_prefix/include $CFLAGS"
|
||||
CXXFLAGS="-I$with_static_ffmpeg_prefix/include $CXXFLAGS"
|
||||
old_LIBS="$LIBS"
|
||||
LIBS="$with_static_ffmpeg_prefix/lib/libavcodec.a $LIBS"
|
||||
AC_CHECK_FUNC([avcodec_init], have_libavcodec=yes; old_LIBS="$LIBS", have_libavcodec=no)
|
||||
LIBS="$with_static_ffmpeg_prefix/lib/libavformat.a $LIBS"
|
||||
AC_CHECK_FUNC([guess_format], have_libavformat=yes; old_LIBS="$LIBS", have_libavformat=no)
|
||||
LIBS="$old_LIBS"
|
||||
CFLAGS="-I$with_ffmpeg/include $CFLAGS"
|
||||
CXXFLAGS="-I$with_ffmpeg/include $CXXFLAGS"
|
||||
LIBS="$with_ffmpeg/lib/libavcodec.a $LIBS"
|
||||
AC_CHECK_FUNC([avcodec_init], have_libavcodec=yes, have_libavcodec=no)
|
||||
LIBS="$with_ffmpeg/lib/libavformat.a $LIBS"
|
||||
AC_CHECK_FUNC([guess_format], have_libavformat=yes, have_libavformat=no)
|
||||
else
|
||||
AC_SEARCH_LIBS(avcodec_init, [avcodec], have_libavcodec=yes, have_libavcodec=no)
|
||||
AC_SEARCH_LIBS(guess_format, [avformat], have_libavformat=yes, have_libavformat=no)
|
||||
@@ -62,7 +63,11 @@ fi
|
||||
have_ffmpeg=no
|
||||
if test "$have_libavformat" = "yes" -a "$have_libavcodec" = "yes"; then
|
||||
have_ffmpeg=yes
|
||||
AC_DEFINE(HAVE_FFMPEG, 1, [FMPEG support available])
|
||||
AC_DEFINE(HAVE_FFMPEG, 1, [FFMPEG support available])
|
||||
else
|
||||
LIBS="$old_LIBS"
|
||||
CFLAGS="$old_CFLAGS"
|
||||
CXXFLAGS="$old_CXXFLAGS"
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_FFMPEG, test "$have_ffmpeg" = "yes")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user