[gnote] don't link "sharp" modules into plugins.



commit bd4ce935f8847b8759803fa0ab446a508a1dd0ad
Author: Hubert Figuiere <hub figuiere net>
Date:   Thu May 28 15:39:29 2009 -0400

    don't link "sharp" modules into plugins.
---
 src/Makefile.am                     |    2 ++
 src/addinmanager.cpp                |   22 ++++++++++++++++++++++
 src/addins/bugzilla/Makefile.am     |    1 -
 src/addins/exporttohtml/Makefile.am |    3 ---
 src/sharp/fileinfo.cpp              |    4 ++++
 src/sharp/fileinfo.hpp              |    3 +++
 src/sharp/streamwriter.cpp          |    3 +++
 src/sharp/streamwriter.hpp          |    2 ++
 src/sharp/xsltargumentlist.cpp      |    1 +
 src/sharp/xsltargumentlist.hpp      |    2 ++
 src/sharp/xsltransform.cpp          |    2 ++
 src/sharp/xsltransform.hpp          |    2 ++
 12 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 53d5df0..0db092c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -8,6 +8,7 @@ INCLUDES = -I$(top_srcdir)
 AM_CPPFLAGS= LIBGTKMM_CFLAGS@ @LIBGLIBMM_CFLAGS@ \
 	@GCONF_CFLAGS@ @GTK_CFLAGS@ \
 	@GTKSPELL_CFLAGS@ @LIBXML_CFLAGS@ \
+	@LIBXSLT_CFLAGS@ \
 	-DGNOTE_LOCALEDIR=\"@GNOTE_LOCALEDIR \" \
 	-DDATADIR=\"$(datadir)\" -DLIBDIR=\"$(libdir)\"
 
@@ -15,6 +16,7 @@ AM_LDFLAGS=-Wl,--export-dynamic
 
 GNOTE_LIBS = libgnote.a @LIBGLIBMM_LIBS@ @LIBGTKMM_LIBS@ \
 	@GCONF_LIBS@ @BOOST_FILESYSTEM_LIBS@ @BOOST_REGEX_LIBS@ \
+	@LIBXSLT_LIBS@ \
 	@GTKSPELL_LIBS@ @GTK_LIBS@ \
 	-luuid -L$(top_builddir)/libtomboy -ltomboy
 
diff --git a/src/addinmanager.cpp b/src/addinmanager.cpp
index 6aec7f2..750c11b 100644
--- a/src/addinmanager.cpp
+++ b/src/addinmanager.cpp
@@ -32,6 +32,28 @@
 #include "notebooks/notebookapplicationaddin.hpp"
 #include "notebooks/notebooknoteaddin.hpp"
 
+
+#if 1
+
+// HACK to make sure we link the modules needed only for addins
+
+#include "sharp/fileinfo.hpp"
+#include "sharp/streamwriter.hpp"
+#include "sharp/xsltransform.hpp"
+#include "sharp/xsltargumentlist.hpp"
+
+bool links[] = {
+  sharp::FileInfoLink_,
+  sharp::StreamWriterLink_,
+  sharp::XslTransformLink_,
+  sharp::XsltArgumentListLink_,
+  false
+};
+
+
+#endif
+
+
 namespace gnote {
 
 #define REGISTER_BUILTIN_NOTE_ADDIN(klass) \
diff --git a/src/addins/bugzilla/Makefile.am b/src/addins/bugzilla/Makefile.am
index c8962d3..8c86327 100644
--- a/src/addins/bugzilla/Makefile.am
+++ b/src/addins/bugzilla/Makefile.am
@@ -14,5 +14,4 @@ bugzilla_la_SOURCES = bugzillanoteaddin.hpp bugzillanoteaddin.cpp \
 	bugzillalink.hpp bugzillalink.cpp \
 	bugzillapreferencesfactory.hpp \
 	bugzillapreferences.hpp bugzillapreferences.cpp \
-	$(srcdir)/../../sharp/fileinfo.cpp \
 	$(NULL)
diff --git a/src/addins/exporttohtml/Makefile.am b/src/addins/exporttohtml/Makefile.am
index f6df692..7858b45 100644
--- a/src/addins/exporttohtml/Makefile.am
+++ b/src/addins/exporttohtml/Makefile.am
@@ -15,9 +15,6 @@ exporttohtml_la_LIBADD = @LIBXSLT_LIBS@
 exporttohtml_la_SOURCES = exporttohtmlnoteaddin.hpp exporttohtmlnoteaddin.cpp \
 	exporttohtmldialog.hpp exporttohtmldialog.cpp \
 	notenameresolver.hpp \
-	$(srcdir)/../../sharp/streamwriter.cpp \
-	$(srcdir)/../../sharp/xsltransform.cpp \
-	$(srcdir)/../../sharp/xsltargumentlist.cpp \
 	$(NULL)
 
 EXTRA_DIST = exporttohtml.xsl
diff --git a/src/sharp/fileinfo.cpp b/src/sharp/fileinfo.cpp
index fa6a1f8..52d2760 100644
--- a/src/sharp/fileinfo.cpp
+++ b/src/sharp/fileinfo.cpp
@@ -30,6 +30,10 @@
 
 namespace sharp {
 
+
+  bool FileInfoLink_ = true;
+
+
   FileInfo::FileInfo(const std::string & s)
     : m_path(s)
   {
diff --git a/src/sharp/fileinfo.hpp b/src/sharp/fileinfo.hpp
index b046129..d14619e 100644
--- a/src/sharp/fileinfo.hpp
+++ b/src/sharp/fileinfo.hpp
@@ -32,6 +32,9 @@
 namespace sharp {
 
 
+  extern bool FileInfoLink_;
+
+
 class FileInfo
 {
 public:
diff --git a/src/sharp/streamwriter.cpp b/src/sharp/streamwriter.cpp
index 613eda5..732a54c 100644
--- a/src/sharp/streamwriter.cpp
+++ b/src/sharp/streamwriter.cpp
@@ -32,6 +32,9 @@
 
 namespace sharp {
 
+
+  bool StreamWriterLink_ = true;
+
 StreamWriter::StreamWriter()
   : m_file(NULL)
 {
diff --git a/src/sharp/streamwriter.hpp b/src/sharp/streamwriter.hpp
index facc6d4..8993c81 100644
--- a/src/sharp/streamwriter.hpp
+++ b/src/sharp/streamwriter.hpp
@@ -36,6 +36,8 @@
 namespace sharp {
 
 
+  extern bool StreamWriterLink_;
+
 class StreamWriter
 //  : public TextWriter
 {
diff --git a/src/sharp/xsltargumentlist.cpp b/src/sharp/xsltargumentlist.cpp
index 0d11db4..ab1070c 100644
--- a/src/sharp/xsltargumentlist.cpp
+++ b/src/sharp/xsltargumentlist.cpp
@@ -32,6 +32,7 @@
 
 namespace sharp {
 
+  bool XsltArgumentListLink_ = true;
 
 void XsltArgumentList::add_param(const char* name, const char * /*uri*/, const std::string & value)
 {
diff --git a/src/sharp/xsltargumentlist.hpp b/src/sharp/xsltargumentlist.hpp
index 70dfd58..907469d 100644
--- a/src/sharp/xsltargumentlist.hpp
+++ b/src/sharp/xsltargumentlist.hpp
@@ -34,6 +34,8 @@
 
 namespace sharp {
 
+  extern bool XsltArgumentListLink_;
+
 /** argument list for %XslTransform */
 class XsltArgumentList
 {
diff --git a/src/sharp/xsltransform.cpp b/src/sharp/xsltransform.cpp
index adf23d1..45ae362 100644
--- a/src/sharp/xsltransform.cpp
+++ b/src/sharp/xsltransform.cpp
@@ -33,6 +33,8 @@
 
 namespace sharp {
 
+  bool XslTransformLink_ = true;;
+
 
 XslTransform:: XslTransform()
   : m_stylesheet(NULL)
diff --git a/src/sharp/xsltransform.hpp b/src/sharp/xsltransform.hpp
index 6140034..5699b41 100644
--- a/src/sharp/xsltransform.hpp
+++ b/src/sharp/xsltransform.hpp
@@ -40,6 +40,8 @@
 
 namespace sharp {
 
+  extern bool XslTransformLink_;
+
 class XmlResolver;
 
 class XslTransform



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]