? .libtool-cache-compile
? .libtool-cache-link-exe
? .libtool-cache-link-lib
? AUTOGEN.tml
? install.log
? libbonobo-zip
? libtool-cache.pl
? bonobo-activation/authorized_keys
? tests/test2.sh
? tests/test-activation/debug.sh
? tests/test-activation/debugas.sh
? tests/test-activation/m.log
? tests/test-activation/maisa.log
? tests/test-activation/t.log
? tests/test-activation/tippen.log
Index: libbonobo-zip.in
===================================================================
RCS file: /cvs/gnome/libbonobo/libbonobo-zip.in,v
retrieving revision 1.1
diff -p -u -2 -r1.1 libbonobo-zip.in
--- libbonobo-zip.in	22 Feb 2005 12:08:44 -0000	1.1
+++ libbonobo-zip.in	24 Feb 2005 10:42:25 -0000
@@ -13,13 +13,14 @@ zip $ZIP -@ <<EOF
 COPYING
 COPYING.LIB-2
+bin/activation-client.exe
 bin/libbonobo-2-0.dll
 bin/libbonobo-activation-4.dll
-bin/activation-client.exe
-sbin/bonobo-activation-sysconf.exe
-libexec/bonobo-activation-server.exe
+etc/bonobo-activation/bonobo-activation-config.xml
+lib/bonobo/monikers/libmoniker_std_2.dll
 lib/bonobo/servers/Bonobo_CosNaming_NamingContext.server
 lib/bonobo/servers/Bonobo_Moniker_std.server
-lib/bonobo/monikers/libmoniker_std_2.dll
-etc/bonobo-activation/bonobo-activation-config.xml
+lib/orbit-2.0/Bonobo_module.dll
+libexec/bonobo-activation-server.exe
+sbin/bonobo-activation-sysconf.exe
 EOF
 
@@ -28,17 +29,18 @@ zip $ZIP lib/locale/*/LC_MESSAGES/libbon
 rm $DEVZIP
 zip -r $DEVZIP -@ <<EOF
+bin/bonobo-activation-run-query.exe
 bin/echo-client-2.exe
-include/libbonobo-2.0
 include/bonobo-activation-2.0
+include/libbonobo-2.0
+lib/bonobo-2.0/samples/bonobo-echo-2.exe
+lib/bonobo/servers/Bonobo_Sample_Echo.server
 lib/libbonobo-2.dll.a
 lib/libbonobo-activation.dll.a
-share/idl/bonobo-2.0
-share/idl/bonobo-activation-2.0
-lib/bonobo/servers/Bonobo_Sample_Echo.server
-lib/pkgconfig/libbonobo-2.0.pc
 lib/pkgconfig/bonobo-activation-2.0.pc
-lib/orbit-2.0/Bonobo_module.dll
-share/gtk-doc/html/libbonobo
-share/gtk-doc/html/bonobo-activation
+lib/pkgconfig/libbonobo-2.0.pc
 man/man1/bonobo-activation-server.1
+share/gtk-doc/html/bonobo-activation
+share/gtk-doc/html/libbonobo
+share/idl/bonobo-2.0
+share/idl/bonobo-activation-2.0
 EOF
Index: activation-server/Makefile.am
===================================================================
RCS file: /cvs/gnome/libbonobo/activation-server/Makefile.am,v
retrieving revision 1.55
diff -p -u -2 -r1.55 Makefile.am
--- activation-server/Makefile.am	15 Jan 2004 12:35:58 -0000	1.55
+++ activation-server/Makefile.am	24 Feb 2005 10:42:25 -0000
@@ -12,4 +12,5 @@ INCLUDES=					\
 	-I$(top_builddir)/bonobo-activation	\
 	-I$(top_srcdir)/bonobo-activation	\
+	-DPREFIX=\""$(prefix)"\"		\
 	-DSERVERINFODIR=\"$(libdir)/bonobo/servers\" \
         -DSERVER_LOCALEDIR=\""${prefix}/${DATADIRNAME}/locale"\" \
@@ -37,5 +38,6 @@ bonobo_activation_server_SOURCES=				\
 	object-directory-config-file.h				\
 	activation-server-main.c				\
-	server.h
+	server.h						\
+	server-win32.h
 
 LDADD= \
@@ -48,5 +50,6 @@ test_performance_SOURCES =	\
 	test-performance.c	\
 	object-directory-load.c	\
-	server.h
+	server.h		\
+	server-win32.h
 
 TESTS=test-performance
Index: activation-server/activation-server-main.c
===================================================================
RCS file: /cvs/gnome/libbonobo/activation-server/activation-server-main.c,v
retrieving revision 1.61
diff -p -u -2 -r1.61 activation-server-main.c
--- activation-server/activation-server-main.c	22 Feb 2005 12:08:44 -0000	1.61
+++ activation-server/activation-server-main.c	24 Feb 2005 10:42:25 -0000
@@ -52,4 +52,8 @@
 #include <libxml/parser.h>
 
+#ifdef G_OS_WIN32
+#include "server-win32.h"
+#endif
+
 #ifdef BONOBO_ACTIVATION_DEBUG
 static void debug_queries (void);
@@ -86,5 +90,6 @@ static struct poptOption options[] = {
 #endif
 
-	POPT_AUTOHELP {NULL}
+	POPT_AUTOHELP
+        {NULL}
 };
 
@@ -109,5 +114,5 @@ build_src_dir (void)
         if (od_source_dir) {
                 g_string_append (real_od_source_dir, od_source_dir);
-                g_string_append_c (real_od_source_dir, ':');
+                g_string_append_c (real_od_source_dir, G_SEARCHPATH_SEPARATOR);
         }
 
@@ -115,5 +120,5 @@ build_src_dir (void)
                 g_string_append (real_od_source_dir,
                                  env_od_source_dir);
-                g_string_append_c (real_od_source_dir, ':');
+                g_string_append_c (real_od_source_dir, G_SEARCHPATH_SEPARATOR);
         }
 
@@ -122,9 +127,9 @@ build_src_dir (void)
                                  config_file_od_source_dir);
                 g_free (config_file_od_source_dir);
-                g_string_append_c (real_od_source_dir, ':');
+                g_string_append_c (real_od_source_dir, G_SEARCHPATH_SEPARATOR);
         }
 
         if (gnome_env_od_source_dir) {
-                gnome_dirs = g_strsplit (gnome_env_od_source_dir, ":", -1);
+                gnome_dirs = g_strsplit (gnome_env_od_source_dir, G_SEARCHPATH_SEPARATOR_S, -1);
                 gnome_od_source_dir = g_string_new("");
                 for (i=0; gnome_dirs[i]; i++) {
@@ -132,10 +137,10 @@ build_src_dir (void)
                                          gnome_dirs[i]);
                         g_string_append (gnome_od_source_dir,
-                                         "/lib/bonobo/servers:");
+                                         "/lib/bonobo/servers" G_SEARCHPATH_SEPARATOR_S);
                 }
                 g_strfreev (gnome_dirs);
                 g_string_append (real_od_source_dir,
                                  gnome_od_source_dir->str);
-                g_string_append_c (real_od_source_dir, ':');
+                g_string_append_c (real_od_source_dir, G_SEARCHPATH_SEPARATOR);
         }
 
@@ -298,4 +303,8 @@ main (int argc, char *argv[])
 #endif
 	const gchar                  *debug_output_env;
+
+#ifdef G_OS_WIN32
+        whereami ();
+#endif
 
 #ifdef HAVE_SETSID
Index: activation-server/object-directory-config-file.c
===================================================================
RCS file: /cvs/gnome/libbonobo/activation-server/object-directory-config-file.c,v
retrieving revision 1.16
diff -p -u -2 -r1.16 object-directory-config-file.c
--- activation-server/object-directory-config-file.c	27 Feb 2002 21:24:51 -0000	1.16
+++ activation-server/object-directory-config-file.c	24 Feb 2005 10:42:25 -0000
@@ -33,4 +33,10 @@
 #include "object-directory-config-file.h"
 
+#ifdef G_OS_WIN32
+extern const char *_server_confdir;
+#undef SERVER_CONFDIR
+#define SERVER_CONFDIR _server_confdir
+#endif
+
 static xmlDocPtr
 object_directory_load_xml_file (void)
@@ -82,5 +88,5 @@ object_directory_load_config_file (void)
                                         directory = xmlNodeGetContent (item_node);
                                         if (directory) {
-                                                result = g_strconcat (old_result, ":", directory, NULL);
+                                                result = g_strconcat (old_result, G_SEARCHPATH_SEPARATOR_S, directory, NULL);
                                                 xmlFree (directory);
                                                 g_free (old_result);
Index: activation-server/object-directory-corba.c
===================================================================
RCS file: /cvs/gnome/libbonobo/activation-server/object-directory-corba.c,v
retrieving revision 1.76
diff -p -u -2 -r1.76 object-directory-corba.c
--- activation-server/object-directory-corba.c	13 Dec 2004 14:56:01 -0000	1.76
+++ activation-server/object-directory-corba.c	24 Feb 2005 10:42:26 -0000
@@ -213,5 +213,5 @@ split_path_unique (const char *colon_del
         g_return_val_if_fail (colon_delimited_path != NULL, NULL);
 
-        wrk = g_strsplit (colon_delimited_path, ":", -1);
+        wrk = g_strsplit (colon_delimited_path, G_SEARCHPATH_SEPARATOR_S, -1);
 
         g_return_val_if_fail (wrk != NULL, NULL);
Index: activation-server/object-directory-load.c
===================================================================
RCS file: /cvs/gnome/libbonobo/activation-server/object-directory-load.c,v
retrieving revision 1.43
diff -p -u -2 -r1.43 object-directory-load.c
--- activation-server/object-directory-load.c	15 Jan 2004 12:36:00 -0000	1.43
+++ activation-server/object-directory-load.c	24 Feb 2005 10:42:26 -0000
@@ -158,4 +158,12 @@ parse_oaf_server_attrs (ParseInfo      *
         }
 
+#ifdef G_OS_WIN32
+        /* Possibly replace configure-time shlib or exe location
+         * with the actual installed one.
+         */
+        if (!strcmp (type, "exe") || !strcmp (type, "shlib"))
+                location = server_win32_replace_prefix (location);
+#endif
+
         /* Now create the ServerInfo object */
         info->cur_server = g_new0 (Bonobo_ServerInfo, 1);
@@ -167,4 +175,9 @@ parse_oaf_server_attrs (ParseInfo      *
         info->cur_server->username = CORBA_string_dup (g_get_user_name ());
         info->cur_server->domain = CORBA_string_dup ("unused");
+
+#ifdef G_OS_WIN32
+        if (!strcmp (type, "exe") || !strcmp (type, "shlib"))
+                g_free ((char *) location);
+#endif
 }
 
Index: activation-server/server-win32.h
===================================================================
RCS file: activation-server/server-win32.h
diff -N activation-server/server-win32.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ activation-server/server-win32.h	24 Feb 2005 10:42:26 -0000
@@ -0,0 +1,85 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/*
+ *  Copyright (C) 2005 Novell, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public License as
+ *  published by the Free Software Foundation; either version 2 of the
+ *  License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Authors: Tor Lillqvist <tml@iki.fi>
+ *
+ */
+
+/* Include this in the two "main" programs in activation-server only. */
+
+#ifndef SERVER_WIN32_H
+#define SERVER_WIN32_H
+
+#include <windows.h>
+#include <mbstring.h>
+
+static const char *runtime_prefix;
+static const char *serverinfodir;
+static const char *server_localedir;
+const char *_server_confdir;
+
+const char *
+server_win32_replace_prefix (const char *configure_time_path)
+{
+  if (strncmp (configure_time_path, PREFIX "/", strlen (PREFIX) + 1) == 0) {
+          return g_strconcat (runtime_prefix,
+                              configure_time_path + strlen (PREFIX),
+                              NULL);
+  } else
+          return g_strdup (configure_time_path);
+}
+
+/* Fetch the executable's full path and deduce the installation
+ * directory from that, and then form the pathnames for various
+ * directories relative to the installation directory.
+ */
+static void 
+whereami (void)
+{
+  char cpbfr[1000];
+  
+  if (GetModuleFileNameA (NULL, cpbfr, G_N_ELEMENTS (cpbfr))) {
+          gchar *p = _mbsrchr (cpbfr, '\\');
+          
+          if (p != NULL)
+                  *p = '\0';
+          
+          p = _mbsrchr (cpbfr, '\\');
+          if (p && (g_ascii_strcasecmp (p + 1, "libexec") == 0))
+                  *p = '\0';
+  } else {
+          cpbfr[0] = '\0';
+  }
+  
+  runtime_prefix = g_strdup (cpbfr);
+  
+  serverinfodir = server_win32_replace_prefix (SERVERINFODIR);
+  server_localedir = server_win32_replace_prefix (SERVER_LOCALEDIR);
+  _server_confdir = server_win32_replace_prefix (SERVER_CONFDIR);
+}
+
+#undef SERVERINFODIR
+#define SERVERINFODIR serverinfodir
+
+#undef SERVER_LOCALEDIR
+#define SERVER_LOCALEDIR server_localedir
+
+#undef SERVER_CONFDIR
+#define SERVER_CONFDIR _server_confdir
+
+#endif /* SERVER_WIN32_H */
Index: activation-server/server.h
===================================================================
RCS file: /cvs/gnome/libbonobo/activation-server/server.h,v
retrieving revision 1.25
diff -p -u -2 -r1.25 server.h
--- activation-server/server.h	15 Jan 2004 15:25:43 -0000	1.25
+++ activation-server/server.h	24 Feb 2005 10:42:26 -0000
@@ -56,3 +56,7 @@ void                     add_initial_loc
 gboolean                 register_interest_in_locales    (const char            *locales);
 
+#ifdef G_OS_WIN32
+const char *server_win32_replace_prefix (const char *configure_time_path);
+#endif
+
 #endif /* SERVER_H */
Index: activation-server/test-performance.c
===================================================================
RCS file: /cvs/gnome/libbonobo/activation-server/test-performance.c,v
retrieving revision 1.6
diff -p -u -2 -r1.6 test-performance.c
--- activation-server/test-performance.c	24 Nov 2003 01:04:03 -0000	1.6
+++ activation-server/test-performance.c	24 Feb 2005 10:42:26 -0000
@@ -6,4 +6,8 @@
 #include "server.h"
 
+#ifdef G_OS_WIN32
+#include "server-win32.h"
+#endif
+
 static GTimer *timer;
 
Index: bonobo/Makefile.am
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo/Makefile.am,v
retrieving revision 1.76
diff -p -u -2 -r1.76 Makefile.am
--- bonobo/Makefile.am	6 Mar 2004 17:45:30 -0000	1.76
+++ bonobo/Makefile.am	24 Feb 2005 10:42:27 -0000
@@ -5,4 +5,5 @@ INCLUDES = \
 	$(WARN_CFLAGS)					\
 	$(LIBBONOBO_CFLAGS)				\
+	-DPREFIX=\""$(prefix)"\"			\
         -DBONOBO_LIBDIR=\""$(libdir)"\" 		\
         -DBONOBO_DATADIR=\""$(datadir)"\" 		\
Index: bonobo/bonobo-main.c
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo/bonobo-main.c,v
retrieving revision 1.79
diff -p -u -2 -r1.79 bonobo-main.c
--- bonobo/bonobo-main.c	17 Nov 2003 22:10:37 -0000	1.79
+++ bonobo/bonobo-main.c	24 Feb 2005 10:42:27 -0000
@@ -32,4 +32,65 @@ static guint              bonobo_main_lo
 static GSList *           bonobo_main_loops = NULL;
 
+#ifdef G_OS_WIN32
+
+#ifndef PIC
+#error Must build as a DLL
+#endif
+
+#include <windows.h>
+#include <mbstring.h>
+
+static char *bonobo_localedir;
+
+static char *
+replace_prefix (const char *runtime_prefix,
+		const char *configure_time_path)
+{
+  if (strncmp (configure_time_path, PREFIX "/", strlen (PREFIX) + 1) == 0) {
+          return g_strconcat (runtime_prefix,
+                              configure_time_path + strlen (PREFIX),
+                              NULL);
+  } else
+          return g_strdup (configure_time_path);
+}
+
+/* DllMain function needed to fetch the DLL name and deduce the
+ * installation directory from that, and then form the pathnames for
+ * various directories relative to the installation directory.
+ */
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+	 DWORD     fdwReason,
+	 LPVOID    lpvReserved)
+{
+  char cpbfr[1000];
+  
+  switch (fdwReason) {
+  case DLL_PROCESS_ATTACH:
+          if (GetModuleFileNameA ((HMODULE) hinstDLL,
+                                  cpbfr, G_N_ELEMENTS (cpbfr))) {
+		  gchar *p = _mbsrchr (cpbfr, '\\');
+		  
+		  if (p != NULL)
+			  *p = '\0';
+                  
+		  p = _mbsrchr (cpbfr, '\\');
+		  if (p && (g_ascii_strcasecmp (p + 1, "bin") == 0 ||
+			    g_ascii_strcasecmp (p + 1, "lib") == 0))
+			  *p = '\0';
+	  } else {
+		  cpbfr[0] = '\0';
+	  }
+
+          bonobo_localedir = replace_prefix (cpbfr, BONOBO_LOCALEDIR);
+  }
+  return TRUE;
+}
+
+#undef BONOBO_LOCALEDIR
+#define BONOBO_LOCALEDIR bonobo_localedir
+
+#endif
+
 /**
  * bonobo_orb:
Index: bonobo-activation/Makefile.am
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo-activation/Makefile.am,v
retrieving revision 1.51
diff -p -u -2 -r1.51 Makefile.am
--- bonobo-activation/Makefile.am	8 Aug 2004 14:47:31 -0000	1.51
+++ bonobo-activation/Makefile.am	24 Feb 2005 10:42:27 -0000
@@ -6,4 +6,5 @@ INCLUDES=					\
 	-I$(top_srcdir)				\
 	-I$(top_builddir)			\
+	-DPREFIX=\""$(prefix)\""		\
 	-DSERVER_LIBEXECDIR=\""$(libexecdir)\"" \
         -DBONOBO_ACTIVATION_LOCALEDIR=\""${prefix}/${DATADIRNAME}/locale"\" \
Index: bonobo-activation/bonobo-activation-base-service.c
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo-activation/bonobo-activation-base-service.c,v
retrieving revision 1.54
diff -p -u -2 -r1.54 bonobo-activation-base-service.c
--- bonobo-activation/bonobo-activation-base-service.c	22 Feb 2005 12:08:45 -0000	1.54
+++ bonobo-activation/bonobo-activation-base-service.c	24 Feb 2005 10:42:27 -0000
@@ -721,7 +721,23 @@ bonobo_activation_base_service_init (voi
 {
         const char *override_cmd;
+#ifndef G_OS_WIN32
         static const char *bonobo_activation_ac_cmd[] =
                 { SERVER_LIBEXECDIR "/bonobo-activation-server",
                   "--ac-activate", "--ior-output-fd=%d", NULL };
+#else
+        static const char *bonobo_activation_ac_cmd[] =
+                { NULL,
+                  "--ac-activate", "--ior-output-fd=%d", NULL };
+        static gboolean beenhere = FALSE;
+        extern char *_server_libexecdir; /* In bonobo-activation-init.c */
+
+        if (!beenhere) {
+                bonobo_activation_ac_cmd[0] =
+                        g_strconcat (_server_libexecdir,
+                                     "/bonobo-activation-server",
+                                     NULL);
+                beenhere = TRUE;
+        }
+#endif
 
 	bonobo_activation_base_service_activator_add (local_activator, 0);
Index: bonobo-activation/bonobo-activation-fork-server.c
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo-activation/bonobo-activation-fork-server.c,v
retrieving revision 1.23
diff -p -u -2 -r1.23 bonobo-activation-fork-server.c
--- bonobo-activation/bonobo-activation-fork-server.c	22 Feb 2005 12:08:45 -0000	1.23
+++ bonobo-activation/bonobo-activation-fork-server.c	24 Feb 2005 10:42:28 -0000
@@ -243,4 +243,8 @@ bonobo_activation_server_by_forking (
         ai.user_data = user_data;
 
+#ifdef BONOBO_ACTIVATION_DEBUG
+        ai.do_srv_output = getenv ("BONOBO_ACTIVATION_DEBUG_EXERUN");
+#endif
+                
         if (!use_new_loop &&
             (retval = scan_list (running_activations, &ai, ev)) != CORBA_OBJECT_NIL)
@@ -250,5 +254,6 @@ bonobo_activation_server_by_forking (
 
 #ifdef BONOBO_ACTIVATION_DEBUG
-        fprintf (stderr, " SPAWNING: '%s' for '%s'\n", cmd[0], act_iid);
+        if (ai.do_srv_output)
+                fprintf (stderr, " SPAWNING: '%s' for '%s'\n", cmd[0], act_iid);
 #endif
 
@@ -357,8 +362,4 @@ bonobo_activation_server_by_forking (
 	}
 
-#ifdef BONOBO_ACTIVATION_DEBUG
-        ai.do_srv_output = getenv ("BONOBO_ACTIVATION_DEBUG_EXERUN");
-#endif
-                
         close (iopipes[1]);
 
Index: bonobo-activation/bonobo-activation-get-language-list.c
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo-activation/bonobo-activation-get-language-list.c,v
retrieving revision 1.6
diff -p -u -2 -r1.6 bonobo-activation-get-language-list.c
--- bonobo-activation/bonobo-activation-get-language-list.c	11 Aug 2004 12:46:11 -0000	1.6
+++ bonobo-activation/bonobo-activation-get-language-list.c	24 Feb 2005 10:42:28 -0000
@@ -117,4 +117,10 @@ unalias_lang (char *lang)
   if (!alias_table)
     {
+#ifdef G_OS_WIN32
+      extern char *_bonobo_activation_localedir;
+      char *aliases = g_strconcat (_bonobo_activation_localedir, "/locale.alias", NULL);
+      read_aliases (aliases);
+      g_free (aliases);
+#else
       read_aliases (BONOBO_ACTIVATION_LOCALEDIR "/locale.alias");
       read_aliases ("/usr/share/locale/locale.alias");
@@ -122,4 +128,5 @@ unalias_lang (char *lang)
       read_aliases ("/usr/lib/X11/locale/locale.alias");
       read_aliases ("/usr/openwin/lib/locale/locale.alias");
+#endif
     }
   i = 0;
Index: bonobo-activation/bonobo-activation-init.c
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo-activation/bonobo-activation-init.c,v
retrieving revision 1.61
diff -p -u -2 -r1.61 bonobo-activation-init.c
--- bonobo-activation/bonobo-activation-init.c	22 Feb 2005 12:08:45 -0000	1.61
+++ bonobo-activation/bonobo-activation-init.c	24 Feb 2005 10:42:28 -0000
@@ -56,4 +56,66 @@ static gboolean is_initialized = FALSE;
 gboolean bonobo_activation_private = FALSE;
 
+#ifdef G_OS_WIN32
+
+#ifndef PIC
+#error Must build as a DLL
+#endif
+
+#include <windows.h>
+#include <mbstring.h>
+
+char *_server_libexecdir;
+char *_bonobo_activation_localedir;
+
+static char *
+replace_prefix (const char *runtime_prefix,
+		const char *configure_time_path)
+{
+  if (strncmp (configure_time_path, PREFIX "/", strlen (PREFIX) + 1) == 0) {
+          return g_strconcat (runtime_prefix,
+                              configure_time_path + strlen (PREFIX),
+                              NULL);
+  } else
+          return g_strdup (configure_time_path);
+}
+
+/* DllMain function needed to fetch the DLL name and deduce the
+ * installation directory from that, and then form the pathnames for
+ * various directories relative to the installation directory.
+ */
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+	 DWORD     fdwReason,
+	 LPVOID    lpvReserved)
+{
+  char cpbfr[1000];
+  
+  switch (fdwReason) {
+  case DLL_PROCESS_ATTACH:
+          if (GetModuleFileNameA ((HMODULE) hinstDLL,
+                                  cpbfr, G_N_ELEMENTS (cpbfr))) {
+		  gchar *p = _mbsrchr (cpbfr, '\\');
+		  
+		  if (p != NULL)
+			  *p = '\0';
+                  
+		  p = _mbsrchr (cpbfr, '\\');
+		  if (p && (g_ascii_strcasecmp (p + 1, "bin") == 0 ||
+			    g_ascii_strcasecmp (p + 1, "lib") == 0))
+			  *p = '\0';
+	  } else {
+		  cpbfr[0] = '\0';
+	  }
+
+	  _server_libexecdir = replace_prefix (cpbfr, SERVER_LIBEXECDIR);
+          _bonobo_activation_localedir = replace_prefix (cpbfr, BONOBO_ACTIVATION_LOCALEDIR);
+  }
+  return TRUE;
+}
+
+#undef BONOBO_ACTIVATION_LOCALEDIR
+#define BONOBO_ACTIVATION_LOCALEDIR _bonobo_activation_localedir
+
+#endif
 
 /**
Index: bonobo-activation/bonobo-activation-init.h
===================================================================
RCS file: /cvs/gnome/libbonobo/bonobo-activation/bonobo-activation-init.h,v
retrieving revision 1.8
diff -p -u -2 -r1.8 bonobo-activation-init.h
--- bonobo-activation/bonobo-activation-init.h	13 Mar 2003 10:48:55 -0000	1.8
+++ bonobo-activation/bonobo-activation-init.h	24 Feb 2005 10:42:28 -0000
@@ -59,3 +59,2 @@ G_END_DECLS
 
 #endif /* BONOBO_ACTIVATION_INIT_H */
-
Index: samples/echo/echo.c
===================================================================
RCS file: /cvs/gnome/libbonobo/samples/echo/echo.c,v
retrieving revision 1.13
diff -p -u -2 -r1.13 echo.c
--- samples/echo/echo.c	11 Apr 2003 15:11:04 -0000	1.13
+++ samples/echo/echo.c	24 Feb 2005 10:42:29 -0000
@@ -49,6 +49,17 @@ impl_demo_echo_echo (PortableServer_Serv
 	Echo *echo = ECHO (bonobo_object (servant));
 									 
-	printf ("Echo message received: %s (echo instance data: %s)\n",
-		string, echo->instance_data);
+	/* activation-server-main.c dup2's the null device to stdout,
+	 * so we need to freopen it if we want the below output to
+	 * show up. Try the controlling terminal.
+	 */
+	if (freopen (
+#ifdef G_OS_WIN32
+		     "CONOUT$",
+#else
+		     "/dev/tty",
+#endif
+		     "w", stdout))
+	    printf ("Echo message received: %s (echo instance data: %s)\n",
+		    string, echo->instance_data);
 }
 
