summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2014-01-17 16:11:33 +0000
committerDaniel P. Berrange <berrange@redhat.com>2014-01-17 16:11:33 +0000
commit20a2920320aad02abfd0d4ca1b13f55c7d98ee68 (patch)
treebb2214811d69f5d0e4c8c5b11aaa23f269b2041b
parente5f91096d9a16ae0152c73341362ab206a5187ba (diff)
downloadlibosinfo-20a2920320aad02abfd0d4ca1b13f55c7d98ee68.tar.gz
Switch to using the upstream m4 macros for GObject-introspection
integration. https://fedorahosted.org/libosinfo/ticket/11
-rw-r--r--configure.ac25
-rw-r--r--osinfo/Makefile.am52
2 files changed, 20 insertions, 57 deletions
diff --git a/configure.ac b/configure.ac
index aed1029..821be83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,30 +99,7 @@ esac
AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
-AC_ARG_ENABLE([introspection],
- AS_HELP_STRING([--enable-introspection], [enable GObject introspection]),
- [], [enable_introspection=check])
-
-if test "x$enable_introspection" != "xno" ; then
- PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
- [gobject-introspection-1.0 >= 0.9.0],
- [enable_introspection=yes],
- [
- if test "x$enable_introspection" = "xcheck"; then
- enable_introspection=no
- else
- AC_MSG_ERROR([gobject-introspection is not available])
- fi
- ])
- if test "x$enable_introspection" = "xyes" ; then
- AC_DEFINE([WITH_GOBJECT_INTROSPECTION], [1], [enable GObject introspection support])
- AC_SUBST(GOBJECT_INTROSPECTION_CFLAGS)
- AC_SUBST(GOBJECT_INTROSPECTION_LIBS)
- AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
- AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
- fi
-fi
-AM_CONDITIONAL([WITH_GOBJECT_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
+GOBJECT_INTROSPECTION_CHECK([0.9.7])
AC_ARG_ENABLE([vala],
AS_HELP_STRING([--enable-vala], [enable Vala binding generation]),
diff --git a/osinfo/Makefile.am b/osinfo/Makefile.am
index e767cc4..21c69e4 100644
--- a/osinfo/Makefile.am
+++ b/osinfo/Makefile.am
@@ -169,42 +169,28 @@ EXTRA_DIST += check-symfile.pl check-symsorting.pl
check-local: check-symfile check-symsorting
-if WITH_GOBJECT_INTROSPECTION
-
-Libosinfo-1.0.gir: libosinfo-1.0.la $(G_IR_SCANNER) Makefile.am
- $(AM_V_GEN)$(G_IR_SCANNER) --quiet \
- --namespace Libosinfo \
- --nsversion 1.0 \
- --include GObject-2.0 \
- --include Gio-2.0 \
- --include libxml2-2.0 \
- --c-include="osinfo/osinfo.h" \
- --pkg-export=libosinfo-1.0 \
- --identifier-prefix=Osinfo \
- --symbol-prefix=osinfo \
- --library=$(builddir)/libosinfo-1.0.la \
- --output $@ \
- -I$(top_srcdir) \
- -I$(srcdir) \
- --verbose \
- --pkg=gobject-2.0 \
- --pkg=gio-2.0 \
- --pkg=libxml-2.0 \
- --pkg=libxslt \
- $(libosinfo_1_0_include_HEADERS:%=$(srcdir)/%) \
- $(libosinfo_1_0_la_SOURCES:%=$(srcdir)/%)
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+CLEANFILES =
+
+if HAVE_INTROSPECTION
+Libosinfo-1.0.gir: libosinfo-1.0.la
+Libosinfo_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0 libxml2-2.0
+Libosinfo_1_0_gir_PACKAGES = gobject-2.0 gio-2.0 libxml-2.0 libxslt
+Libosinfo_1_0_gir_EXPORT_PACKAGES = libosinfo-1.0
+Libosinfo_1_0_gir_LIBS = libosinfo-1.0.la
+Libosinfo_1_0_gir_FILES = $(libosinfo_1_0_include_HEADERS) $(libosinfo_1_0_la_SOURCES)
+Libosinfo_1_0_gir_CFLAGS = $(libosinfo_1_0_la_CFLAGS)
+Libosinfo_1_0_gir_SCANNERFLAGS = --identifier-prefix=Osinfo --symbol-prefix=osinfo --c-include="osinfo/osinfo.h"
+INTROSPECTION_GIRS += Libosinfo-1.0.gir
girdir = $(datadir)/gir-1.0
gir_DATA = Libosinfo-1.0.gir
-typelibsdir = $(libdir)/girepository-1.0
-typelibs_DATA = Libosinfo-1.0.typelib
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = Libosinfo-1.0.typelib
-%.typelib: %.gir
- $(AM_V_GEN)$(G_IR_COMPILER) \
- --includedir=$(builddir) \
- --includedir=$(girdir) \
- -o $@ $<
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
if WITH_VALA
vapidir = $(datadir)/vala/vapi
@@ -220,6 +206,6 @@ libosinfo-1.0.vapi: Libosinfo-1.0.gir Libosinfo-1.0.typelib
endif # WITH_VALA
-CLEANFILES = $(gir_DATA) $(typelibs_DATA) $(vapi_DATA) $(wildcard *.gcno)
+CLEANFILES += $(gir_DATA) $(typelibs_DATA) $(vapi_DATA) $(wildcard *.gcno)
-endif # WITH_GOBJECT_INTROSPECTION
+endif # HAVE_INTROSPECTION