gucharmap r1955 - in trunk: . gucharmap



Author: chpe
Date: Wed Nov 19 14:33:57 2008
New Revision: 1955
URL: http://svn.gnome.org/viewvc/gucharmap?rev=1955&view=rev

Log:
Add GObject introspection for libgucharmap. Use --enable-introspection
to build.

Modified:
   trunk/configure.ac
   trunk/gucharmap/Makefile.am

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Wed Nov 19 14:33:57 2008
@@ -152,9 +152,9 @@
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gucharmap gettext domain])
 AM_GLIB_GNU_GETTEXT
 
-# ********
-# Bindings
-# ********
+# ***************
+# Python Bindings
+# ***************
 
 AC_MSG_CHECKING([whether python bindings are requested])
 AC_ARG_ENABLE([python-bindings],
@@ -219,6 +219,34 @@
 
 AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS],[test "$enable_python_bindings" = "yes"])
 
+# ***
+# GIR 
+# ***
+
+AC_MSG_CHECKING([whether GObject introspection is requested])
+AC_ARG_ENABLE([introspection],
+        AS_HELP_STRING([--enable-introspection],[Enable GObject introspection]),
+        [],[enable_introspection=no])
+AC_MSG_RESULT([$enable_introspection])
+
+if test "$enable_introspection" = "yes"; then
+  GOBJECT_INTROSPECTION_REQUIRED=0.6
+  PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
+
+  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)"
+  GIRTYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+  AC_SUBST([G_IR_SCANNER])
+  AC_SUBST([G_IR_COMPILER])
+  AC_SUBST([G_IR_GENERATE])
+  AC_SUBST([GIRDIR])
+  AC_SUBST([GIRTYPELIBDIR])
+fi
+
+AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
+
 # ***************
 # API & User Docs
 # ***************

Modified: trunk/gucharmap/Makefile.am
==============================================================================
--- trunk/gucharmap/Makefile.am	(original)
+++ trunk/gucharmap/Makefile.am	Wed Nov 19 14:33:57 2008
@@ -200,7 +200,33 @@
 # 	&& (cmp -s xgen-$(@F) $@ || cp -f xgen-$(@F) $@) \
 # 	&& rm -f xgen-$(@F)
 
-# don't do the symlink stuff if this is windows
+if ENABLE_INTROSPECTION
+
+girdir = $(GIRDIR)
+gir_DATA = Gucharmap-2.0.gir
+
+typelibdir = $(GIRTYPELIBDIR)
+typelib_DATA = Gucharmap-2.0.typelib
+
+Gucharmap-2.0.gir: $(G_IR_SCANNER) libgucharmap.la $(libgucharmapinclude_HEADERS) Makefile
+	$(G_IR_SCANNER) \
+		--verbose \
+		--namespace=Gucharmap \
+		--nsversion=2.0 \
+		--include=GObject-2.0 \
+		--include=Gtk-2.0 \
+		--library=gucharmap \
+		--output $@ \
+		--pkg gtk+-2.0 \
+		-I$(top_srcdir) \
+		-I$(top_builddir) \
+		-DGUCHARMAP_COMPILATION \
+		$(filter %.h,$^)
+
+%.typelib: %.gir $(G_IR_COMPILER)
+	$(G_IR_COMPILER) --includedir=$(srcdir) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $@
+
+endif # ENABLE_INTROSPECTION
 
 EXTRA_DIST = \
 	gucharmap-marshal.list \
@@ -212,8 +238,11 @@
 CLEANFILES = \
 	stamp-gucharmap-type-builtins.h \
 	$(BUILT_SOURCES) \
+	$(gir_DATA) \
+	$(typelib_DATA) \
 	$(NULL)
 
+# don't do the symlink stuff if this is windows
 if !OS_WIN32
 # install a symlink to the binary called "charmap"
 install-exec-hook:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]