Implement lazy loading of fam plugin
authorAlexander Larsson <alexl@redhat.com>
Tue, 12 Jan 2010 12:09:10 +0000 (13:09 +0100)
committerAlexander Larsson <alexl@redhat.com>
Tue, 12 Jan 2010 15:34:23 +0000 (16:34 +0100)
gio/fam/Makefile.am
gio/fam/fam-module.c

index 29ae072..e4183bd 100644 (file)
@@ -2,7 +2,7 @@ include $(top_srcdir)/Makefile.decl
 
 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)'
 
 giomodule_LTLIBRARIES = libgiofam.la
 giomoduledir = $(GIO_MODULE_DIR)
@@ -37,3 +37,16 @@ libgiofam_la_LIBADD = \
                $(FAM_LIBS) \
                $(NULL)
 
+if CROSS_COMPILING
+RUN_QUERY_MODULES=false
+else
+RUN_QUERY_MODULES=true
+endif
+
+install-data-hook:
+       if $(RUN_QUERY_MODULES) && test -z "$(DESTDIR)" ; then                                  \
+               $(top_builddir)/gio/gio-querymodules$(EXEEXT) $(DESTDIR)$(GIO_MODULE_DIR) ;     \
+       fi
+
+uninstall-local:
+       $(RM) $(DESTDIR)$(GIO_MODULE_DIR)/giomodules.cache
index 70e8dea..91d6d62 100644 (file)
@@ -41,3 +41,14 @@ g_io_module_unload (GIOModule   *module)
   _fam_sub_shutdown ();
 }
 
+char **
+g_io_module_query (void)
+{
+  char *eps[] = {
+    G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME,
+    G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME,
+    NULL
+  };
+  return g_strdupv (eps);
+}
+