[Spice-devel] [PATCH spice-streaming-agent] Use pkg-config to find jpeg library if available

Christophe Fergeau cfergeau at redhat.com
Fri Apr 6 08:37:21 UTC 2018


With git diff -w this comes out as:

diff --git a/configure.ac b/configure.ac
index 958869f..699dc3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,7 @@ AC_SUBST([SPICE_PROTOCOL_MIN_VER])
 PKG_CHECK_MODULES(X11, x11)
 PKG_CHECK_MODULES(XFIXES, xfixes)

+PKG_CHECK_MODULES(JPEG, libjpeg, , [
     AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
         AC_MSG_CHECKING([for jpeglib.h])
         AC_TRY_CPP(
@@ -48,6 +49,7 @@ AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
             AC_MSG_RESULT($jpeg_ok),
         AC_MSG_ERROR([jpeglib.h not found])),
         AC_MSG_ERROR([libjpeg not found]))
+])
 AC_SUBST(JPEG_LIBS)

 dnl ===========================================================================

Acked-by: Christophe Fergeau <cfergeau at redhat.com>


On Fri, Apr 06, 2018 at 07:41:22AM +0100, Frediano Ziglio wrote:
> Newer libraries provide pkg-config module for libjpeg, attempt
> to use it, if not available fall back to manual checks.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  configure.ac | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 49b46f9..a75f22c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -36,18 +36,20 @@ AC_SUBST([SPICE_PROTOCOL_MIN_VER])
>  PKG_CHECK_MODULES(X11, x11)
>  PKG_CHECK_MODULES(XFIXES, xfixes)
>  
> -AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
> -    AC_MSG_CHECKING([for jpeglib.h])
> -    AC_TRY_CPP(
> +PKG_CHECK_MODULES(JPEG, libjpeg, , [
> +    AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
> +        AC_MSG_CHECKING([for jpeglib.h])
> +        AC_TRY_CPP(
>  [#include <stdio.h>
>  #undef PACKAGE
>  #undef VERSION
>  #undef HAVE_STDLIB_H
>  #include <jpeglib.h>],
> -        JPEG_LIBS='-ljpeg'
> -        AC_MSG_RESULT($jpeg_ok),
> -    AC_MSG_ERROR([jpeglib.h not found])),
> -    AC_MSG_ERROR([libjpeg not found]))
> +            JPEG_LIBS='-ljpeg'
> +            AC_MSG_RESULT($jpeg_ok),
> +        AC_MSG_ERROR([jpeglib.h not found])),
> +        AC_MSG_ERROR([libjpeg not found]))
> +])
>  AC_SUBST(JPEG_LIBS)
>  
>  AC_ARG_WITH(udevrulesdir,
> -- 
> 2.14.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180406/95da5355/attachment.sig>


More information about the Spice-devel mailing list