[Spice-devel,1/3] build-sys: Use variable instead of number

Submitted by Pavel Grunt on Dec. 5, 2016, 2:49 p.m.

Details

Message ID 20161205144949.9592-1-pgrunt@redhat.com
State Accepted
Commit 60e702fe139510f26463798c4a3ece712f71a581
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, 2:49 p.m.
---
 configure.ac | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/configure.ac b/configure.ac
index 4fa4c836..cd78f08f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,23 +148,27 @@  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"])
+GLIB2_REQUIRED=2.22
+PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >= $GLIB2_REQUIRED])
+AS_VAR_APPEND([SPICE_REQUIRES], [" glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >= $GLIB2_REQUIRED"])
 
-PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0 >= 2.22])
-AS_VAR_APPEND([SPICE_REQUIRES], [" gobject-2.0 >= 2.22"])
+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)
+PIXMAN_REQUIRED=0.17.7
+PKG_CHECK_MODULES(PIXMAN, pixman-1 >= $PIXMAN_REQUIRED)
 AC_SUBST(PIXMAN_CFLAGS)
 AC_SUBST(PIXMAN_LIBS)
-AS_VAR_APPEND([SPICE_REQUIRES], [" pixman-1 >= 0.17.7"])
+AS_VAR_APPEND([SPICE_REQUIRES], [" pixman-1 >= $PIXMAN_REQUIRED"])
 
 AC_ARG_ENABLE([celt051],
               AS_HELP_STRING([--disable-celt051], [Disable celt051 audio codec (enabled by default)]),,
               [enable_celt051="yes"])
 
 if test "x$enable_celt051" = "xyes"; then
-    PKG_CHECK_MODULES(CELT051, celt051 >= 0.5.1.1, AS_VAR_APPEND([SPICE_REQUIRES], [" celt051 >= 0.5.1.1"]))
+    CELT051_REQUIRED=0.5.1.1
+    PKG_CHECK_MODULES(CELT051, celt051 >= $CELT051_REQUIRED,
+                      AS_VAR_APPEND([SPICE_REQUIRES], [" celt051 >= $CELT051_REQUIRED"]))
 fi
 
 PKG_CHECK_MODULES(SSL, openssl)

Comments

----- Original Message -----
> From: "Pavel Grunt" <pgrunt@redhat.com>
> To: spice-devel@lists.freedesktop.org
> Sent: Monday, December 5, 2016 2:49:47 PM
> Subject: [Spice-devel] [PATCH spice 1/3] build-sys: Use variable instead of	number
> 

Patch looks good, I would just extend to:

"build-sys: Use variables instead of numbers for library versions

Allow to easily change library versions."

Frediano

> ---
>  configure.ac | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 4fa4c836..cd78f08f 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -148,23 +148,27 @@ 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"])
> +GLIB2_REQUIRED=2.22
> +PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >=
> $GLIB2_REQUIRED])
> +AS_VAR_APPEND([SPICE_REQUIRES], [" glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >=
> $GLIB2_REQUIRED"])
>  
> -PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0 >= 2.22])
> -AS_VAR_APPEND([SPICE_REQUIRES], [" gobject-2.0 >= 2.22"])
> +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)
> +PIXMAN_REQUIRED=0.17.7
> +PKG_CHECK_MODULES(PIXMAN, pixman-1 >= $PIXMAN_REQUIRED)
>  AC_SUBST(PIXMAN_CFLAGS)
>  AC_SUBST(PIXMAN_LIBS)
> -AS_VAR_APPEND([SPICE_REQUIRES], [" pixman-1 >= 0.17.7"])
> +AS_VAR_APPEND([SPICE_REQUIRES], [" pixman-1 >= $PIXMAN_REQUIRED"])
>  
>  AC_ARG_ENABLE([celt051],
>                AS_HELP_STRING([--disable-celt051], [Disable celt051 audio
>                codec (enabled by default)]),,
>                [enable_celt051="yes"])
>  
>  if test "x$enable_celt051" = "xyes"; then
> -    PKG_CHECK_MODULES(CELT051, celt051 >= 0.5.1.1,
> AS_VAR_APPEND([SPICE_REQUIRES], [" celt051 >= 0.5.1.1"]))
> +    CELT051_REQUIRED=0.5.1.1
> +    PKG_CHECK_MODULES(CELT051, celt051 >= $CELT051_REQUIRED,
> +                      AS_VAR_APPEND([SPICE_REQUIRES], [" celt051 >=
> $CELT051_REQUIRED"]))
>  fi
>  
>  PKG_CHECK_MODULES(SSL, openssl)

Frediano
On Tue, 2016-12-06 at 07:48 -0500, Frediano Ziglio wrote:
> 
> ----- Original Message -----
> > From: "Pavel Grunt" <pgrunt@redhat.com>
> > To: spice-devel@lists.freedesktop.org
> > Sent: Monday, December 5, 2016 2:49:47 PM
> > Subject: [Spice-devel] [PATCH spice 1/3] build-sys: Use variable
> > instead of	number
> > 
> 
> Patch looks good, I would just extend to:
> 
> "build-sys: Use variables instead of numbers for library versions
> 
> Allow to easily change library versions."

Yes, it is better

Pavel

> 
> Frediano
> 
> > ---
> >  configure.ac | 18 +++++++++++-------
> >  1 file changed, 11 insertions(+), 7 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 4fa4c836..cd78f08f 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -148,23 +148,27 @@ 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"])
> > +GLIB2_REQUIRED=2.22
> > +PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= $GLIB2_REQUIRED gio-2.0
> > >=
> > $GLIB2_REQUIRED])
> > +AS_VAR_APPEND([SPICE_REQUIRES], [" glib-2.0 >= $GLIB2_REQUIRED
> > gio-2.0 >=
> > $GLIB2_REQUIRED"])
> >  
> > -PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0 >= 2.22])
> > -AS_VAR_APPEND([SPICE_REQUIRES], [" gobject-2.0 >= 2.22"])
> > +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)
> > +PIXMAN_REQUIRED=0.17.7
> > +PKG_CHECK_MODULES(PIXMAN, pixman-1 >= $PIXMAN_REQUIRED)
> >  AC_SUBST(PIXMAN_CFLAGS)
> >  AC_SUBST(PIXMAN_LIBS)
> > -AS_VAR_APPEND([SPICE_REQUIRES], [" pixman-1 >= 0.17.7"])
> > +AS_VAR_APPEND([SPICE_REQUIRES], [" pixman-1 >=
> > $PIXMAN_REQUIRED"])
> >  
> >  AC_ARG_ENABLE([celt051],
> >                AS_HELP_STRING([--disable-celt051], [Disable
> > celt051 audio
> >                codec (enabled by default)]),,
> >                [enable_celt051="yes"])
> >  
> >  if test "x$enable_celt051" = "xyes"; then
> > -    PKG_CHECK_MODULES(CELT051, celt051 >= 0.5.1.1,
> > AS_VAR_APPEND([SPICE_REQUIRES], [" celt051 >= 0.5.1.1"]))
> > +    CELT051_REQUIRED=0.5.1.1
> > +    PKG_CHECK_MODULES(CELT051, celt051 >= $CELT051_REQUIRED,
> > +                      AS_VAR_APPEND([SPICE_REQUIRES], [" celt051
> > >=
> > $CELT051_REQUIRED"]))
> >  fi
> >  
> >  PKG_CHECK_MODULES(SSL, openssl)
> 
> Frediano