From 74ad124cfba3278c385d177a527f19574fda9670 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 12 Jan 2010 13:09:10 +0100 Subject: [PATCH] Implement lazy loading of fam plugin --- gio/fam/Makefile.am | 15 ++++++++++++++- gio/fam/fam-module.c | 11 +++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gio/fam/Makefile.am b/gio/fam/Makefile.am index 29ae072de..e4183bd97 100644 --- a/gio/fam/Makefile.am +++ b/gio/fam/Makefile.am @@ -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 diff --git a/gio/fam/fam-module.c b/gio/fam/fam-module.c index 70e8dea22..91d6d62c4 100644 --- a/gio/fam/fam-module.c +++ b/gio/fam/fam-module.c @@ -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); +} +