From 7319cf121b14692911a3aac620a5cfda99d8c387 Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Thu, 23 Dec 2010 11:51:02 +1100 Subject: [PATCH 2/2] Start on introspection support --- configure.ac | 2 ++ src/Makefile.am | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index 17b4093..2b6211b 100644 --- a/configure.ac +++ b/configure.ac @@ -41,6 +41,8 @@ AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +GOBJECT_INTROSPECTION_CHECK(0.9.5) + if type -p stow > /dev/null && test -d /usr/local/stow ; then AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***]) ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}" diff --git a/src/Makefile.am b/src/Makefile.am index d1606fa..6b0f177 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -283,6 +283,28 @@ include_HEADERS += \ endif +if HAVE_INTROSPECTION + +-include $(INTROSPECTION_MAKEFILE) +INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --add-include-path=$(top_builddir) +INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=$(top_builddir) + +INTROSPECTION_GIRS = Canberra-1.gir + +Canberra-1.gir: libcanberra.la +Canberra_1_gir_INCLUDES = +Canberra_1_gir_CFLAGS = --identifier-prefix=ca +Canberra_1_gir_LIBS = libcanberra.la +Canberra_1_gir_FILES = canberra.h + +girdir = $(datadir)/gir-1.0 +gir_DATA = Canberra-1.gir + +typelibdir = $(libdir)/girepository-1.0 +typelib_DATA = Canberra-1.typelib + +endif + if HAVE_GTK3 lib_LTLIBRARIES += \ @@ -319,6 +341,21 @@ install-exec-hook: rm -f libcanberra-gtk-module.so && \ $(LN_S) libcanberra-gtk3-module.so libcanberra-gtk-module.so ) +if HAVE_INTROSPECTION + +INTROSPECTION_GIRS += CanberraGtk3-1.gir + +CanberraGtk3-1.gir: libcanberra-gtk3.la +CanberraGtk3_1_gir_INCLUDES = Gtk-3.0 Gdk-3.0 Canberra-1 +CanberraGtk3_1_gir_CFLAGS = --identifier-prefix=ca_gtk +CanberraGtk3_1_gir_LIBS = libcanberra-gtk3.la +CanberraGtk3_1_gir_FILES = $(libcanberra_gtk3_la_SOURCES) + +gir_DATA += CanberraGtk3-1.gir +typelib_DATA += CanberraGtk3-1.typelib + +endif + endif if HAVE_GTK @@ -351,6 +388,21 @@ libcanberra_gtk_module_la_LIBADD = \ libcanberra_gtk_module_la_LDFLAGS = \ -avoid-version -module -export-dynamic +if HAVE_INTROSPECTION + +INTROSPECTION_GIRS += CanberraGtk-1.gir + +CanberraGtk-1.gir: libcanberra-gtk.la +CanberraGtk_1_gir_INCLUDES = Gtk-3.0 Gdk-3.0 Canberra-1 +CanberraGtk_1_gir_CFLAGS = --identifier-prefix=ca_gtk +CanberraGtk_1_gir_LIBS = libcanberra-gtk.la +CanberraGtk_1_gir_FILES = $(libcanberra_gtk_la_SOURCES) + +gir_DATA += CanberraGtk-1.gir +typelib_DATA += CanberraGtk-1.typelib + +endif + endif if HAVE_GTK3 -- 1.7.2.3