[Libosinfo] [PATCH v2 4/5] Use GLIB_VERSION_MAX_ALLOWED
Christophe Fergeau
cfergeau at redhat.com
Fri Jan 8 09:44:27 UTC 2016
On Thu, Jan 07, 2016 at 06:54:40PM +0100, Fabiano Fidêncio wrote:
> In order to avoid using a too new GLib API.
> ---
> configure.ac | 11 ++++++++++-
> osinfo/Makefile.am | 2 ++
> test/Makefile.am | 2 ++
> tools/Makefile.am | 5 +++++
> 4 files changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index ff3eed3..c280b2a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -36,13 +36,22 @@ m4_if(m4_version_compare([2.61a.100],
> # Use the silent-rules feature when possible.
> m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
>
> +# Keep these two definitions in agreement.
> +m4_define([glib_minimum_version], [2.36])
> +m4_define([glib_encoded_version], [GLIB_VERSION_2_36])
Why use m4_define rather than the more usual
diff --git a/configure.ac b/configure.ac
index 6d6cdd4..a307b68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,8 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
# Keep these two definitions in agreement.
m4_define([glib_minimum_version], [2.36])
m4_define([glib_encoded_version], [GLIB_VERSION_2_36])
+GLIB_MINIMUM_VERSION="2.36"
+GLIB_ENCODED_VERSION="GLIB_VERSION_2_36"
# Keep these two definitions in agreement.
m4_define([soup_minimum_version], [2.42])
@@ -49,9 +51,9 @@ PKG_CHECK_MODULES([GIO], [gio-2.0])
PKG_CHECK_MODULES([LIBXML], [libxml-2.0 >= 2.6.0])
PKG_CHECK_MODULES([LIBXSLT], [libxslt >= 1.0.0])
-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= glib_minimum_version])
-GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=glib_encoded_version"
-GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MAX_ALLOWED=glib_encoded_version"
+PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $GLIB_MINIMUM_VERSION])
+GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=$GLIB_ENCODED_VERSION"
+GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MAX_ALLOWED=$GLIB_ENCODED_VERSION"
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
This seems to be working just as well.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20160108/7bf3c8d3/attachment.sig>
More information about the Libosinfo
mailing list