gst: Add gobject-introspection support
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 4 Sep 2009 18:56:43 +0000 (20:56 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 5 Sep 2009 08:28:46 +0000 (10:28 +0200)
Partially fixes bug #550616.

configure.ac
gst/.gitignore
gst/Makefile.am
gst/gst.c

index 2040d01..98acf84 100644 (file)
@@ -268,6 +268,9 @@ fi
 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
 
+dnl check for gobject-introspection
+GOBJECT_INTROSPECTION_CHECK([0.6.3])
+
 dnl check for documentation tools
 AG_GST_DOCBOOK_CHECK
 GTK_DOC_CHECK([1.3])
index 606da2b..25cd4c8 100644 (file)
@@ -18,3 +18,5 @@ gstconfig.h
 *.gcno
 *.gcov
 *.gcov.out
+*.gir
+*.typelib
index 91ae694..5945e00 100644 (file)
@@ -236,3 +236,44 @@ gstenumtypes.c: $(gst_headers)
        $(GCOV) -b -f -o $^ > $@.out
 
 gcov: $(libgstreamer_@GST_MAJORMINOR@_la_SOURCES:=.gcov)
+
+if HAVE_INTROSPECTION
+BUILT_GIRSOURCES = Gst-@GST_MAJORMINOR@.gir
+
+gir_headers=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_MAJORMINOR@include_HEADERS))
+gir_sources=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_MAJORMINOR@_la_SOURCES))
+
+Gst-@GST_MAJORMINOR@.gir: $(INTROSPECTION_SCANNER) libgstreamer-@GST_MAJORMINOR@.la
+       $(INTROSPECTION_SCANNER) -v --namespace Gst \
+               --nsversion=@GST_MAJORMINOR@ \
+               -I$(top_srcdir) \
+               --c-include='gst/gst.h' \
+               --library=gstreamer-0.10 \
+               --include=GLib-2.0 \
+               --include=GObject-2.0 \
+               --include=GModule-2.0 \
+               --include=libxml2-2.0 \
+               --libtool="$(top_builddir)/libtool" \
+               --pkg glib-2.0 \
+               --pkg gobject-2.0 \
+               --pkg gmodule-no-export-2.0 \
+               --pkg gthread-2.0 \
+               --pkg libxml-2.0 \
+               --output $@ \
+               $(gir_headers) \
+               $(gir_sources)
+
+# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
+# install anything - we need to install inside our prefix.
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(BUILT_GIRSOURCES)
+
+typelibsdir = $(libdir)/girepository-1.0/
+
+typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+
+%.typelib: %.gir $(INTROSPECTION_COMPILER)
+       $(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=$(builddir) $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+endif
index 8905803..95ec1e5 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -468,8 +468,8 @@ gst_init_check (int *argc, char **argv[], GError ** err)
 
 /**
  * gst_init:
- * @argc: pointer to application's argc
- * @argv: pointer to application's argv
+ * @argc: (inout): pointer to application's argc
+ * @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
  *
  * Initializes the GStreamer library, setting up internal path lists,
  * registering built-in elements, and loading standard plugins.