summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Soliverez <alvaro.soliverez@collabora.co.uk>2011-11-02 13:31:17 (GMT)
committerWill Thompson <will.thompson@collabora.co.uk>2011-11-21 14:49:57 (GMT)
commitf312040d789a823a66a3c044ceaf7da3064529fc (patch)
tree441c09bc9c189dd24201fdcbb9609188d5540815
parentb7cfa229c65ecba4d4a5e9e0ea90331e9d5bb269 (diff)
downloadtelepathy-salut-f312040d789a823a66a3c044ceaf7da3064529fc.tar.gz
telepathy-salut-f312040d789a823a66a3c044ceaf7da3064529fc.tar.xz
Support building for Android.
This adds an autogen.sh and configure flag, --disable-submodules, to disable fetching the Wocky submodule (the flag is plural for consistency with other components), adds some missing compiler and linker flags, and adds targets for Androgenizer. Modified from a patch contributed by Derek Foreman. https://bugs.freedesktop.org/show_bug.cgi?id=42515
-rw-r--r--.gitignore1
-rw-r--r--Android.mk37
-rwxr-xr-xautogen.sh36
-rw-r--r--configure.ac9
-rw-r--r--extensions/Makefile.am12
-rw-r--r--lib/gibber/Makefile.am11
-rw-r--r--src/Makefile.am26
-rw-r--r--src/connection.c1
-rw-r--r--src/salut.c4
9 files changed, 124 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index e62cade..509272c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,6 +45,7 @@ ChangeSet
.cvsignore
Thumbs.db
autom4te.cache
+Android.mk
Makefile
Makefile.in
INSTALL
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..a87e498
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,37 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+TELEPATHY_SALUT_BUILT_SOURCES := \
+ src/Android.mk \
+ extensions/Android.mk \
+ lib/gibber/Android.mk
+
+telepathy-salut-configure-real:
+ cd $(TELEPATHY_SALUT_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_SALUT_TOP)/$(CONFIGURE) --host=arm-linux-androideabi \
+ --disable-submodules \
+ --disable-Werror && \
+ for file in $(TELEPATHY_SALUT_BUILT_SOURCES); do \
+ rm -f $$file && \
+ make -C $$(dirname $$file) $$(basename $$file) ; \
+ done
+
+telepathy-salut-configure: telepathy-salut-configure-real
+
+.PHONY: telepathy-salut-configure
+
+CONFIGURE_TARGETS += telepathy-salut-configure
+
+#include all the subdirs...
+-include $(TELEPATHY_SALUT_TOP)/src/Android.mk
+-include $(TELEPATHY_SALUT_TOP)/extensions/Android.mk
+-include $(TELEPATHY_SALUT_TOP)/lib/gibber/Android.mk
diff --git a/autogen.sh b/autogen.sh
index b6dff98..4da1c1f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -16,18 +16,32 @@ fi
autoreconf -i -f
-# Fetch Wocky if needed
-if test ! -f lib/ext/wocky/autogen.sh;
-then
- echo "+ Setting up Wocky submodule"
- git submodule init
-fi
-git submodule update
+#Check if building submodules
+build_submodules=true
+for arg in $*; do
+ case $arg in
+ --disable-submodules)
+ build_submodules=false
+ ;;
+*)
+;;
+esac
+done
+
+if test $build_submodules = true; then
+ # Fetch Wocky if needed
+ if test ! -f lib/ext/wocky/autogen.sh;
+ then
+ echo "+ Setting up Wocky submodule"
+ git submodule init
+ fi
+ git submodule update
-# launch Wocky's autogen.sh
-cd lib/ext/wocky
-sh autogen.sh --no-configure
-cd ../../..
+ # launch Wocky's autogen.sh
+ cd lib/ext/wocky
+ sh autogen.sh --no-configure
+ cd ../../..
+fi
run_configure=true
for arg in $*; do
diff --git a/configure.ac b/configure.ac
index c1751ce..2c2ee9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,7 +158,8 @@ dnl GTK docs
GTK_DOC_CHECK
dnl Check for Glib
-PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.24, gobject-2.0 >= 2.16, gthread-2.0 >= 2.4])
+PKG_CHECK_MODULES(GLIB,
+ [glib-2.0 >= 2.24, gobject-2.0 >= 2.16, gthread-2.0 >= 2.4, gio-2.0])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
@@ -204,6 +205,12 @@ else
AC_MSG_WARN([libuuid not found, falling back to generating random IDs])
fi
+AC_ARG_ENABLE(submodules,
+ AS_HELP_STRING([--disable-submodules],
+ [Use system version of Wocky rather than a submodule]),
+ build_submodules=$enableval,
+ build_submodules=yes )
+
dnl plugins
AC_ARG_ENABLE(plugins,
AC_HELP_STRING([--disable-plugins],
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index de6c256..8e2e767 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -109,3 +109,15 @@ _gen/svc.c _gen/svc.h: _gen/all.xml $(tools_dir)/glib-ginterface-gen.py
--not-implemented-func='tp_dbus_g_method_return_not_implemented' \
--allow-unstable \
$< Salut_Svc_
+
+Android.mk: Makefile.am $(BUILT_SOURCES)
+ androgenizer -:PROJECT telepathy-salut -:SHARED salut-extensions \
+ -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(nodist_libsalut_extensions_la_SOURCES) \
+ $(libsalut_extensions_la_SOURCES) \
+ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
+ -:LDFLAGS $(AM_LDFLAGS) \
+ > $@
diff --git a/lib/gibber/Makefile.am b/lib/gibber/Makefile.am
index 5a048ea..d036c72 100644
--- a/lib/gibber/Makefile.am
+++ b/lib/gibber/Makefile.am
@@ -110,3 +110,14 @@ AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@ @LIBXML2_LIBS@ @WOCKY_LIBS@ @LIBSOUP_LIBS@
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@VALUENAME@\" }," \
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
$< > $@
+
+Android.mk: Makefile.am $(BUILT_SOURCES)
+ androgenizer -:PROJECT telepathy-salut -:STATIC gibber-salut \
+ -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(libgibber_la_SOURCES) \
+ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
+ -:LDFLAGS $(AM_LDFLAGS) \
+ > $@
diff --git a/src/Makefile.am b/src/Makefile.am
index 60552a9..6841adb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -155,6 +155,11 @@ include $(top_srcdir)/tools/check-coding-style.mk
check-local: check-coding-style
# TELEPATHY_GLIB_LIBS is only here so compiling against a static lib succeeds
+telepathy_salut_android_libs = libsalut-convenience.la \
+ -lgibber-salut \
+ $(top_builddir)/extensions/libsalut-extensions.la \
+ -ltelepathy-glib
+
telepathy_salut_LDADD = libsalut-convenience.la \
$(top_builddir)/lib/gibber/libgibber.la \
$(top_builddir)/extensions/libsalut-extensions.la \
@@ -178,6 +183,7 @@ AM_CFLAGS = \
@AVAHI_CFLAGS@ \
@TELEPATHY_GLIB_CFLAGS@ \
@UUID_CFLAGS@ \
+ @LIBSOUP_CFLAGS@ \
$(NULL)
AM_LDFLAGS = \
@@ -190,6 +196,7 @@ AM_LDFLAGS = \
@AVAHI_LIBS@ \
@TELEPATHY_GLIB_LIBS@ \
@UUID_LIBS@ \
+ @LIBSOUP_LIBS@ \
$(NULL)
# Teach it how to make libgibber.la
@@ -237,3 +244,22 @@ enumtypes.c: $(enumtype_sources) Makefile.in
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
$(enumtype_sources) > $@
+
+Android.mk: Makefile.am $(BUILT_SOURCES)
+ androgenizer -:PROJECT telepathy-salut -:STATIC salut-convenience \
+ -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(libsalut_convenience_la_SOURCES) \
+ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
+ -:SHARED telepathy-salut \
+ -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(telepathy_salut_SOURCES) \
+ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) -DBUILD_AS_ANDROID_SERVICE \
+ -:LDFLAGS $(telepathy_salut_android_libs) $(AM_LDFLAGS) \
+ -:LIBFILTER_STATIC salut-convenience \
+ > $@
diff --git a/src/connection.c b/src/connection.c
index 4aa61a9..65ce591 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -26,7 +26,6 @@
#include <ctype.h>
#include <dbus/dbus-protocol.h>
-#include <dbus/dbus-glib-bindings.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
diff --git a/src/salut.c b/src/salut.c
index 161aeae..f257414 100644
--- a/src/salut.c
+++ b/src/salut.c
@@ -21,7 +21,11 @@ salut_create_connection_manager (void)
}
int
+#ifdef BUILD_AS_ANDROID_SERVICE
+salut_main (int argc, char **argv)
+#else
main (int argc, char **argv)
+#endif
{
GLogLevelFlags fatal_mask;
gint ret;