summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Soliverez <alvaro.soliverez@collabora.co.uk>2011-11-14 17:19:51 -0300
committerWill Thompson <will.thompson@collabora.co.uk>2011-11-21 18:48:20 +0000
commit58ff362a133ec6625f23e89b175f3bc8374218f2 (patch)
tree7d5279b6410db4414d0682e8e08df0e73e8a32c0
parent652eb046e351d5939998efd97b0b053098ef6ac3 (diff)
Support building for Android, modified from an original patch by Derek Foreman
https://bugs.freedesktop.org/show_bug.cgi?id=42508
-rw-r--r--.gitignore1
-rw-r--r--Android.mk40
-rw-r--r--mission-control-plugins/Makefile.am11
-rw-r--r--mission-control-plugins/loader.c11
-rw-r--r--server/Makefile.am14
-rw-r--r--server/mc-server.c8
-rw-r--r--src/Makefile.am11
-rw-r--r--util/Makefile.am17
8 files changed, 110 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 70852b92..85b51946 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,6 +31,7 @@
/doc/reference/mission-control-plugins/*.txt
.libs
.deps
+Android.mk
Makefile
Makefile.in
_gen/
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 00000000..e16fb6be
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,40 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+TELEPATHY_MISSION_CONTROL_BUILT_SOURCES := \
+ mission-control.pc \
+ src/Android.mk \
+ server/Android.mk \
+ mission-control-plugins/Android.mk \
+ util/Android.mk
+
+telepathy-mission-control-configure-real:
+ cd $(TELEPATHY_MISSION_CONTROL_TOP) ; \
+ CC="$(CONFIGURE_CC)" \
+ CFLAGS="$(CONFIGURE_CFLAGS)" \
+ LD=$(TARGET_LD) \
+ LDFLAGS="$(CONFIGURE_LDFLAGS)" \
+ CPP=$(CONFIGURE_CPP) \
+ CPPFLAGS="$(CONFIGURE_CPPFLAGS)" \
+ PKG_CONFIG_LIBDIR="$(CONFIGURE_PKG_CONFIG_LIBDIR)" \
+ PKG_CONFIG_TOP_BUILD_DIR=$(PKG_CONFIG_TOP_BUILD_DIR) \
+ $(TELEPATHY_MISSION_CONTROL_TOP)/$(CONFIGURE) --host=arm-linux-androideabi \
+ --disable-gtk-doc && \
+ for file in $(TELEPATHY_MISSION_CONTROL_BUILT_SOURCES); do \
+ rm -f $$file && \
+ make -C $$(dirname $$file) $$(basename $$file) ; \
+ done
+
+telepathy-mission-control-configure: telepathy-mission-control-configure-real
+
+.PHONY: telepathy-mission-control-configure
+
+CONFIGURE_TARGETS += telepathy-mission-control-configure
+
+#include all the subdirs...
+-include $(TELEPATHY_MISSION_CONTROL_TOP)/src/Android.mk
+-include $(TELEPATHY_MISSION_CONTROL_TOP)/util/Android.mk
+-include $(TELEPATHY_MISSION_CONTROL_TOP)/server/Android.mk
+-include $(TELEPATHY_MISSION_CONTROL_TOP)/mission-control-plugins/Android.mk
+-include $(TELEPATHY_MISSION_CONTROL_TOP)/utils/Android.mk
diff --git a/mission-control-plugins/Makefile.am b/mission-control-plugins/Makefile.am
index dfbb2cbf..0a0ba614 100644
--- a/mission-control-plugins/Makefile.am
+++ b/mission-control-plugins/Makefile.am
@@ -61,6 +61,17 @@ libmission_control_plugins_la_SOURCES = \
BUILT_SOURCES = $(nodist_libmission_control_plugins_la_SOURCES)
+Android.mk: Makefile.am $(BUILT_SOURCES)
+ androgenizer -:PROJECT telepathy-mission-control \
+ -:SHARED libmission-control-plugins \
+ -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(BUILT_SOURCES) $(libmission_control_plugins_la_SOURCES) \
+ -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \
+ -:LDFLAGS $(libmission_control_plugins_la_LIBADD) \
+ > $@
+
CLEANFILES = $(BUILT_SOURCES)
%-signals-marshal.h: %-signals-marshal.list Makefile
diff --git a/mission-control-plugins/loader.c b/mission-control-plugins/loader.c
index f7de04c1..7fa600a6 100644
--- a/mission-control-plugins/loader.c
+++ b/mission-control-plugins/loader.c
@@ -52,6 +52,13 @@ static gboolean debugging = FALSE;
G_STMT_START { if (debugging || mcp_is_debugging (MCP_DEBUG_LOADER)) \
g_debug ("%s " format, G_STRLOC, ##__VA_ARGS__); } G_STMT_END
+/* Android's build system prefixes the plugins with lib */
+#ifndef __BIONIC__
+#define PLUGIN_PREFIX "mcp-"
+#else
+#define PLUGIN_PREFIX "libmcp-"
+#endif
+
/**
* mcp_set_debug:
* @debug: whether to log debug output
@@ -146,9 +153,9 @@ mcp_read_dir (const gchar *path)
gchar *full_path;
GModule *module;
- if (!g_str_has_prefix (entry, "mcp-"))
+ if (!g_str_has_prefix (entry, PLUGIN_PREFIX))
{
- DEBUG ("%s isn't a plugin (doesn't start with mcp-)", entry);
+ DEBUG ("%s isn't a plugin (doesn't start with " PLUGIN_PREFIX ")", entry);
continue;
}
diff --git a/server/Makefile.am b/server/Makefile.am
index c363853a..ba734500 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -36,7 +36,21 @@ mission_control_5_SOURCES = mc-server.c
mission_control_5_LDADD = \
$(GLIB_LIBS) \
$(TELEPATHY_LIBS) \
+ $(DBUS_LIBS) \
$(top_builddir)/src/libmissioncontrol-server.la \
$(top_builddir)/mission-control-plugins/libmission-control-plugins.la
+Android.mk: Makefile.am
+ androgenizer -:PROJECT telepathy-mission-control \
+ -:SHARED libmission-control-5 -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(mission_control_5_SOURCES) \
+ -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \
+ -DBUILD_AS_ANDROID_SERVICE \
+ -:LDFLAGS $(mission_control_5_LDADD) \
+ -:LIBFILTER_STATIC missioncontrol-server mission-control-plugins \
+ mcclient \
+ > $@
+
endif
diff --git a/server/mc-server.c b/server/mc-server.c
index a7114334..a830c81e 100644
--- a/server/mc-server.c
+++ b/server/mc-server.c
@@ -33,6 +33,10 @@
static TpDebugSender *debug_sender;
+#ifdef BUILD_AS_ANDROID_SERVICE
+int telepathy_mission_control_main (int argc, char **argv);
+#endif
+
static void
on_abort (McdService * mcd)
{
@@ -46,7 +50,11 @@ on_abort (McdService * mcd)
}
int
+#ifdef BUILD_AS_ANDROID_SERVICE
+telepathy_mission_control_main (int argc, char **argv)
+#else
main (int argc, char **argv)
+#endif
{
McdService *mcd;
diff --git a/src/Makefile.am b/src/Makefile.am
index 781bdef3..9f9f06a3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -279,6 +279,17 @@ EXTRA_DIST = \
mcd-signals-marshal.list \
stamp-mcd-enum-types.h
+Android.mk: Makefile.am $(nodist_libmcd_convenience_la_SOURCES)
+ androgenizer -:PROJECT telepathy-mission-control \
+ -:STATIC libmissioncontrol-server \
+ -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(libmcd_convenience_la_SOURCES) $(nodist_libmcd_convenience_la_SOURCES) \
+ -:CFLAGS $(DEFAULT_INCLUDES) $(INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
+ -:LDFLAGS $(libmcd_convenience_la_LIBADD) \
+ > $@
+
# ---- telepathy-glib-style code generation ----
tools_dir = $(top_srcdir)/tools
diff --git a/util/Makefile.am b/util/Makefile.am
index ba595af4..7df5bf6c 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -1,13 +1,17 @@
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(DBUS_CFLAGS) \
+ $(LIBFFI_CFLAGS) \
$(GLIB_CFLAGS) \
+ $(GIO_CFLAGS) \
$(TELEPATHY_CFLAGS)
LDADD = \
+ $(LIBFFI_LIBS) \
$(GLIB_LIBS) \
$(DBUS_LIBS) \
- $(TELEPATHY_LIBS)
+ $(TELEPATHY_LIBS) \
+ $(GIO_LIBS)
AM_CFLAGS = $(ERROR_CFLAGS)
@@ -27,3 +31,14 @@ CLEANFILES = $(man1_MANS)
mc-wait-for-name.1: mc-wait-for-name.1.in Makefile
$(AM_V_GEN)sed -e 's![@]bindir[@]!@bindir@!g' < $< > $@
+
+Android.mk: Makefile.am
+ androgenizer -:PROJECT telepathy_mission_controll \
+ -:EXECUTABLE mc-tool -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(mc_tool_SOURCES) \
+ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
+ -:LDFLAGS $(mc_tool_LDADD) \
+ > $@