[Xfce4-commits] <xfce4-sample-plugin:master> Compile plugin as a module.

David Schneider noreply at xfce.org
Fri May 18 08:48:03 CEST 2012


Updating branch refs/heads/master
         to cda9e404dc8b558852b31c2a6a8ed10ae6f79453 (commit)
       from fe7ac93fd7c5986610e44c64cb5791a97cdbf432 (commit)

commit cda9e404dc8b558852b31c2a6a8ed10ae6f79453
Author: David Schneider <dnschneid at gmail.com>
Date:   Thu May 17 15:16:36 2012 -0700

    Compile plugin as a module.

 autogen.sh                                         |    2 +-
 configure.ac.in                                    |    7 +++-
 panel-plugin/Makefile.am                           |   35 +++++++++-----------
 panel-plugin/sample.c                              |    2 +-
 .../{sample.desktop.in.in => sample.desktop.in}    |    5 ++-
 po/POTFILES.in                                     |    2 +-
 6 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 1511e88..e56e713 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -29,5 +29,5 @@ EOF
   exit 1
 }
 
-XDT_AUTOGEN_REQUIRED_VERSION="4.7.3" \
+XDT_AUTOGEN_REQUIRED_VERSION="4.9.1" \
 exec xdt-autogen $@
diff --git a/configure.ac.in b/configure.ac.in
index 2bcdc3b..155bc1c 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -33,6 +33,12 @@ AM_CONFIG_HEADER([config.h])
 AM_MAINTAINER_MODE()
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
+dnl **************************
+dnl *** Initialize libtool ***
+dnl **************************
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
+
 dnl *******************************
 dnl *** Check for UNIX variants ***
 dnl *******************************
@@ -47,7 +53,6 @@ AM_PROG_CC_C_O()
 AC_PROG_LD()
 AC_PROG_INSTALL()
 AC_PROG_INTLTOOL()
-AC_PROG_LIBTOOL()
 
 dnl **********************************
 dnl *** Check for standard headers ***
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 36cdd10..87ace21 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -7,25 +7,32 @@ INCLUDES = \
 #
 # Sample plugin
 #
-plugin_PROGRAMS = \
-	xfce4-sample-plugin
+plugin_LTLIBRARIES = \
+	libsample.la
 
 plugindir = \
-	$(libexecdir)/xfce4/panel-plugins
+	$(libdir)/xfce4/panel/plugins
 
-xfce4_sample_plugin_SOURCES = \
+libsample_la_SOURCES = \
 	sample.c \
 	sample.h \
 	sample-dialogs.c \
 	sample-dialogs.h
 
-xfce4_sample_plugin_CFLAGS = \
+libsample_la_CFLAGS = \
 	$(LIBXFCE4UTIL_CFLAGS) \
 	$(LIBXFCE4UI_CFLAGS) \
 	$(LIBXFCE4PANEL_CFLAGS) \
 	$(PLATFORM_CFLAGS)
 
-xfce4_sample_plugin_LDADD = \
+libsample_la_LDFLAGS = \
+       -avoid-version \
+       -module \
+       -no-undefined \
+       -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+       $(PLATFORM_LDFLAGS)
+
+libsample_la_LIBADD = \
 	$(LIBXFCE4UTIL_LIBS) \
 	$(LIBXFCE4UI_LIBS) \
 	$(LIBXFCE4PANEL_LIBS)
@@ -34,27 +41,17 @@ xfce4_sample_plugin_LDADD = \
 # Desktop file
 #
 desktopdir =								\
-	$(datadir)/xfce4/panel-plugins
-
-desktop_in_in_files =							\
-	sample.desktop.in.in
-
-desktop_in_files =							\
-	$(desktop_in_in_files:.desktop.in.in=.desktop.in)
-
-%.desktop.in: %.desktop.in.in
-	sed -e "s,\@libexecdir\@,$(libexecdir),g" < $< > $@
+	$(datadir)/xfce4/panel/plugins
 
 desktop_DATA =								\
-	$(desktop_in_files:.desktop.in=.desktop)
+	sample.desktop
 
 @INTLTOOL_DESKTOP_RULE@
 
 EXTRA_DIST =								\
-	$(desktop_in_in_files)
+	sample.desktop.in
 
 CLEANFILES =								\
-	$(desktop_in_files)						\
 	$(desktop_DATA)
 
 # vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/panel-plugin/sample.c b/panel-plugin/sample.c
index 942438f..95302cb 100644
--- a/panel-plugin/sample.c
+++ b/panel-plugin/sample.c
@@ -45,7 +45,7 @@ sample_construct (XfcePanelPlugin *plugin);
 
 
 /* register the plugin */
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (sample_construct);
+XFCE_PANEL_PLUGIN_REGISTER (sample_construct);
 
 
 
diff --git a/panel-plugin/sample.desktop.in.in b/panel-plugin/sample.desktop.in
similarity index 62%
rename from panel-plugin/sample.desktop.in.in
rename to panel-plugin/sample.desktop.in
index c779fa3..1fb91e8 100644
--- a/panel-plugin/sample.desktop.in.in
+++ b/panel-plugin/sample.desktop.in
@@ -4,5 +4,6 @@ Encoding=UTF-8
 _Name=Sample Plugin
 _Comment=Sample plugin for the Xfce panel
 Icon=xfce4-sample-plugin
-X-XFCE-Exec=@libexecdir@/xfce4/panel-plugins/xfce4-sample-plugin
-#X-XFCE-Unique=true
+X-XFCE-Module=sample
+X-XFCE-Internal=false
+X-XFCE-Unique=false
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 96b4c0c..2653181 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,3 +1,3 @@
 panel-plugin/sample.c
 panel-plugin/sample-dialogs.c
-panel-plugin/sample.desktop.in.in
+panel-plugin/sample.desktop.in


More information about the Xfce4-commits mailing list