diff --git a/configure.in b/configure.in
index c8b7b2f..ac428a4 100644
--- a/configure.in
+++ b/configure.in
@@ -602,6 +602,29 @@ AC_SUBST(EXTRA_LIBS)
 AC_SUBST(EXTRA_INCLUDES)
 AC_SUBST(EXTRA_DEPS)
 
+# GObject Introspection
+have_introspection=false
+PKG_CHECK_MODULES(INTROSPECTION, gobject-introspection-1.0 >= 0.6.4, have_introspection=true, have_introspection=false)
+AM_CONDITIONAL(HAVE_INTROSPECTION, $have_introspection)
+
+G_IR_SCANNER=
+G_IR_COMPILER=
+G_IR_GENERATE=
+GIRDIR=
+TYPELIBDIR=
+if $have_introspection; then
+   G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+   G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+   G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+   GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+   TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+fi
+AC_SUBST(G_IR_SCANNER)
+AC_SUBST(G_IR_COMPILER)
+AC_SUBST(G_IR_GENERATE)
+AC_SUBST(GIRDIR)
+AC_SUBST(TYPELIBDIR)
+
 dnl ******************
 dnl * Config defaults
 dnl ******************
diff --git a/goffice/Makefile.am b/goffice/Makefile.am
index e8ada78..4df83db 100644
--- a/goffice/Makefile.am
+++ b/goffice/Makefile.am
@@ -129,3 +129,46 @@ embedded-stuff.c: $(top_srcdir)/tools/embedder $(embedded_stuff)
 		COMPRESS $(embedded_stuff_compress) \
 		NOCOMPRESS $(embedded_stuff_raw) \
 		>$(abs_builddir)/$@
+
+
+BUILT_GIRSOURCES = \
+	GOffice-@GOFFICE_API_VER@.gir
+
+GOffice-@GOFFICE_API_VER@.gir: list_of_sources
+GOffice-@GOFFICE_API_VER@.gir: libgoffice-@GOFFICE_API_VER@.la
+GOffice-@GOFFICE_API_VER@.gir: $(G_IR_SCANNER)
+	$(AM_V_GEN) $(G_IR_SCANNER) -v --namespace GOffice --warn-all \
+	    --nsversion="@GOFFICE_API_VER@" \
+	    --add-include-path=$(srcdir) --add-include-path=. \
+	    --include=GObject-2.0 \
+	    --include=Gio-2.0 \
+	    --include=libxml2-2.0 \
+	    --include=cairo-1.0 \
+	    --include=Pango-1.0 \
+	    --include=Gtk-3.0 \
+	    --include=Gsf-1 \
+	    --identifier-prefix="GO" \
+	    --identifier-prefix="Go" \
+	    --symbol-prefix="go" \
+	    --symbol-prefix="libgoffice" \
+	    --accept-unprefixed \
+	    --library=libgoffice-@GOFFICE_API_VER@.la \
+	    --libtool="$(LIBTOOL)" \
+	    --nsversion="@GOFFICE_API_VER@" \
+	    --output $@ \
+	    --pkg libgoffice-@GOFFICE_API_VER@ \
+	    -I$(top_srcdir) \
+	    `cat $(srcdir)/list_of_sources`
+
+if HAVE_INTROSPECTION
+
+girdir = $(GIRDIR)
+gir_DATA = $(BUILT_GIRSOURCES)
+
+typelibsdir = $(TYPELIBDIR)
+typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+
+%.typelib: %.gir $(G_IR_COMPILER)
+	$(AM_V_GEN) LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) --includedir=$(srcdir) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $(builddir)/$(@F)
+
+endif # HAVE_INTROSPECTION
diff --git a/goffice/app/go-plugin-loader-module.h b/goffice/app/go-plugin-loader-module.h
index 588aefb..9eace2e 100644
--- a/goffice/app/go-plugin-loader-module.h
+++ b/goffice/app/go-plugin-loader-module.h
@@ -13,14 +13,15 @@ G_BEGIN_DECLS
 #define GO_PLUGIN_LOADER_MODULE_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST ((k), GO_TYPE_PLUGIN_LOADER_MODULE, GOPluginLoaderModuleClass))
 #define GO_IS_PLUGIN_LOADER_MODULE_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), GO_TYPE_PLUGIN_LOADER_MODULE))
 
+typedef void (*GOPluginMethod) (GOPlugin *plugin, GOCmdContext *cc);
 typedef struct {
 	GObject	base;
 
 	gchar *module_file_name;
 	GModule *handle;
 
-	void (*plugin_init)	(GOPlugin *plugin, GOCmdContext *cc);
-	void (*plugin_shutdown) (GOPlugin *plugin, GOCmdContext *cc);
+	GOPluginMethod plugin_init;
+	GOPluginMethod plugin_shutdown;
 } GOPluginLoaderModule;
 typedef GObjectClass GOPluginLoaderModuleClass;
 
