[gvfs] Enable support for lazy loading of gio modules



commit 64cc7ebda2a7d5ecaf88a135182a27874bf83e5d
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Jan 12 16:35:16 2010 +0100

    Enable support for lazy loading of gio modules

 Makefile.am                                  |    8 ++++++++
 client/Makefile.am                           |    2 +-
 client/gdaemonvfs.c                          |   11 +++++++++++
 configure.ac                                 |    1 +
 gconf/Makefile.am                            |    2 +-
 gconf/gconf-module.c                         |   10 ++++++++++
 monitor/proxy/Makefile.am                    |    2 +-
 monitor/proxy/remote-volume-monitor-module.c |   11 +++++++++++
 8 files changed, 44 insertions(+), 3 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index d996b8d..c85c871 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,6 +32,14 @@ distclean-local:
 		rm -f ChangeLog; \
 	fi
 
+install-data-hook:
+	if test -z "$(DESTDIR)" ; then					\
+		$(GIO_QUERYMODULES) $(DESTDIR)$(giomodulesdir) ;	\
+	fi
+
+uninstall-local:
+	$(RM) $(DESTDIR)$(GIO_MODULE_DIR)/giomodules.cache
+
 ChangeLog:
 	$(AM_V_GEN) if test -d "$(srcdir)/.git"; then \
 	  (GIT_DIR=$(top_srcdir)/.git ./missing --run git log GVFS_1_2_2.. --stat -M -C --name-status  --date=short --no-color) | fmt --split-only > $  tmp \
diff --git a/client/Makefile.am b/client/Makefile.am
index e6e7d85..b9eebf4 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -10,7 +10,7 @@ INCLUDES = -I$(top_srcdir) \
 	-DGVFS_LOCALEDIR=\""$(localedir)"\"     \
 	-DDBUS_API_SUBJECT_TO_CHANGE
 
-module_flags = -export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_vfs_.*|g_io_module_load|g_io_module_unload'
+module_flags = -export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_vfs_.*|g_io_module_load|g_io_module_unload|g_io_module_query'
 
 ## Common to dynamic and static client libs
 
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index f0be172..7035837 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -1587,3 +1587,14 @@ void
 g_io_module_unload (GIOModule   *module)
 {
 }
+
+char **
+g_io_module_query (void)
+{
+  char *eps[] = {
+    G_VFS_EXTENSION_POINT_NAME,
+    G_VOLUME_MONITOR_EXTENSION_POINT_NAME,
+    NULL
+  };
+  return g_strdupv (eps);
+}
diff --git a/configure.ac b/configure.ac
index 76434cd..97342ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,6 +15,7 @@ AC_PROG_MAKE_SET
 AM_DISABLE_STATIC
 AM_PROG_LIBTOOL
 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+AC_PATH_PROG(GIO_QUERYMODULES, gio-querymodules, no)
 AM_PROG_CC_C_O
 AC_PROG_SED
 
diff --git a/gconf/Makefile.am b/gconf/Makefile.am
index 7d7abb9..85d4d8d 100644
--- a/gconf/Makefile.am
+++ b/gconf/Makefile.am
@@ -1,7 +1,7 @@
 
 NULL =
 
-module_flags = -export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_io_module_(load|unload)'
+module_flags = -export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_io_module_(load|unload|query)'
 
 if USE_GCONF
 giomodules_LTLIBRARIES = libgiogconf.la
diff --git a/gconf/gconf-module.c b/gconf/gconf-module.c
index 113073f..e5753a6 100644
--- a/gconf/gconf-module.c
+++ b/gconf/gconf-module.c
@@ -43,3 +43,13 @@ void
 g_io_module_unload (GIOModule *module)
 {
 }
+
+char **
+g_io_module_query (void)
+{
+  char *eps[] = {
+    G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME,
+    NULL
+  };
+  return g_strdupv (eps);
+}
diff --git a/monitor/proxy/Makefile.am b/monitor/proxy/Makefile.am
index 0c22f11..86a1efe 100644
--- a/monitor/proxy/Makefile.am
+++ b/monitor/proxy/Makefile.am
@@ -3,7 +3,7 @@ NULL =
 
 remote_volume_monitorsdir = $(datadir)/gvfs/remote-volume-monitors
 
-module_flags = -export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_io_module_(load|unload)'
+module_flags = -export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_io_module_(load|unload|query)'
 
 giomodules_LTLIBRARIES = libgioremote-volume-monitor.la
 
diff --git a/monitor/proxy/remote-volume-monitor-module.c b/monitor/proxy/remote-volume-monitor-module.c
index 4232527..5e44531 100644
--- a/monitor/proxy/remote-volume-monitor-module.c
+++ b/monitor/proxy/remote-volume-monitor-module.c
@@ -73,3 +73,14 @@ g_io_module_unload (GIOModule *module)
 out:
   ;
 }
+
+char **
+g_io_module_query (void)
+{
+  char *eps[] = {
+    G_NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME,
+    G_VOLUME_MONITOR_EXTENSION_POINT_NAME,
+    NULL
+  };
+  return g_strdupv (eps);
+}



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