diff options
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ffmpeg.m4 | 56 | ||||
-rw-r--r-- | m4/optimizations.m4 | 5 |
2 files changed, 30 insertions, 31 deletions
diff --git a/m4/ffmpeg.m4 b/m4/ffmpeg.m4 index 51f1eef83..8f056ffc8 100644 --- a/m4/ffmpeg.m4 +++ b/m4/ffmpeg.m4 @@ -6,7 +6,8 @@ dnl dnl dnl AM_PATH_FFMPEG([ACTION IF FOUND [, ACTION IF NOT FOUND]])) dnl -dnl It looks for ffmpeg, defines FFMPEG_CPPFLAGS and FFMPEG_LIBS. +dnl It looks for ffmpeg, defines FFMPEG_CPPFLAGS, FFMPEG_LDFLAFS, FFMPEG_LIBS and +dbl FFMPEG_POSTPROC_LIBS. dnl AC_DEFUN([AM_PATH_FFMPEG], [ @@ -37,7 +38,7 @@ if test x"$external_ffmpeg" != "xno"; then external_ffmpeg_found=no dnl look for the ffmpeg or just check specified flags - if test x"$FFMPEG_CPPFLAGS" = "x" -a x"$FFMPEG_LIBS" = "x"; then + if test x"$FFMPEG_CPPFLAGS" = "x" -a x"$FFMPEG_LDFLAGS" = "x" -a x"$FFMPEG_LIBS" = x -a x"$FFMPEG_POSTPROC_LIBS" = "x"; then dnl look for ffmpeg if test x"$ffmpeg_prefix" = "x"; then prefixes="/usr /usr/local /opt" @@ -45,10 +46,15 @@ if test x"$external_ffmpeg" != "xno"; then prefixes="$ffmpeg_prefix" fi for dir in $prefixes; do - FFMPEG_CPPFLAGS="-I${dir}/include/ffmpeg -I${dir}/include/postproc" - FFMPEG_LIBS="-L${dir}/lib" + if test -d ${dir}/include/postproc ; then + postproc=" -I${dir}/include/postproc" + elif test -d ${dir}/include/ffmpeg/postproc ; then + postproc=" -I${dir}/include/ffmpeg/postproc" + fi + FFMPEG_CPPFLAGS="-I${dir}/include/ffmpeg${postproc}" + FFMPEG_LDFLAGS="-L${dir}/lib" CPPFLAGS="${FFMPEG_CPPFLAGS} ${ac_save_CPPFLAGS}" - LDFLAGS="${FFMPEG_LIBS} ${ac_save_LDFLAGS}" + LDFLAGS="${FFMPEG_LDFLAGS} ${ac_save_LDFLAGS}" dnl drop the cache for i in "ac_cv_header_avcodec_h" "ac_cv_header_postprocess_h" \ @@ -62,29 +68,24 @@ if test x"$external_ffmpeg" != "xno"; then AC_CHECK_HEADER(avcodec.h, , continue) AC_CHECK_HEADER(postprocess.h, , continue) - dnl look for libpostproc inside libavcodec - AC_CHECK_LIB(avcodec, pp_get_context, - [external_ffmpeg_found=yes - FFMPEG_LIBS="${FFMPEG_LIBS} -lavcodec" - break], - , + dnl look for libpostproc and libpostproc inside libavcodec + AC_CHECK_LIB(postproc, pp_get_context, + [FFMPEG_POSTPROC_LIBS="-lpostproc"], + AC_CHECK_LIB(avcodec, pp_get_context, + [FFMPEG_POSTPROC_LIBS="-lavcodec"], + [break], + [] + ), [] ) - dnl look for shared libpostproc and avcodec - AC_CHECK_LIB(postproc, pp_get_context, - AC_CHECK_LIB(avcodec, register_avcodec, - [external_ffmpeg_found=yes - FFMPEG_POSTPROC_LIBS="${FFMPEG_LIBS} -lpostproc" - FFMPEG_LIBS="${FFMPEG_LIBS} -lavcodec" - break] - ),, - [-lavcodec] + dnl look for libavcodec + AC_CHECK_LIB(avcodec, register_avcodec, + [external_ffmpeg_found=yes + FFMPEG_LIBS="-lavcodec" + break] ) done - if test x$FFMPEG_POSTPROC_LIBS = "x"; then - FFMPEG_POSTPROC_LIBS="${FFMPEG_LIBS}" - fi dnl result of autodetection if test x"$external_ffmpeg_found" = "xyes"; then @@ -93,8 +94,8 @@ if test x"$external_ffmpeg" != "xno"; then AC_MSG_ERROR([External ffmpeg library not found. ********************************************************************* You can try to specify prefix of ffmpeg library by the option ---with-external-ffmpeg=prefix, or to specify custom FFMPEG_CPPFLAGS -and FFMPEG_LIBS. +--with-external-ffmpeg=prefix, or to specify custom FFMPEG_CPPFLAGS, +FFMPEG_LIBS and FFMPEG_POSTPROC_LIBS. If you would like to use the internal ffmpeg, please remove the configure option --with-external-ffmpeg. @@ -102,8 +103,8 @@ configure option --with-external-ffmpeg. fi else dnl check specified flags - CPPFLAGS="${FFMPEG_CPPFLAGS} ${ac_save_CPPFLAGS}" - LDFLAGS="${FFMPEG_LIBS} ${FFMPEG_POSTPROC_LIBS } ${ac_save_LDFLAGS}" + CPPFLAGS="${ac_save_CPPFLAGS} ${FFMPEG_CPPFLAGS}" + LDFLAGS="${ac_save_LDFLAGS} ${FFMPEG_LDFLAGS} ${FFMPEG_LIBS} ${FFMPEG_POSTPROC_LIBS}" AC_LINK_IFELSE([#include <avcodec.h> #include <postprocess.h> @@ -161,6 +162,7 @@ use internal ffmpeg. fi AC_SUBST(FFMPEG_CPPFLAGS) + AC_SUBST(FFMPEG_LDFLAGS) AC_SUBST(FFMPEG_LIBS) AC_SUBST(FFMPEG_POSTPROC_LIBS) diff --git a/m4/optimizations.m4 b/m4/optimizations.m4 index 88e4f9fea..3013fcf3f 100644 --- a/m4/optimizations.m4 +++ b/m4/optimizations.m4 @@ -67,12 +67,9 @@ AC_DEFUN([AC_OPTIMIZATIONS], [ dnl -finline-functions. Use -fno-inline-functions for gcc < 3.4.0. AC_MSG_CHECKING(for gcc 3.4.0 or later) - ARG1="$1" - ARG2="$2" - ARG3="$3" newGCC="`"$CC" -dumpversion | awk 'BEGIN { FS = "." }; - 1 { if (($ARG1 * 10000 + $ARG2 * 100 + $ARG3) >= 30400) { print "yes" } }' + 1 { if ((@S|@1 * 10000 + @S|@2 * 100 + @S|@3) >= 30400) { print "yes" } }' `" AC_MSG_RESULT(${newGCC:-no - assuming bugginess in -finline-functions}) test "$newGCC" = yes || INLINE_FUNCTIONS=-fno-inline-functions |