[gedit] Bug 621549 - Build GObject Introspection
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Bug 621549 - Build GObject Introspection
- Date: Sat, 19 Jun 2010 20:27:38 +0000 (UTC)
commit 58921206b7dea94d0ec0359dc43de94745f2a19e
Author: Garrett Regier <alias301 gmail com>
Date: Sat Jun 19 13:11:13 2010 -0700
Bug 621549 - Build GObject Introspection
configure.ac | 13 ++++++++++++-
gedit/Makefile.am | 40 ++++++++++++++++++++++++++++++++++++----
gedit/gedit-command-line.c | 8 ++++++++
3 files changed, 56 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 122abbb..6f1b818 100644
--- a/configure.ac
+++ b/configure.ac
@@ -378,6 +378,16 @@ AC_SUBST(GEDIT_PLUGINS_LIBS_DIR)
GNOME_DOC_INIT([0.9.0],,
[AC_MSG_WARN([[gnome-doc-utils not found: documentation will not be built.]])])
+# Introspection
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
+
+if test "$found_introspection" = "yes"; then
+ enable_introspection=yes
+ AC_DEFINE([ENABLE_INTROSPECTION], [1], [Define to enable GObject Introspection])
+else
+ enable_introspection=no
+fi
+
AC_CONFIG_FILES([
Makefile
data/gedit.desktop.in
@@ -437,7 +447,8 @@ Configuration:
Compiler: ${CC}
Spell Plugin enabled: $enable_enchant
Gvfs metadata enabled: $enable_gvfs_metadata
- Deprecations enabled: $enable_deprecations
+ Deprecations enabled: $enable_deprecations
+ GObject Introspection: $enable_introspection
"
if expr ${GEDIT_MINOR_VERSION} % 2 > /dev/null; then
diff --git a/gedit/Makefile.am b/gedit/Makefile.am
index 6bf6894..c31e353 100644
--- a/gedit/Makefile.am
+++ b/gedit/Makefile.am
@@ -13,13 +13,19 @@ INCLUDES = \
$(IGE_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
+ $(INTROSPECTION_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\"
gedit_SOURCES = \
gedit.c
-gedit_LDADD = libgedit.la $(GEDIT_LIBS) $(IGE_MAC_LIBS) $(EGG_SMCLIENT_LIBS)
+gedit_LDADD = \
+ libgedit.la \
+ $(GEDIT_LIBS) \
+ $(IGE_MAC_LIBS) \
+ $(EGG_SMCLIENT_LIBS) \
+ $(INTROSPECTION_LIBS)
if PLATFORM_WIN32
gedit_LDFLAGS = -Wl,--export-all-symbols -Wl,--out-implib,libgedit-$(GEDIT_API_VERSION).a
@@ -152,8 +158,7 @@ headerdir = $(prefix)/include/gedit- GEDIT_API_VERSION@/gedit
header_DATA = \
$(INST_H_FILES)
-libgedit_la_SOURCES = \
- $(BUILT_SOURCES) \
+libgedit_c_files = \
gedit-app.c \
gedit-close-button.c \
gedit-command-line.c \
@@ -205,7 +210,11 @@ libgedit_la_SOURCES = \
gedit-utils.c \
gedit-view.c \
gedit-window.c \
- gedittextregion.c \
+ gedittextregion.c
+
+libgedit_la_SOURCES = \
+ $(BUILT_SOURCES) \
+ $(libgedit_c_files) \
$(NOINST_H_FILES) \
$(INST_H_FILES)
@@ -249,6 +258,29 @@ EXTRA_DIST = \
CLEANFILES = $(BUILT_SOURCES)
+if HAVE_INTROSPECTION
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS = Gedit-3.0.gir
+
+Gedit-3.0.gir: libgedit.la
+INTROSPECTION_SCANNER_ARGS = -I$(top_srcdir) --warn-all
+Gedit_3_0_gir_NAMESPACE = Gedit
+Gedit_3_0_gir_VERSION = 3.0
+Gedit_3_0_gir_PROGRAM = $(builddir)/gedit
+Gedit_3_0_gir_FILES = $(INST_H_FILES) $(libgedit_c_files)
+Gedit_3_0_gir_INCLUDES = Gtk-3.0 GtkSource-3.0
+
+girdir = $(INTROSPECTION_GIRDIR)
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(INTROSPECTION_TYPELIBDIR)
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += \
+ $(gir_DATA) \
+ $(typelib_DATA)
+endif
+
dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)
diff --git a/gedit/gedit-command-line.c b/gedit/gedit-command-line.c
index 6725c54..db052a2 100644
--- a/gedit/gedit-command-line.c
+++ b/gedit/gedit-command-line.c
@@ -32,6 +32,10 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
+#ifdef ENABLE_INTROSPECTION
+#include <girepository.h>
+#endif
+
#include "gedit-command-line.h"
#include "eggsmclient.h"
@@ -334,6 +338,10 @@ gedit_command_line_parse (GeditCommandLine *command_line,
g_option_context_add_group (context, gtk_get_option_group (FALSE));
g_option_context_add_group (context, egg_sm_client_get_option_group ());
+#ifdef ENABLE_INTROSPECTION
+ g_option_context_add_group (context, g_irepository_get_option_group ());
+#endif
+
gtk_init (argc, argv);
if (!g_option_context_parse (context, argc, argv, &error))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]