[Libosinfo] [PATCH v2 4/5] Use GLIB_VERSION_MAX_ALLOWED
Fabiano Fidêncio
fidencio at redhat.com
Thu Jan 7 17:54:40 UTC 2016
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])
+
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])
PKG_CHECK_MODULES([GIO], [gio-2.0])
-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.36])
PKG_CHECK_MODULES([SOUP], [libsoup-2.4 >= 2.42])
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"
+AC_SUBST(GLIB_CFLAGS)
+AC_SUBST(GLIB_LIBS)
+
GTK_DOC_CHECK([1.10],[--flavour no-tmpl])
AC_ARG_ENABLE([tests],
diff --git a/osinfo/Makefile.am b/osinfo/Makefile.am
index c07d362..c4f29a4 100644
--- a/osinfo/Makefile.am
+++ b/osinfo/Makefile.am
@@ -34,6 +34,7 @@ libosinfo_1_0_la_CFLAGS = \
$(LIBXML_CFLAGS) \
$(LIBXSLT_CFLAGS) \
$(GOBJECT_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
-DPKG_DATA_DIR='"$(pkgdatadir)"' \
-DSYS_CONF_DIR='"$(sysconfdir)"' \
@@ -44,6 +45,7 @@ libosinfo_1_0_la_LIBADD = \
$(LIBXML_LIBS) \
$(LIBXSLT_LIBS) \
$(GOBJECT_LIBS) \
+ $(GLIB_LIBS) \
$(GIO_LIBS)
libosinfo_1_0_la_LDFLAGS = \
diff --git a/test/Makefile.am b/test/Makefile.am
index ef63154..d6504fd 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -23,6 +23,7 @@ check_PROGRAMS = \
COMMON_LDADD = \
$(COVERAGE_LDFLAGS) \
+ $(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(SOUP_LIBS) \
$(CHECK_LIBS) \
@@ -30,6 +31,7 @@ COMMON_LDADD = \
COMMON_CFLAGS = \
$(WARN_CFLAGS) \
$(COVERAGE_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(GOBJECT_CFLAGS) \
$(SOUP_CFLAGS) \
-I$(top_srcdir) \
diff --git a/tools/Makefile.am b/tools/Makefile.am
index a064dce..7f7249f 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,5 +1,6 @@
AM_CFLAGS = $(GOBJECT_CFLAGS) \
$(GIO_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(LIBXML_CFLAGS) \
-DPKGDATADIR="\"$(pkgdatadir)\"" \
-DLOCALEDIR="\"$(datadir)/locale\"" \
@@ -21,22 +22,26 @@ POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
osinfo_detect_SOURCES = osinfo-detect.c
osinfo_detect_LDADD = $(GOBJECT_LIBS) \
$(GIO_LIBS) \
+ $(GLIB_LIBS) \
$(LIBXML_LIBS) \
$(top_builddir)/osinfo/libosinfo-1.0.la
osinfo_db_validate_SOURCES = osinfo-db-validate.c
osinfo_db_validate_LDADD = $(GOBJECT_LIBS) \
$(GIO_LIBS) \
+ $(GLIB_LIBS) \
$(LIBXML_LIBS) \
$(top_builddir)/osinfo/libosinfo-1.0.la
osinfo_query_SOURCES = osinfo-query.c
osinfo_query_LDADD = $(GOBJECT_LIBS) \
$(GIO_LIBS) \
+ $(GLIB_LIBS) \
$(top_builddir)/osinfo/libosinfo-1.0.la
osinfo_install_script_SOURCES = osinfo-install-script.c
osinfo_install_script_LDADD = $(GOBJECT_LIBS) \
$(GIO_LIBS) \
+ $(GLIB_LIBS) \
$(LIBXML_LIBS) \
$(top_builddir)/osinfo/libosinfo-1.0.la
--
2.5.0
More information about the Libosinfo
mailing list