[Spice-devel,2/2] build-sys: Require GLIB 2.28

Submitted by Pavel Grunt on Dec. 5, 2016, 8:10 a.m.

Details

Message ID 20161205081048.19388-2-pgrunt@redhat.com
State Accepted
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Pavel Grunt Dec. 5, 2016, 8:10 a.m.
We are already using it.

Also add support for generating deprecation warnings for the usage
of possibly unavailable functions.
---
 configure.ac | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/configure.ac b/configure.ac
index 4fa4c836..af271e46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,11 +148,15 @@  SPICE_PROTOCOL_MIN_VER=0.12.12
 PKG_CHECK_MODULES([SPICE_PROTOCOL], [spice-protocol >= $SPICE_PROTOCOL_MIN_VER])
 AC_SUBST([SPICE_PROTOCOL_MIN_VER])
 
-PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= 2.22 gio-2.0 >= 2.22])
-AS_VAR_APPEND([SPICE_REQUIRES], [" glib-2.0 >= 2.22 gio-2.0 >= 2.22"])
-
-PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0 >= 2.22])
-AS_VAR_APPEND([SPICE_REQUIRES], [" gobject-2.0 >= 2.22"])
+GLIB2_REQUIRED="2.28"
+GLIB2_ENCODED_VERSION="GLIB_VERSION_2_28"
+PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >= $GLIB2_REQUIRED])
+GLIB2_CFLAGS="$GLIB2_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=$GLIB2_ENCODED_VERSION \
+  -DGLIB_VERSION_MAX_ALLOWED=$GLIB2_ENCODED_VERSION"
+AS_VAR_APPEND([SPICE_REQUIRES], [" glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >= $GLIB2_REQUIRED"])
+
+PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0 >= $GLIB2_REQUIRED])
+AS_VAR_APPEND([SPICE_REQUIRES], [" gobject-2.0 >= $GLIB2_REQUIRED"])
 
 PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.17.7)
 AC_SUBST(PIXMAN_CFLAGS)

Comments

> 
> We are already using it.
> 
> Also add support for generating deprecation warnings for the usage
> of possibly unavailable functions.
> ---
>  configure.ac | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 4fa4c836..af271e46 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -148,11 +148,15 @@ SPICE_PROTOCOL_MIN_VER=0.12.12
>  PKG_CHECK_MODULES([SPICE_PROTOCOL], [spice-protocol >=
>  $SPICE_PROTOCOL_MIN_VER])
>  AC_SUBST([SPICE_PROTOCOL_MIN_VER])
>  
> -PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= 2.22 gio-2.0 >= 2.22])
> -AS_VAR_APPEND([SPICE_REQUIRES], [" glib-2.0 >= 2.22 gio-2.0 >= 2.22"])
> -
> -PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0 >= 2.22])
> -AS_VAR_APPEND([SPICE_REQUIRES], [" gobject-2.0 >= 2.22"])
> +GLIB2_REQUIRED="2.28"
> +GLIB2_ENCODED_VERSION="GLIB_VERSION_2_28"
> +PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >=
> $GLIB2_REQUIRED])
> +GLIB2_CFLAGS="$GLIB2_CFLAGS
> -DGLIB_VERSION_MIN_REQUIRED=$GLIB2_ENCODED_VERSION \
> +  -DGLIB_VERSION_MAX_ALLOWED=$GLIB2_ENCODED_VERSION"
> +AS_VAR_APPEND([SPICE_REQUIRES], [" glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >=
> $GLIB2_REQUIRED"])
> +
> +PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0 >= $GLIB2_REQUIRED])
> +AS_VAR_APPEND([SPICE_REQUIRES], [" gobject-2.0 >= $GLIB2_REQUIRED"])
>  
>  PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.17.7)
>  AC_SUBST(PIXMAN_CFLAGS)

I can confirm this works also with RHEL 6.

Reviewed-by: Frediano Ziglio <fziglio@redhat.com>

Frediano
On Mon, Dec 05, 2016 at 09:10:48AM +0100, Pavel Grunt wrote:
> We are already using it.
> 
> Also add support for generating deprecation warnings for the usage
> of possibly unavailable functions.

Fwiw, I would have split this in 2 patches, the "also" is a strong hint
;)

Christophe

> ---
>  configure.ac | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 4fa4c836..af271e46 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -148,11 +148,15 @@ SPICE_PROTOCOL_MIN_VER=0.12.12
>  PKG_CHECK_MODULES([SPICE_PROTOCOL], [spice-protocol >= $SPICE_PROTOCOL_MIN_VER])
>  AC_SUBST([SPICE_PROTOCOL_MIN_VER])
>  
> -PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= 2.22 gio-2.0 >= 2.22])
> -AS_VAR_APPEND([SPICE_REQUIRES], [" glib-2.0 >= 2.22 gio-2.0 >= 2.22"])
> -
> -PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0 >= 2.22])
> -AS_VAR_APPEND([SPICE_REQUIRES], [" gobject-2.0 >= 2.22"])
> +GLIB2_REQUIRED="2.28"
> +GLIB2_ENCODED_VERSION="GLIB_VERSION_2_28"
> +PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >= $GLIB2_REQUIRED])
> +GLIB2_CFLAGS="$GLIB2_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=$GLIB2_ENCODED_VERSION \
> +  -DGLIB_VERSION_MAX_ALLOWED=$GLIB2_ENCODED_VERSION"
> +AS_VAR_APPEND([SPICE_REQUIRES], [" glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >= $GLIB2_REQUIRED"])
> +
> +PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0 >= $GLIB2_REQUIRED])
> +AS_VAR_APPEND([SPICE_REQUIRES], [" gobject-2.0 >= $GLIB2_REQUIRED"])
>  
>  PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.17.7)
>  AC_SUBST(PIXMAN_CFLAGS)
> -- 
> 2.11.0
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel