aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-03-31 09:17:33 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-03-31 09:17:33 +0800
commit3b9ea2d060d2705563950fb063532aff54b1a08c (patch)
treefa33ff724c4833f9158d9b63397c1500c2a2daea
parentb5ee9fc4243e93781e2061f42f1b0af62696b499 (diff)
downloadgsoc2013-evolution-3b9ea2d060d2705563950fb063532aff54b1a08c.tar
gsoc2013-evolution-3b9ea2d060d2705563950fb063532aff54b1a08c.tar.gz
gsoc2013-evolution-3b9ea2d060d2705563950fb063532aff54b1a08c.tar.bz2
gsoc2013-evolution-3b9ea2d060d2705563950fb063532aff54b1a08c.tar.lz
gsoc2013-evolution-3b9ea2d060d2705563950fb063532aff54b1a08c.tar.xz
gsoc2013-evolution-3b9ea2d060d2705563950fb063532aff54b1a08c.tar.zst
gsoc2013-evolution-3b9ea2d060d2705563950fb063532aff54b1a08c.zip
[Some initial broken support for building components as shlib. Mostly
just a playground for testing the idea.] * Makefile.am: Added support for the ENABLE_SHLIB_COMPONENTS conditional. * GNOME_Evolution_Summary.oaf.in.in: New. * e-summary-mail.c (update_folder_cb): Protect against summary->mail being NULL. * component-factory.c: Add a shlib factory. (create_component): Get a @factory and @data. (component_factory_init): Actually make it use a BonoboGenericFactory again. * configure.in: Add argument `--enable-shlib-components'. New substitutions OAF_SHLIB_LOCATION, OAF_SHLIB_PREFIX, OAF_SHLIB_SUFFIX. svn path=/trunk/; revision=16299
-rw-r--r--ChangeLog6
-rw-r--r--configure.in46
-rw-r--r--my-evolution/ChangeLog15
-rw-r--r--my-evolution/GNOME_Evolution_Summary.oaf.in23
-rw-r--r--my-evolution/Makefile.am123
-rw-r--r--my-evolution/component-factory.c26
-rw-r--r--my-evolution/e-summary-mail.c3
-rw-r--r--my-evolution/e-summary-preferences.c2
8 files changed, 173 insertions, 71 deletions
diff --git a/ChangeLog b/ChangeLog
index c5db9dd25e..cd255f324e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-30 Ettore Perazzoli <ettore@ximian.com>
+
+ * configure.in: Add argument `--enable-shlib-components'. New
+ substitutions OAF_SHLIB_LOCATION, OAF_SHLIB_PREFIX,
+ OAF_SHLIB_SUFFIX.
+
2002-03-29 Ettore Perazzoli <ettore@ximian.com>
* configure.in: Check for GConf. Add gthreads to LIBIBEX_CFLAGS
diff --git a/configure.in b/configure.in
index 0bd89407b2..7beb9f6b46 100644
--- a/configure.in
+++ b/configure.in
@@ -568,6 +568,30 @@ fi
AC_MSG_RESULT($with_broken_spool)
+dnl ***************************************************************
+dnl Whether to build shlib components (instead of out-of-proc ones)
+dnl ***************************************************************
+
+AC_ARG_ENABLE(shlib-components,
+ [ --enable-shlib-components Enable building of some of the components as shared libs],
+ enable_shlib_components=yes,enable_shlib_components=no)
+
+AM_CONDITIONAL(ENABLE_SHLIB_COMPONENTS, test "x$enable_shlib_components" = "xyes")
+
+if test "x$enable_shlib_components" = "xyes" ; then
+ OAF_SHLIB_TYPE="shlib"
+ OAF_SHLIB_PREFIX="lib"
+ OAF_SHLIB_SUFFIX=".so"
+else
+ OAF_SHLIB_TYPE="exe"
+ OAF_SHLIB_PREFIX=""
+ OAF_SHLIB_SUFFIX=""
+fi
+
+AC_SUBST(OAF_SHLIB_TYPE)
+AC_SUBST(OAF_SHLIB_PREFIX)
+AC_SUBST(OAF_SHLIB_SUFFIX)
+
dnl ***************
dnl GNOME Libraries
dnl ***************
@@ -1235,6 +1259,8 @@ widgets/e-timezone-dialog/Makefile
widgets/menus/Makefile
widgets/misc/Makefile
wombat/Makefile
+
+my-evolution/GNOME_Evolution_Summary.oaf.in
])
if test "x$with_sub_version" != "x"; then
@@ -1258,16 +1284,26 @@ echo "\
SSL support: $msg_ssl
Dot Locking: $msg_dot
File Locking: $msg_file
- Gtk-doc: $enable_gtk_doc"
+ Gtk-doc: $enable_gtk_doc
+ Shlib components: $enable_shlib_components"
if test x$enable_gtk_doc = xyes; then
echo "
- Programming documentation files will be built automatically.
-"
+ Programming documentation files will be built automatically."
else
echo "
Programming documentation files will not be built.
You may want to install the gtk-doc package
- so that you will get the Evolution Developer's Guide.
-"
+ so that you will get the Evolution Developer's Guide."
fi
+
+if test "x$enable_shlib_components" = "xyes" ; then
+ echo "
+ *** Warning, shlib components are currently broken.
+ *** Enabling this option will probably cause Evolution to not
+ *** work correctly.
+"
+else
+ echo "
+"
+fi \ No newline at end of file
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog
index 5c6c4970cd..71fe3711d1 100644
--- a/my-evolution/ChangeLog
+++ b/my-evolution/ChangeLog
@@ -1,3 +1,18 @@
+2002-03-30 Ettore Perazzoli <ettore@ximian.com>
+
+ * Makefile.am: Added support for the ENABLE_SHLIB_COMPONENTS
+ conditional.
+
+ * GNOME_Evolution_Summary.oaf.in.in: New.
+
+ * e-summary-mail.c (update_folder_cb): Protect against
+ summary->mail being NULL.
+
+ * component-factory.c: Add a shlib factory.
+ (create_component): Get a @factory and @data.
+ (component_factory_init): Actually make it use a
+ BonoboGenericFactory again.
+
2002-03-29 Ettore Perazzoli <ettore@ximian.com>
* GNOME_Evolution_Summary.oaf.in: Add priority.
diff --git a/my-evolution/GNOME_Evolution_Summary.oaf.in b/my-evolution/GNOME_Evolution_Summary.oaf.in
index 60a49aa845..d9860c5ba4 100644
--- a/my-evolution/GNOME_Evolution_Summary.oaf.in
+++ b/my-evolution/GNOME_Evolution_Summary.oaf.in
@@ -1,23 +1,36 @@
<oaf_info>
<oaf_server iid="OAFIID:GNOME_Evolution_Summary_ShellComponent"
- type="exe"
- location="evolution-executive-summary">
+ type="factory"
+ location="OAFIID:GNOME_Evolution_Summary_ShellComponentFactory">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Evolution/ShellComponent:1.0"/>
</oaf_attribute>
<oaf_attribute name="description" type="string"
- _value="Evolution component for the executive summary."/>
+ _value="Evolution Summary component."/>
<oaf_attribute name="evolution:shell-component-icon" type="string"
value="evolution-today.png"/>
</oaf_server>
+ <oaf_server iid="OAFIID:GNOME_Evolution_Summary_ShellComponentFactory"
+ type="shlib"
+ location="libevolution-executive-summary.so">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/GenericFactory:1.0"/>
+ </oaf_attribute>
+
+ <oaf_attribute name="description" type="string"
+ _value="Factory for the Evolution Summary component."/>
+
+ </oaf_server>
+
<oaf_server iid="OAFIID:GNOME_Evolution_Summary_ConfigControlFactory"
- type="exe"
- location="evolution-executive-summary">
+ type="shlib"
+ location="libevolution-executive-summary.so">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/GenericFactory:1.0"/>
diff --git a/my-evolution/Makefile.am b/my-evolution/Makefile.am
index d178a0edb0..7faacbc288 100644
--- a/my-evolution/Makefile.am
+++ b/my-evolution/Makefile.am
@@ -1,5 +1,3 @@
-bin_PROGRAMS = evolution-executive-summary
-
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/shell \
@@ -26,42 +24,44 @@ MAIL_GENERATED = \
$(MAIL_GENERATED): $(IDLS)
$(ORBIT_IDL) -I $(srcdir) `$(GNOME_CONFIG) --cflags idl` $(top_srcdir)/mail/Mail.idl
-evolution_executive_summary_SOURCES = \
+summary_sources = \
$(MAIL_GENERATED) \
- component-factory.c \
- component-factory.h \
- e-cell-tri.c \
- e-cell-tri.h \
- e-summary.c \
- e-summary.h \
- e-summary-calendar.c \
- e-summary-calendar.h \
- e-summary-factory.c \
- e-summary-factory.h \
- e-summary-mail.c \
- e-summary-mail.h \
- e-summary-offline-handler.c \
- e-summary-offline-handler.h \
- e-summary-preferences.c \
- e-summary-preferences.h \
- e-summary-rdf.c \
- e-summary-rdf.h \
- e-summary-shown.c \
- e-summary-shown.h \
- e-summary-table.c \
- e-summary-table.h \
- e-summary-tasks.c \
- e-summary-tasks.h \
- e-summary-type.h \
- e-summary-weather.c \
- e-summary-weather.h \
- main.c \
- metar.c \
- metar.h \
- my-evolution-html.h \
+ component-factory.c \
+ component-factory.h \
+ e-cell-tri.c \
+ e-cell-tri.h \
+ e-summary.c \
+ e-summary.h \
+ e-summary-calendar.c \
+ e-summary-calendar.h \
+ e-summary-factory.c \
+ e-summary-factory.h \
+ e-summary-mail.c \
+ e-summary-mail.h \
+ e-summary-offline-handler.c \
+ e-summary-offline-handler.h \
+ e-summary-preferences.c \
+ e-summary-preferences.h \
+ e-summary-rdf.c \
+ e-summary-rdf.h \
+ e-summary-shown.c \
+ e-summary-shown.h \
+ e-summary-table.c \
+ e-summary-table.h \
+ e-summary-tasks.c \
+ e-summary-tasks.h \
+ e-summary-type.h \
+ e-summary-weather.c \
+ e-summary-weather.h \
+ metar.c \
+ metar.h \
+ my-evolution-html.h \
weather.h
-evolution_executive_summary_LDADD = \
+summary_exe_sources = \
+ main.c
+
+summary_libs = \
$(top_builddir)/calendar/gui/alarm-notify/libalarm.a \
$(top_builddir)/shell/libeshell.la \
$(top_builddir)/widgets/misc/libemiscwidgets.a \
@@ -73,30 +73,55 @@ evolution_executive_summary_LDADD = \
$(top_builddir)/libwombat/libwombat.la \
$(EVOLUTION_EXECUTIVE_SUMMARY_LIBS)
+if ENABLE_SHLIB_COMPONENTS
+
+lib_LTLIBRARIES = libevolution-executive-summary.la
+
+libevolution_executive_summary_la_SOURCES = \
+ $(summary_sources)
+
+libevolution_executive_summary_la_LIBADD = \
+ $(summary_libs)
+
+else
+
+bin_PROGRAMS = evolution-executive-summary
+
+evolution_executive_summary_SOURCES = \
+ $(summary_sources) \
+ $(summary_exe_sources)
+
+evolution_executive_summary_LDADD = \
+ $(summary_libs)
+
+endif
+
Locationdir = $(datadir)/evolution
Location_DATA = Locations
+oaf_files = GNOME_Evolution_Summary.oaf
+oaf_in_files = $(oaf_files:.oaf=.oaf.in)
+oaf_in_in_files = $(oaf_files:oaf=.oaf.in.in)
+
oafdir = $(datadir)/oaf
-oaf_in_files = GNOME_Evolution_Summary.oaf.in
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
+oaf_DATA = $(oaf_files)
gladedir = $(datadir)/evolution/glade
glade_DATA = my-evolution.glade
@XML_I18N_MERGE_OAF_RULE@
-EXTRA_DIST = $(oaf_in_files) $(oaf_DATA) $(Location_DATA) $(glade_DATA) Locations.h Location-translation-script
-
-if ENABLE_PURIFY
-PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-
-all-local: evolution-executive-summary.pure
-
-evolution-executive-summary.pure: evolution-executive-summary
- @rm -f evolution-executive-summary.pure
- $(PLINK) $(evolution_executive_summary_OBJECTS) $(evolution_executive_summary_LDADD) $(LIBS)
-
-endif
+EXTRA_DIST = \
+ $(summary_sources) \
+ $(summary_exe_sources) \
+ $(oaf_files) \
+ $(oaf_in_files) \
+ $(oaf_in_in_files) \
+ $(oaf_DATA) \
+ $(Location_DATA) \
+ $(glade_DATA) \
+ Locations.h \
+ Location-translation-script
dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)
diff --git a/my-evolution/component-factory.c b/my-evolution/component-factory.c
index 2059df50ee..fb7dbc8829 100644
--- a/my-evolution/component-factory.c
+++ b/my-evolution/component-factory.c
@@ -27,6 +27,7 @@
#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-generic-factory.h>
#include <bonobo/bonobo-context.h>
+#include <bonobo/bonobo-shlib-factory.h>
#include <shell/evolution-shell-component.h>
#include <shell/Evolution.h>
@@ -37,7 +38,8 @@
#include "component-factory.h"
#include <gal/widgets/e-gui-utils.h>
-#define COMPONENT_ID "OAFIID:GNOME_Evolution_Summary_ShellComponent"
+#define COMPONENT_ID "OAFIID:GNOME_Evolution_Summary_ShellComponent"
+#define COMPONENT_FACTORY_ID "OAFIID:GNOME_Evolution_Summary_ShellComponentFactory"
static gint running_objects = 0;
static ESummaryPrefs *global_preferences = NULL;
@@ -113,7 +115,8 @@ component_destroy (BonoboObject *factory,
}
static BonoboObject *
-create_component (void)
+create_component (BonoboGenericFactory *factory,
+ void *data)
{
EvolutionShellComponent *shell_component;
ESummaryOfflineHandler *offline_handler;
@@ -145,18 +148,19 @@ create_component (void)
return BONOBO_OBJECT (shell_component);
}
+/* Factory for the out-of-proc case. */
void
component_factory_init (void)
{
- BonoboObject *object;
- int result;
+ BonoboGenericFactory *factory;
- object = create_component ();
+ factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID,
+ create_component,
+ NULL);
- result = oaf_active_server_register (COMPONENT_ID, bonobo_object_corba_objref (object));
- if (result == OAF_REG_ERROR) {
- e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
- _("Cannot initialize Evolution's Summary component."));
- exit (1);
- }
+ if (factory == NULL)
+ g_error ("Cannot register Evolution Summary component factory.");
}
+
+/* Factory for the shlib case. */
+BONOBO_OAF_SHLIB_FACTORY (COMPONENT_FACTORY_ID, "Evolution Summary component", create_component, NULL)
diff --git a/my-evolution/e-summary-mail.c b/my-evolution/e-summary-mail.c
index aff5061cc8..014e29cd85 100644
--- a/my-evolution/e-summary-mail.c
+++ b/my-evolution/e-summary-mail.c
@@ -248,7 +248,8 @@ update_folder_cb (EvolutionStorageListener *listener,
}
uri = e_path_to_physical (proto, path);
- e_summary_mail_get_info (summary->mail, uri, summary->mail->listener);
+ if (summary->mail != NULL)
+ e_summary_mail_get_info (summary->mail, uri, summary->mail->listener);
g_free (uri);
}
diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c
index bf3e4159e6..808dc04c7b 100644
--- a/my-evolution/e-summary-preferences.c
+++ b/my-evolution/e-summary-preferences.c
@@ -40,6 +40,8 @@
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-generic-factory.h>
#include <bonobo/bonobo-moniker-util.h>
+#include <bonobo/bonobo-shlib-factory.h>
+
#include <bonobo-conf/bonobo-config-database.h>
#include "e-summary.h"