Re: [PATCH] add support for out-of-tree platform implementation




Philip Van Hoof wrote:
Please fix the .NET and Vala bindings too

On Mon, 2008-05-12 at 17:31 +0100, Rob Taylor wrote:
This allow the passing of 'none' to the --with-platform configure option. The patch also fixes up the python bindings to work in this case. Other bindings will probably also need some simple changes.


Patch attached that fixes .NET. The vala bindings are already broken if you use anything other than gnome-desktop, and I don't really have the time or vala binding knowledge to fix that...

Rob
diff --git a/ChangeLog b/ChangeLog
index 922dc04..265cebf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-05-12  Rob Taylor  <rob taylor codethink co uk>
 
+	* configure.ac: Add --with-platform option 'none'.
+	* bindings/python/Makefile.am: Fix up python bindings to work when built with no platform.
+	* bindings/dotnet/Makefile.am: Don't build platform subdir if platform is none.
+	* tests/vala-demo/Makefile.am: Fix up vala demo to use PLATFORM_LIBS for consistency.
+
+2008-05-12  Rob Taylor  <rob taylor codethink co uk>
+
 	* libtinymail/tny-error.c: Fix documentation
 
 2008-05-12  Rob Taylor  <rob taylor codethink co uk>
diff --git a/bindings/dotnet/Makefile.am b/bindings/dotnet/Makefile.am
index 2d81cf6..4884c49 100644
--- a/bindings/dotnet/Makefile.am
+++ b/bindings/dotnet/Makefile.am
@@ -1,2 +1,5 @@
 EXTRA_DIST = tny-sharp.snk
-SUBDIRS = . tny ui ui-gtk camel platform
+SUBDIRS = . tny ui ui-gtk camel
+ifdef HAVE_PLATFORM
+SUBDIRS += platform
+endif
diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
index 80b53b3..2501f85 100644
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -2,7 +2,7 @@ INCLUDES = $(PYTHON_INCLUDES) $(LIBTINYMAIL_CFLAGS) $(PYGTK_CFLAGS) \
 	$(LIBTINYMAILUI_GTK_CFLAGS) $(TINYMAIL_PYTHON_CFLAGS) \
 	-I$(top_srcdir)/libtinymail -I$(top_srcdir)/libtinymailui \
 	-I$(top_srcdir)/libtinymailui-gtk -I$(top_srcdir)/libtinymail-camel \
-	-I$(top_srcdir)/$(PLATFORMDIR) -I$(top_srcdir)/libtinymail-camel/camel-lite
+	@PLATFORM_CFLAGS@ -I$(top_srcdir)/libtinymail-camel/camel-lite
 
 common_ldflags = -module -avoid-version
 
@@ -46,7 +46,7 @@ camel_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initcamel
 camel_la_LIBADD = $(LIBTINYMAILUI_LIBS) $(LIBTINYMAIL_LIBS) \
         $(TINYMAIL_PYTHON_LIBS) \
         $(top_builddir)/libtinymail/libtinymail-$(API_VERSION).la \
-        $(top_builddir)/$(PLATFORMDIR)/$(PLATFORMDIR)-$(API_VERSION).la \
+        @PLATFORM_LIBS@ \
         $(top_builddir)/libtinymail-camel/libtinymail-camel-$(API_VERSION).la
 camel_la_SOURCES = tinymail-camelmodule.c pytny-session-camel.c
 nodist_camel_la_SOURCES = tinymail-camel-glue.c
diff --git a/configure.ac b/configure.ac
index e35bec5..68beffa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,6 +74,9 @@ enable_deprecated=true
 PLATFORMDIR=libtinymail-gnome-desktop
 PLATFORMSPECIFICNAME=Gnome
 PLATFORM=1
+PLATFORM_LIBS='$(top_builddir)/$(PLATFORMDIR)/$(PLATFORMDIR)-$(API_VERSION).la'
+PLATFORM_CFLAGS='-I$(top_srcdir)/$(PLATFORM)'
+have_platform=yes
 
 dnl ### Debugging ###
 AC_ARG_ENABLE(debug,
@@ -135,6 +138,16 @@ AC_HELP_STRING([--with-platform=gnome-desktop],
         build_demoui=true
         PLATFORM=4
         ;;
+  none)
+	PLATFORMDIR=
+	PLATFORMSPECIFICNAME=
+	build_uigtk=false
+	build_demoui=false
+	PLATFORM=0
+	PLATFORM_LIBS=
+	PLATFORM_CFLAGS=
+	have_platform=no
+	;;
   *) 
 	PLATFORMDIR=${with_platform}
 	PLATFORMSPECIFICNAME=
@@ -147,6 +160,10 @@ esac], [PLATFORMDIR=libtinymail-gnome-desktop
 AC_SUBST(PLATFORMDIR)
 AC_SUBST(PLATFORM)
 AC_SUBST(PLATFORMSPECIFICNAME)
+AC_SUBST(PLATFORM_LIBS)
+AC_SUBST(PLATFORM_CFLAGS)
+
+AM_CONDITIONAL([HAVE_PLATFORM], [test x$have_platform = xyes])
 
 dnl ### Select the html component ##
 AC_ARG_WITH(html-component,
diff --git a/tests/vala-demo/Makefile.am b/tests/vala-demo/Makefile.am
index 34ed325..8612012 100644
--- a/tests/vala-demo/Makefile.am
+++ b/tests/vala-demo/Makefile.am
@@ -37,7 +37,7 @@ tinymail_vala_test_LDADD = \
 	$(top_builddir)/libtinymailui/libtinymailui-$(API_VERSION).la		\
 	$(top_builddir)/libtinymailui-gtk/libtinymailui-gtk-$(API_VERSION).la	\
 	$(top_builddir)/libtinymail-camel/libtinymail-camel-$(API_VERSION).la	\
-	$(top_builddir)/$(PLATFORMDIR)/$(PLATFORMDIR)-$(API_VERSION).la		\
+	@PLATFORM_LIBS@								\
 	$(NULL)
 
 EXTRA_DIST = $(tinymail_vala_test_VALASOURCES) tinymail-vala-test.vala.stamp


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