[Xfce4-commits] <xfce4-fsguard-plugin:master> build the plugin as a module

Landry Breuil noreply at xfce.org
Fri May 4 16:00:02 CEST 2012


Updating branch refs/heads/master
         to c5ebc61b15dca2c57375122cb57bed3464b61e24 (commit)
       from ac41e0bac3edbb3d0913d03807b3bdcf9845f404 (commit)

commit c5ebc61b15dca2c57375122cb57bed3464b61e24
Author: Landry Breuil <landry at xfce.org>
Date:   Fri May 4 15:45:04 2012 +0200

    build the plugin as a module

 configure.ac.in                                    |    4 ++
 panel-plugin/Makefile.am                           |   43 ++++++++------------
 panel-plugin/fsguard.c                             |    2 +-
 .../{fsguard.desktop.in.in => fsguard.desktop.in}  |    4 +-
 po/POTFILES.in                                     |    2 +-
 5 files changed, 25 insertions(+), 30 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index dd1dbdb..1d1adf3 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -36,6 +36,10 @@ AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_INTLTOOL
 
+dnl Initialize libtool
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
+
 dnl Check for standard header files
 AC_HEADER_STDC
 
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index b7b8e7f..32a71ac 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,43 +1,34 @@
-plugindir = $(libexecdir)/xfce4/panel-plugins
-plugin_PROGRAMS = xfce4-fsguard-plugin
+plugindir = $(libdir)/xfce4/panel/plugins
+plugin_LTLIBRARIES =	libfsguard.la
 
-xfce4_fsguard_plugin_SOURCES =									\
-	fsguard.c
+libfsguard_la_SOURCES = fsguard.c
 
-xfce4_fsguard_plugin_CFLAGS =									\
-	-I$(top_srcdir)												\
+libfsguard_la_CFLAGS =											\
+	-I$(top_srcdir)											\
 	@LIBXFCEGUI4_CFLAGS@										\
 	@LIBXFCE4UTIL_CFLAGS@										\
 	@LIBXFCE4PANEL_CFLAGS@										\
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"
 
-xfce4_fsguard_plugin_LDADD =									\
+libfsguard_la_LIBADD =												\
 	@LIBXFCEGUI4_LIBS@											\
 	@LIBXFCE4UTIL_LIBS@											\
 	@LIBXFCE4PANEL_LIBS@
 
+libfsguard_la_LDFLAGS = \
+	-avoid-version \
+	-module \
+	-no-undefined \
+	-export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+	$(PLATFORM_LDFLAGS)
+
 # .desktop file
 #
-# Some automake trickery here. Because we cannot use $(libexecdir) in the
-# automake stage, we'll use sed to get the full path into the .desktop file.
-# We also need to let intltool merge the translated fields, so we add an
-# additional level of indirection: a <name>.desktop.in.in file.
-# 
-desktop_in_in_files = fsguard.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
-
-desktopdir = $(datadir)/xfce4/panel-plugins
+desktop_in_files = fsguard.desktop.in
+desktopdir = $(datadir)/xfce4/panel/plugins
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
-EXTRA_DIST =													\
-	$(desktop_in_in_files)
-
-DISTCLEANFILES =												\
-	$(desktop_DATA) $(desktop_in_files)
-	
-# get full path into .desktop file
-%.desktop.in: %.desktop.in.in
-	sed -e "s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^"	\
-		$< > $@
+EXTRA_DIST = $(desktop_in_files)
 
+DISTCLEANFILES = $(desktop_DATA)
diff --git a/panel-plugin/fsguard.c b/panel-plugin/fsguard.c
index b4b7dbe..268bdf1 100644
--- a/panel-plugin/fsguard.c
+++ b/panel-plugin/fsguard.c
@@ -735,7 +735,7 @@ fsguard_construct (XfcePanelPlugin *plugin)
     xfce_panel_plugin_menu_show_configure (plugin);
 }
 
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (fsguard_construct);
+XFCE_PANEL_PLUGIN_REGISTER (fsguard_construct);
 
 // }}}
 
diff --git a/panel-plugin/fsguard.desktop.in.in b/panel-plugin/fsguard.desktop.in
similarity index 75%
rename from panel-plugin/fsguard.desktop.in.in
rename to panel-plugin/fsguard.desktop.in
index 7c09678..7d7f57e 100644
--- a/panel-plugin/fsguard.desktop.in.in
+++ b/panel-plugin/fsguard.desktop.in
@@ -4,5 +4,5 @@ Encoding=UTF-8
 _Name=Free Space Checker
 _Comment=Monitor free disk space
 Icon=xfce4-fsguard-plugin-warning
-X-XFCE-Exec=@PLUGIN_PATH@/xfce4-fsguard-plugin
-
+X-XFCE-Module=fsguard
+X-XFCE-Internal=FALSE
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b303580..0709f6b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,2 +1,2 @@
 panel-plugin/fsguard.c
-panel-plugin/fsguard.desktop.in.in
+panel-plugin/fsguard.desktop.in


More information about the Xfce4-commits mailing list