From e171c972ba120a0eaccf513170b5a19edb33dd5d Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 30 Jul 2013 01:34:40 +0000 Subject: fix configure for libav* >= 1.0 on Mac OS X git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3008 b956fd51-792f-4845-bead-9b4dfca2ff2c --- configure | 139 ++++++++++++++++++++++++++++++++--- configure.ac | 9 ++- dists/autogen/m4/pkg_config_utils.m4 | 6 +- src/config-darwin.inc | 24 +++--- 4 files changed, 152 insertions(+), 26 deletions(-) diff --git a/configure b/configure index b7cc1f9e..42f88e4d 100755 --- a/configure +++ b/configure @@ -4525,7 +4525,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $libpng_VERSION_INT -le 60000000; then - if test $libpng_VERSION_INT -ge 52013100; then + if test $libpng_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $libpng_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $libpng_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $libpng_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -4733,7 +4737,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $libpng_VERSION_INT -le 60000000; then - if test $libpng_VERSION_INT -ge 52013100; then + if test $libpng_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $libpng_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $libpng_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $libpng_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -5135,7 +5143,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $lua_VERSION_INT -le 60000000; then - if test $lua_VERSION_INT -ge 52013100; then + if test $lua_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $lua_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $lua_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $lua_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -5344,7 +5356,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $lua_VERSION_INT -le 60000000; then - if test $lua_VERSION_INT -ge 52013100; then + if test $lua_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $lua_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $lua_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $lua_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -5552,7 +5568,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $lua_VERSION_INT -le 60000000; then - if test $lua_VERSION_INT -ge 52013100; then + if test $lua_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $lua_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $lua_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $lua_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -5652,6 +5672,72 @@ $as_echo_n "checking for libavcodec... " >&6; } LIBS="$LIBS $libavcodec_LIBDIRS" fi +fi + fi + if test x$have_lib = xyes; then + libavcodec_HAVE="yes" + if test -n "$libavcodec_LIBDIRS"; then + # show additional lib-dirs + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($libavcodec_LIBDIRS)" >&5 +$as_echo "yes ($libavcodec_LIBDIRS)" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + else + libavcodec_HAVE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + # check if package is required + if test xcheck = xyes -o x"$with_libavcodec" = xyes ; then + # print error message and quit + err_msg=`$PKG_CONFIG --errors-to-stdout --print-errors "libavcodec"` + as_fn_error $? " + +$err_msg + +Alternatively, you may set --with-libavcodec=nocheck and the environment +variables libavcodec_[...] (see configure --help) +to appropriate values to avoid the need to call pkg-config. + +See the pkg-config man page for more details. +" "$LINENO" 5 + fi + fi + +# The following finds libavcodec.pc in its new location on Mac OS X. +# It only takes the last from the list, assuming that this is the latest +# version. +if [ x$libavcodec_HAVE = xno -a x$FPC_PLATFORM = xdarwin ]; then + PKG_CONFIG_PATH=`find $FPCDIR/lib/ffmpeg* -name libavcodec.pc | tail -n 1 | xargs dirname`:$PKG_CONFIG_PATH + + have_lib="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libavcodec" >&5 +$as_echo_n "checking for libavcodec... " >&6; } + if test x"$with_libavcodec" = xnocheck; then + # do not call pkg-config, use user settings + have_lib="yes" + elif test x"$with_libavcodec" != xno; then + # check if package exists + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavcodec") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + + have_lib="yes" + libavcodec_LIBS=`$PKG_CONFIG --libs --silence-errors "libavcodec"` + libavcodec_LIBDIRS=`$PKG_CONFIG --libs-only-L --silence-errors "libavcodec"` + libavcodec_LIBDIRS=` + echo "$libavcodec_LIBDIRS" | $SED 's/^[ \t]*//' | $SED 's/[ \t]*$//' +` + # add library directories to LIBS (ignore *_LIBS for now) + if test -n "$libavcodec_LIBDIRS"; then + LIBS="$LIBS $libavcodec_LIBDIRS" + fi + fi fi if test x$have_lib = xyes; then @@ -5686,6 +5772,7 @@ See the pkg-config man page for more details. fi fi +fi if test x$libavcodec_HAVE = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of libavcodec" >&5 @@ -5770,7 +5857,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $libavcodec_VERSION_INT -le 60000000; then - if test $libavcodec_VERSION_INT -ge 52013100; then + if test $libavcodec_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $libavcodec_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $libavcodec_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $libavcodec_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -6097,7 +6188,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $libavformat_VERSION_INT -le 60000000; then - if test $libavformat_VERSION_INT -ge 52013100; then + if test $libavformat_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $libavformat_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $libavformat_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $libavformat_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -6303,7 +6398,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $libavutil_VERSION_INT -le 60000000; then - if test $libavutil_VERSION_INT -ge 52013100; then + if test $libavutil_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $libavutil_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $libavutil_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $libavutil_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -6524,7 +6623,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $libswscale_VERSION_INT -le 60000000; then - if test $libswscale_VERSION_INT -ge 52013100; then + if test $libswscale_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $libswscale_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $libswscale_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $libswscale_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -6741,7 +6844,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $libprojectM_VERSION_INT -le 60000000; then - if test $libprojectM_VERSION_INT -ge 52013100; then + if test $libprojectM_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $libprojectM_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $libprojectM_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $libprojectM_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -7033,7 +7140,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $portaudio_VERSION_INT -le 60000000; then - if test $portaudio_VERSION_INT -ge 52013100; then + if test $portaudio_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $portaudio_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $portaudio_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $portaudio_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" @@ -7250,7 +7361,11 @@ eof { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of ffmpeg" >&5 $as_echo_n "checking version of ffmpeg... " >&6; } if test $libpcre_VERSION_INT -le 60000000; then - if test $libpcre_VERSION_INT -ge 52013100; then + if test $libpcre_VERSION_INT -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $libpcre_VERSION_INT -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $libpcre_VERSION_INT -ge 52013100; then FFMPEG_VERSION="1.1" elif test $libpcre_VERSION_INT -ge 51073101; then FFMPEG_VERSION="1.0" diff --git a/configure.ac b/configure.ac index 9f6b39f8..d36ed657 100644 --- a/configure.ac +++ b/configure.ac @@ -202,7 +202,14 @@ AC_SUBST(lua_lib_name) # A check for version >=52.0.0 will return version 0d.51.1.2 # although it is lower because pkg-config is confused by the 0d. # Use [mylib]_VERSION_INT for version-checking instead -PKG_HAVE([libavcodec], [libavcodec], yes) +PKG_HAVE([libavcodec], [libavcodec], check) +# The following finds libavcodec.pc in its new location on Mac OS X. +# It only takes the last from the list, assuming that this is the latest +# version. +if [[ x$libavcodec_HAVE = xno -a x$FPC_PLATFORM = xdarwin ]]; then + PKG_CONFIG_PATH=`find $FPCDIR/lib/ffmpeg* -name libavcodec.pc | tail -n 1 | xargs dirname`:$PKG_CONFIG_PATH + PKG_HAVE([libavcodec], [libavcodec], yes) +fi PKG_VERSION([libavcodec], [libavcodec]) AC_CHECK_LIB([avcodec], [avcodec_decode_audio], [HAVE_AVCODEC_DECODE_AUDIO="yes"]) AC_CHECK_LIB([avcodec], [avcodec_decode_audio2], [HAVE_AVCODEC_DECODE_AUDIO2="yes"]) diff --git a/dists/autogen/m4/pkg_config_utils.m4 b/dists/autogen/m4/pkg_config_utils.m4 index d5585dc9..eba41565 100644 --- a/dists/autogen/m4/pkg_config_utils.m4 +++ b/dists/autogen/m4/pkg_config_utils.m4 @@ -101,7 +101,11 @@ AC_DEFUN([PKG_VERSION], if test $1 = "libavutil"; then AC_MSG_CHECKING([version of ffmpeg]) if test $[$1][_VERSION_INT] -le 60000000; then - if test $[$1][_VERSION_INT] -ge 52013100; then + if test $[$1][_VERSION_INT] -ge 52038100; then + FFMPEG_VERSION="2.0" + elif test $[$1][_VERSION_INT] -ge 52018100; then + FFMPEG_VERSION="1.2" + elif test $[$1][_VERSION_INT] -ge 52013100; then FFMPEG_VERSION="1.1" elif test $[$1][_VERSION_INT] -ge 51073101; then FFMPEG_VERSION="1.0" diff --git a/src/config-darwin.inc b/src/config-darwin.inc index 5edc33af..d67e08e0 100644 --- a/src/config-darwin.inc +++ b/src/config-darwin.inc @@ -18,8 +18,8 @@ {$IF Defined(HaveFFmpeg)} {$MACRO ON} {$IFNDEF FFMPEG_DIR} - {$IF (8 > 0) or (0 > 0)} - {$DEFINE FFMPEG_DIR := 'ffmpeg-0.8'} + {$IF (0 > 0) or (1 > 0)} + {$DEFINE FFMPEG_DIR := 'ffmpeg-1.0'} {$ELSE} {$DEFINE FFMPEG_DIR := 'ffmpeg'} {$DEFINE useOLD_FFMPEG} @@ -27,19 +27,19 @@ {$ENDIF} {$IF Defined(IncludeConstants)} av__codec = 'libavcodec'; - LIBAVCODEC_VERSION_MAJOR = 53; - LIBAVCODEC_VERSION_MINOR = 8; - LIBAVCODEC_VERSION_RELEASE = 0; + LIBAVCODEC_VERSION_MAJOR = 54; + LIBAVCODEC_VERSION_MINOR = 59; + LIBAVCODEC_VERSION_RELEASE = 100; av__format = 'libavformat'; - LIBAVFORMAT_VERSION_MAJOR = 53; - LIBAVFORMAT_VERSION_MINOR = 5; - LIBAVFORMAT_VERSION_RELEASE = 0; + LIBAVFORMAT_VERSION_MAJOR = 54; + LIBAVFORMAT_VERSION_MINOR = 29; + LIBAVFORMAT_VERSION_RELEASE = 104; av__util = 'libavutil'; LIBAVUTIL_VERSION_MAJOR = 51; - LIBAVUTIL_VERSION_MINOR = 9; - LIBAVUTIL_VERSION_RELEASE = 1; + LIBAVUTIL_VERSION_MINOR = 73; + LIBAVUTIL_VERSION_RELEASE = 101; {$IFEND} {$IFEND} @@ -47,8 +47,8 @@ {$IF Defined(HaveSWScale) and Defined(IncludeConstants)} sw__scale = 'libswscale'; LIBSWSCALE_VERSION_MAJOR = 2; - LIBSWSCALE_VERSION_MINOR = 0; - LIBSWSCALE_VERSION_RELEASE = 0; + LIBSWSCALE_VERSION_MINOR = 1; + LIBSWSCALE_VERSION_RELEASE = 101; {$IFEND} {$UNDEF HaveProjectM} -- cgit v1.2.3