]> www.fi.muni.cz Git - evince.git/commitdiff
Add experimental introspection support. Disabled by default; use
authorChristian Persch <chpe@src.gnome.org>
Sun, 8 Feb 2009 13:11:18 +0000 (13:11 +0000)
committerChristian Persch <chpe@src.gnome.org>
Sun, 8 Feb 2009 13:11:18 +0000 (13:11 +0000)
* configure.ac:
* libdocument/Makefile.am:
* libview/Makefile.am: Add experimental introspection support.
Disabled by default; use --enable-introspection to enable it.
Bug #569083.

svn path=/trunk/; revision=3422

ChangeLog
configure.ac
libdocument/Makefile.am
libview/Makefile.am

index f6a1829b6789a81353fc437f4f8da3c570577e6b..05cdf4142eff9b30b4cea8a90df7086e7eaffee2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-02-08  Christian Persch  <chpe@gnome.org>
+
+       * configure.ac:
+       * libdocument/Makefile.am:
+       * libview/Makefile.am: Add experimental introspection support.
+       Disabled by default; use --enable-introspection to enable it.
+       Bug #569083.
+
 2009-02-08  Christian Persch  <chpe@gnome.org>
 
        * libview/Makefile.am: Link libevdocument.la to libevview.la.
index e66b125137cda24dd8ed97a04054b56c83cc5142..435e0c0a8d43bd2afbcce04a0fb9d80b5576e28c 100644 (file)
@@ -267,6 +267,41 @@ if test "x$GCONFTOOL" = "xno"; then
        AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
 fi
 
+# ***
+# 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])
+
+G_IR_SCANNER=
+G_IR_COMPILER=
+G_IR_GENERATE=
+GIRDIR=
+GIRTYPELIBDIR=
+
+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)"
+fi
+
+AC_SUBST([G_IR_SCANNER])
+AC_SUBST([G_IR_COMPILER])
+AC_SUBST([G_IR_GENERATE])
+AC_SUBST([GIRDIR])
+AC_SUBST([GIRTYPELIBDIR])
+
+AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
+
 dnl ================== portability checks ===========================================
 
 dnl for backtrace()
@@ -574,6 +609,7 @@ Configure summary:
        Thumbnailer........:  $ENABLE_THUMBNAILER
        Gtk-Doc Support....:  $enable_gtk_doc
        Debug mode.........:  $enable_debug
+       GObj. Introspection:  $enable_introspection
 
        PDF Backend........:  $enable_pdf
        PostScript Backend.:  $enable_ps
index 6eab5854498386df3699aa64b498e1396760f000..ffbe19d431a7617a4e406bca03460b91750466c1 100644 (file)
@@ -119,3 +119,46 @@ ev-document-type-builtins.c: ev-document-type-builtins.c.template $(INST_H_FILES
 EXTRA_DIST = \
        ev-document-type-builtins.c.template \
        ev-document-type-builtins.h.template
+
+# GObject Introspection
+
+if ENABLE_INTROSPECTION
+
+EvDocument-$(EV_API_VERSION).gir: libevdocument.la Makefile $(INST_H_FILES)
+       PKG_CONFIG_PATH=$(top_builddir):$$PKG_CONFIG_PATH \
+       $(G_IR_SCANNER) -v --namespace EvDocument \
+       --add-include-path=$(srcdir) \
+       --add-include-path=. \
+       --strip-prefix=Ev \
+       --nsversion=$(EV_API_VERSION) \
+       --include=Gio-2.0 \
+       --include=Gtk-2.0 \
+       --library=evdocument \
+       --libtool="$(LIBTOOL)" \
+       --output $@ \
+       --pkg gobject-2.0 \
+       --pkg gio-2.0 \
+       --pkg gtk+-2.0 \
+       --pkg evince-document-$(EV_API_VERSION) \
+       -I$(top_srcdir) \
+       -I$(top_builddir) \
+       -DEVINCE_COMPILATION \
+       $(INST_H_FILES)
+
+girdir = $(GIRDIR)
+gir_DATA = EvDocument-$(EV_API_VERSION).gir
+
+typelibsdir = $(GIRTYPELIBDIR)
+typelibs_DATA = EvDocument-$(EV_API_VERSION).typelib
+
+EXTRA_DIST += $(gir_DATA)
+CLEANFILES += $(gir_DATA) $(typelibs_DATA)
+
+%.typelib: %.gir
+       LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) \
+       --includedir=$(srcdir) \
+       --includedir=. \
+       $(G_IR_COMPILER_OPTS) \
+       $< -o $@
+
+endif # ENABLE_INTROSPECTION
index d11818f4f74e3d29e973c5d294b1846f35dd9472..9da4927878fd7e129237852e5ff9d8b01128a3d9 100644 (file)
@@ -89,3 +89,50 @@ EXTRA_DIST = \
        ev-view-type-builtins.c.template  \
        ev-view-type-builtins.h.template  \
        ev-view-marshal.list
+
+# GObject Introspection
+
+if ENABLE_INTROSPECTION
+
+EvView-$(EV_API_VERSION).gir: libevview.la Makefile $(INST_H_FILES)
+       PKG_CONFIG_PATH=$(top_builddir):$$PKG_CONFIG_PATH \
+       $(G_IR_SCANNER) -v --namespace EvView \
+       --add-include-path=$(srcdir) \
+       --add-include-path=. \
+       --add-include-path=$(top_srcdir) \
+       --add-include-path=$(top_builddir) \
+       --add-include-path=$(top_builddir)/libdocument \
+       --strip-prefix=Ev \
+       --nsversion=$(EV_API_VERSION) \
+       --include=Gio-2.0 \
+       --include=Gtk-2.0 \
+       --include=EvDocument-$(EV_API_VERSION) \
+       --library=evview \
+       --libtool="$(LIBTOOL)" \
+       --output $@ \
+       --pkg gobject-2.0 \
+       --pkg gio-2.0 \
+       --pkg gtk+-2.0 \
+       --pkg evince-view-$(EV_API_VERSION) \
+       -I$(top_srcdir) \
+       -I$(top_builddir) \
+       -DEVINCE_COMPILATION \
+       $(INST_H_FILES)
+
+girdir = $(GIRDIR)
+gir_DATA = EvView-$(EV_API_VERSION).gir
+
+typelibsdir = $(GIRTYPELIBDIR)
+typelibs_DATA = EvView-$(EV_API_VERSION).typelib
+
+EXTRA_DIST += $(gir_DATA)
+CLEANFILES += $(gir_DATA) $(typelibs_DATA)
+
+%.typelib: %.gir
+       LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) \
+       --includedir=$(srcdir) \
+       --includedir=$(top_builddir)/libdocument \
+       $(G_IR_COMPILER_OPTS) \
+       $< -o $@
+
+endif # ENABLE_INTROSPECTION