From aaca0f3489f49588cddeb2a94801d20d64f5e263 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Mon, 16 May 2011 12:23:08 -0400 Subject: [PATCH 2/2] Support building on Android --- .gitignore | 1 + Android.mk | 40 ++++++++++++++++++++++++++++++++++++++++ extensions/Makefile.am | 11 +++++++++++ lib/gibber/Makefile.am | 10 ++++++++++ lib/loudmouth/Makefile.am | 10 ++++++++++ src/Makefile.am | 14 ++++++++++++++ src/main.c | 4 ++++ 7 files changed, 90 insertions(+), 0 deletions(-) create mode 100644 Android.mk diff --git a/.gitignore b/.gitignore index c9ffc6f..2ede58e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ .deps .libs .svn +Android.mk FIXME.out /INSTALL Makefile diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..5c613fd --- /dev/null +++ b/Android.mk @@ -0,0 +1,40 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +TELEPATHY_GABBLE_BUILT_SOURCES := \ + gabble/telepathy-gabble.pc \ + gabble/telepathy-gabble-uninstalled.pc \ + src/Android.mk \ + lib/gibber/Android.mk \ + lib/loudmouth/Android.mk \ + extensions/Android.mk + +telepathy-gabble-configure-real: + cd $(TELEPATHY_GABBLE_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_GABBLE_TOP)/$(CONFIGURE) --host=arm-linux-androideabi \ + --disable-Werror --without-ca-certificates && \ + for file in $(TELEPATHY_GABBLE_BUILT_SOURCES); do \ + rm -f $$file && \ + make -C $$(dirname $$file) $$(basename $$file) ; \ + done + +telepathy-gabble-configure: telepathy-gabble-configure-real + +.PHONY: telepathy-gabble-configure + +CONFIGURE_TARGETS += telepathy-gabble-configure + +#include all the subdirs... +-include $(TELEPATHY_GABBLE_TOP)/src/Android.mk +-include $(TELEPATHY_GABBLE_TOP)/lib/gibber/Android.mk +-include $(TELEPATHY_GABBLE_TOP)/lib/loudmouth/Android.mk +-include $(TELEPATHY_GABBLE_TOP)/extensions/Android.mk diff --git a/extensions/Makefile.am b/extensions/Makefile.am index 9595750..d6c4338 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -91,3 +91,14 @@ _gen/gtypes.h _gen/gtypes-body.h: _gen/all.xml \ $(tools_dir)/glib-gtypes-generator.py Makefile.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-gtypes-generator.py \ $< _gen/gtypes Gabble + +Android.mk: Makefile.am $(BUILT_SOURCES) + androgenizer -:PROJECT telepathy-gabble -:STATIC gabble-extensions -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libgabble_extensions_la_SOURCES) \ + $(nodist_libgabble_extensions_la_SOURCES) \ + -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CFLAGS) \ + -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ + -:LDFLAGS $(libgabble_extensions_la_LIBADD) \ + > $@ diff --git a/lib/gibber/Makefile.am b/lib/gibber/Makefile.am index d02cc5f..f50bfd0 100644 --- a/lib/gibber/Makefile.am +++ b/lib/gibber/Makefile.am @@ -64,3 +64,13 @@ gibber-signals-marshal.list: $(OUR_SOURCES) Makefile.am AM_CFLAGS = $(ERROR_CFLAGS) $(GCOV_CFLAGS) @GLIB_CFLAGS@ @GMODULE_CFLAGS@ -fno-strict-aliasing AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@ + +Android.mk: Makefile.am $(BUILT_SOURCES) + androgenizer -:PROJECT telepathy-gabble -:STATIC gibber -: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/lib/loudmouth/Makefile.am b/lib/loudmouth/Makefile.am index 51c13aa..63aed69 100644 --- a/lib/loudmouth/Makefile.am +++ b/lib/loudmouth/Makefile.am @@ -63,3 +63,13 @@ loudmouth-signals-marshal.list: $(OUR_SOURCES) Makefile.am AM_CFLAGS = $(ERROR_CFLAGS) $(GCOV_CFLAGS) @GLIB_CFLAGS@ @WOCKY_CFLAGS@ AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@ @WOCKY_LIBS@ + +Android.mk: Makefile.am $(BUILT_SOURCES) + androgenizer -:PROJECT telepathy-gabble -:STATIC loudmouth -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libloudmouth_la_SOURCES) \ + -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CFLAGS) \ + -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ + -:LDFLAGS $(libloudmouth_la_LIBADD) \ + > $@ diff --git a/src/Makefile.am b/src/Makefile.am index 9fb8f5cd..8e36f62 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -277,3 +277,17 @@ gabble-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-gabble -:SHARED telepathy-gabble -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libgabble_convenience_la_SOURCES) \ + $(nodist_libgabble_convenience_la_SOURCES) main.c \ + -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CFLAGS) -DBUILD_AS_ANDROID_SERVICE \ + -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) -I../lib \ + -:LDFLAGS $(libgabble_convenience_la_LIBADD) -lgio-2.0 -ldbus-1 \ + -lsoup -lgabble_ext -lnice -lgcrypt -lgnutls -lxml2 -lsqlite3 \ + -:LIBFILTER_STATIC gabble-extentions gibber loudmouth wocky \ + telepathy-yell \ + > $@ diff --git a/src/main.c b/src/main.c index e6fc228..cd740d6 100644 --- a/src/main.c +++ b/src/main.c @@ -21,7 +21,11 @@ #include "gabble.h" int +#ifdef BUILD_AS_ANDROID_SERVICE +telepathy_gabble_main (int argc, +#else main (int argc, +#endif char **argv) { gabble_init (); -- 1.7.7