From cda9e404dc8b558852b31c2a6a8ed10ae6f79453 Mon Sep 17 00:00:00 2001 From: David Schneider Date: Thu, 17 May 2012 15:16:36 -0700 Subject: [PATCH 3/4] Compile plugin as a module. --- autogen.sh | 2 +- configure.ac.in | 7 ++++++- panel-plugin/Makefile.am | 35 ++++++++++++++++------------------- panel-plugin/sample.c | 2 +- panel-plugin/sample.desktop.in | 9 +++++++++ panel-plugin/sample.desktop.in.in | 8 -------- po/POTFILES.in | 2 +- 7 files changed, 34 insertions(+), 31 deletions(-) create mode 100644 panel-plugin/sample.desktop.in delete mode 100644 panel-plugin/sample.desktop.in.in 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 b/panel-plugin/sample.desktop.in new file mode 100644 index 0000000..1fb91e8 --- /dev/null +++ b/panel-plugin/sample.desktop.in @@ -0,0 +1,9 @@ +[Xfce Panel] +Type=X-XFCE-PanelPlugin +Encoding=UTF-8 +_Name=Sample Plugin +_Comment=Sample plugin for the Xfce panel +Icon=xfce4-sample-plugin +X-XFCE-Module=sample +X-XFCE-Internal=false +X-XFCE-Unique=false diff --git a/panel-plugin/sample.desktop.in.in b/panel-plugin/sample.desktop.in.in deleted file mode 100644 index c779fa3..0000000 --- a/panel-plugin/sample.desktop.in.in +++ /dev/null @@ -1,8 +0,0 @@ -[Xfce Panel] -Type=X-XFCE-PanelPlugin -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 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 -- 1.7.9.5