From: gballintijn Date: Mon, 15 Sep 2008 11:34:34 +0000 (+0000) Subject: Fix 2108984: configure doesn't use pkg-config to find libswscale. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=8cb672e948624db0c4a2a38dd947c8e82f3e8492;p=synfig.git Fix 2108984: configure doesn't use pkg-config to find libswscale. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2057 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/configure.ac b/synfig-core/trunk/configure.ac index 0d2c62e..a6bb3c4 100644 --- a/synfig-core/trunk/configure.ac +++ b/synfig-core/trunk/configure.ac @@ -255,23 +255,20 @@ if test $with_libavcodec = "yes" ; then { ) if test $with_libswscale != "no" ; then { - AC_CHECK_LIB(swscale, sws_getContext, [], [echo no; with_libswscale="no"], []) + PKG_CHECK_MODULES(LIBSWSCALE, [libswscale], [], [echo no; with_libswscale="no"]) } ; fi if test $with_libswscale = "yes" ; then { - LIBAVCODEC_LIBS="$LIBAVCODEC_LIBS -lswscale" - AM_CONDITIONAL(HAVE_LIBSWSCALE, true) + AC_DEFINE(WITH_LIBSWSCALE, [], [enable libswscale support]) } else { - AM_CONDITIONAL(HAVE_LIBSWSCALE, false) AC_CHECK_LIB(avcodec, img_convert, [AC_MSG_RESULT([ *** Using deprecated function img_convert.])], [AC_MSG_FAILURE([Neither libswscale nor function img_convert was found.])], [] ) } ; fi -} else { - AM_CONDITIONAL(HAVE_LIBSWSCALE, false) } ; fi +AM_CONDITIONAL(WITH_LIBSWSCALE, test "x$with_libswscale" = "xyes") # FREETYPE2 CHECK-------------------- diff --git a/synfig-core/trunk/src/modules/mod_libavcodec/Makefile.am b/synfig-core/trunk/src/modules/mod_libavcodec/Makefile.am index 0eab257..193e321 100644 --- a/synfig-core/trunk/src/modules/mod_libavcodec/Makefile.am +++ b/synfig-core/trunk/src/modules/mod_libavcodec/Makefile.am @@ -10,8 +10,8 @@ if WITH_LIBAVCODEC module_LTLIBRARIES = libmod_libavcodec.la libmod_libavcodec_la_SOURCES = main.cpp trgt_av.cpp trgt_av.h mptr.cpp mptr.h libmod_libavcodec_la_LDFLAGS = -module -no-undefined -avoid-version -libmod_libavcodec_la_CXXFLAGS = @SYNFIG_CFLAGS@ @LIBAVCODEC_CFLAGS@ -D__STDC_CONSTANT_MACROS -libmod_libavcodec_la_LIBADD = ../../synfig/libsynfig.la @SYNFIG_LIBS@ @LIBAVCODEC_LIBS@ +libmod_libavcodec_la_CXXFLAGS = @SYNFIG_CFLAGS@ @LIBAVCODEC_CFLAGS@ @LIBSWSCALE_CFLAGS@ -D__STDC_CONSTANT_MACROS +libmod_libavcodec_la_LIBADD = ../../synfig/libsynfig.la @SYNFIG_LIBS@ @LIBAVCODEC_LIBS@ @LIBSWSCALE_LIBS@ else endif EXTRA_DIST= mod_libavcodec.nsh unmod_libavcodec.nsh diff --git a/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp b/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp index e067761..4584409 100644 --- a/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp +++ b/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp @@ -36,8 +36,8 @@ extern "C" { #include -#ifdef HAVE_LIBSWSCALE -# include +#ifdef WITH_LIBSWSCALE +# include #endif } @@ -392,7 +392,7 @@ public: if ( pict && context->pix_fmt != PIX_FMT_RGB24 ) { //We're using RGBA at the moment, write custom conversion code later (get less accuracy errors) -#ifdef HAVE_LIBSWSCALE +#ifdef WITH_LIBSWSCALE struct SwsContext* img_convert_ctx = sws_getContext(context->width, context->height, PIX_FMT_RGB24, context->width, context->height, context->pix_fmt,