diff options
author | František Dvořák <valtri@users.sourceforge.net> | 2004-09-20 19:02:47 +0000 |
---|---|---|
committer | František Dvořák <valtri@users.sourceforge.net> | 2004-09-20 19:02:47 +0000 |
commit | 747ab57ec201661d72adfdf0ce538d728c0013c5 (patch) | |
tree | 8c2046571e0ed5cdab46bfe9676ef2b8692f2336 | |
parent | 5609b15a6953dfc65df6b61a634e1e43ade4efaa (diff) | |
download | xine-lib-747ab57ec201661d72adfdf0ce538d728c0013c5.tar.gz xine-lib-747ab57ec201661d72adfdf0ce538d728c0013c5.tar.bz2 |
Fixed the detection of external ffmpeg.
Added a warning.
CVS patchset: 6981
CVS date: 2004/09/20 19:02:47
-rw-r--r-- | m4/ffmpeg.m4 | 114 |
1 files changed, 62 insertions, 52 deletions
diff --git a/m4/ffmpeg.m4 b/m4/ffmpeg.m4 index 5457d556d..4ea6301d9 100644 --- a/m4/ffmpeg.m4 +++ b/m4/ffmpeg.m4 @@ -37,10 +37,10 @@ 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_LIBS" = "x"; then dnl look for ffmpeg - if test x"$ffmpeg_prefix" = x; then - prefixes="$ffmpeg_prefix /usr /usr/local /opt" + if test x"$ffmpeg_prefix" = "x"; then + prefixes="/usr /usr/local /opt" else prefixes="$ffmpeg_prefix" fi @@ -57,74 +57,74 @@ if test x"$external_ffmpeg" != "xno"; then "ac_cv_lib_avcodec_register_avcodec"; do $as_unset $i || test "${$i+set}" != set || { $i=; export $i; } done - - dnl check the headers - AC_CHECK_HEADERS(avcodec.h postprocess.h, - [dnl look for libpostproc inside libavcodec - AC_CHECK_LIB(avcodec, pp_get_context, + + dnl look for headers + 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 shared libpostproc and avcodec + AC_CHECK_LIB(postproc, pp_get_context, + AC_CHECK_LIB(avcodec, register_avcodec, [external_ffmpeg_found=yes - FFMPEG_LIBS="${FFMPEG_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_LIBS="${FFMPEG_LIBS} -lavcodec -lpostproc" - break], - [continue], - [-lavcodec] - )], - [continue] - )], - [] - )], - [continue] + FFMPEG_LIBS="${FFMPEG_LIBS} -lavcodec -lpostproc" + break] + ),, + [-lavcodec] ) done dnl result of autodetection if test x"$external_ffmpeg_found" = "xyes"; then - AC_MSG_RESULT([External ffmpeg library was found in ${dir}]) + AC_MSG_RESULT([External ffmpeg library was found in ${dir}.]) else 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. - - If you would like to use the internal ffmpeg, please remove the configure - option --with-external-ffmpeg. - *********************************************************************]) +********************************************************************* +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. + +If you would like to use the internal ffmpeg, please remove the +configure option --with-external-ffmpeg. +*********************************************************************]) fi else dnl check specified flags CPPFLAGS="${FFMPEG_CPPFLAGS} ${ac_save_CPPFLAGS}" LDFLAGS="${FFMPEG_LIBS} ${ac_save_LDFLAGS}" AC_LINK_IFELSE([#include <avcodec.h> - #include <postprocess.h> - - int main() { - register_avcodec((void *)0); - pp_get_context(0, 0, 0); - } - ], +#include <postprocess.h> + +int main() { + register_avcodec((void *)0); + pp_get_context(0, 0, 0); +} +], [external_ffmpeg_found=yes], [external_ffmpeg_found=no], ) - + dnl result if test x"$external_ffmpeg_found" = "xyes"; then - AC_MSG_RESULT([Using custom FFMPEG_CPPFLAGS and FFMPEG_LIBS for external ffmpeg]) + AC_MSG_RESULT([Using custom FFMPEG_CPPFLAGS and FFMPEG_LIBS for external ffmpeg.]) else AC_MSG_ERROR([External ffmpeg library not found with specified options. - ********************************************************************* - You can try to specify prefix of ffmpeg library by the option - --with-external-ffmpeg=prefix, or to specify different FFMPEG_CPPFLAGS and - FFMPEG_LIBS. - - If you would like to use the internal ffmpeg, please remove the configure - option --with-external-ffmpeg. - *********************************************************************]) +********************************************************************* +You can try to specify prefix of ffmpeg library by the option +--with-external-ffmpeg=prefix, or to specify different +FFMPEG_CPPFLAGS and FFMPEG_LIBS. + +If you would like to use the internal ffmpeg, please remove the +configure option --with-external-ffmpeg. +*********************************************************************]) fi fi CPPFLAGS="${ac_save_CPPFLAGS}" @@ -132,15 +132,25 @@ if test x"$external_ffmpeg" != "xno"; then else if test x"${FFMPEG_CPPFLAGS}" = "x" -a x"${FFMPEG_LIBS}" = "x"; then external_ffmpeg_found=no - AC_MSG_ERROR([You should specify FFMPEG_CPPFLAGS and FFMPEG_LIBS]) + AC_MSG_ERROR([You should specify FFMPEG_CPPFLAGS and FFMPEG_LIBS.]) else external_ffmpeg_found=yes AC_MSG_RESULT([Forced using custom FFMPEG_CPPFLAGS and FFMPEG_LIBS.]) fi fi - + + dnl result if test x"$external_ffmpeg_found" = "xyes"; then + dnl common warning + AC_MSG_NOTICE([ +********************************************************************* +xine is configured with external ffmpeg. + +This requires the same version of ffmpeg what is included in xine and +you should know what you do. If some problems occur, please try to +use internal ffmpeg. +*********************************************************************]) ifelse([$1], , :, [$1]) else ifelse([$2], , :, [$2]) |