From e34e4e5fcf62f69fd82d3b1c15268eef466141ce Mon Sep 17 00:00:00 2001 From: Alvaro Soliverez Date: Thu, 24 Nov 2011 18:09:27 -0300 Subject: [PATCH] Support for building on Android, modified from patches by Derek Foreman and Johnny Lamb --- .gitignore | 1 + Android.mk | 38 ++++++++++++++++++++++++++++++++++++++ configure.ac | 6 ++++-- gabble/Makefile.am | 41 +++++++++++++++++++++++++++-------------- mission-control/Makefile.am | 12 ++++++++++++ salut/Makefile.am | 18 +++++++++++++++--- 6 files changed, 97 insertions(+), 19 deletions(-) create mode 100644 Android.mk diff --git a/.gitignore b/.gitignore index 3d5763b..0052753 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +Android.mk Makefile Makefile.in config.h diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..c1ac105 --- /dev/null +++ b/Android.mk @@ -0,0 +1,38 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +YTSTENUT_PLUGINS_BUILT_SOURCES := \ + mission-control/Android.mk \ + salut/Android.mk \ + gabble/Android.mk + +ytstenut-plugins-configure-real: + cd $(YTSTENUT_PLUGINS_TOP) ; \ + CXX="$(CONFIGURE_CXX)" \ + 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) \ + $(YTSTENUT_PLUGINS_TOP)/$(CONFIGURE) --host=arm-linux-androideabi \ + --disable-spec-documentation --disable-qt4 \ + --disable-Werror && \ + for file in $(YTSTENUT_PLUGINS_BUILT_SOURCES); do \ + rm -f $$file && \ + make -C $$(dirname $$file) $$(basename $$file) ; \ + done + +ytstenut-plugins-configure: ytstenut-plugins-configure-real + +.PHONY: ytstenut-plugins-configure + +CONFIGURE_TARGETS += ytstenut-plugins-configure + +#include all the subdirs... +-include $(YTSTENUT_PLUGINS_TOP)/mission-control/Android.mk +-include $(YTSTENUT_PLUGINS_TOP)/salut/Android.mk +-include $(YTSTENUT_PLUGINS_TOP)/gabble/Android.mk diff --git a/configure.ac b/configure.ac index aef6cbb..f133839 100644 --- a/configure.ac +++ b/configure.ac @@ -60,7 +60,6 @@ AC_SUBST(MISSION_CONTROL_EXECUTABLE) # SALUT PLUGIN PKG_CHECK_MODULES(SALUT, telepathy-salut, HAVE_SALUT=yes, HAVE_SALUT=no) -AC_SUBST(SALUT_LIBS) AC_SUBST(SALUT_CFLAGS) salutplugindir=`pkg-config --variable=plugindir telepathy-salut` AC_SUBST(salutplugindir) @@ -91,7 +90,6 @@ AM_CONDITIONAL([WANT_TWISTED_TESTS], test false != "$TEST_PYTHON") # GABBLE PLUGIN PKG_CHECK_MODULES(GABBLE, telepathy-gabble, HAVE_GABBLE=yes, HAVE_GABBLE=no) -AC_SUBST(GABBLE_LIBS) AC_SUBST(GABBLE_CFLAGS) gabbleplugindir=`pkg-config --variable=plugindir telepathy-gabble` AC_SUBST(gabbleplugindir) @@ -107,6 +105,10 @@ AC_SUBST(GABBLE_EXECUTABLE) # ------------------------------------------------------------------------------ +PKG_CHECK_MODULES(WOCKY, wocky >= 0.0.0) +AC_SUBST(WOCKY_CFLAGS) +AC_SUBST(WOCKY_LIBS) + AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Compile binaries in debug mode])) diff --git a/gabble/Makefile.am b/gabble/Makefile.am index e0ad1bf..43f1173 100644 --- a/gabble/Makefile.am +++ b/gabble/Makefile.am @@ -3,7 +3,8 @@ AM_CFLAGS = \ -DGABBLE \ -I$(top_srcdir)/plugin-base \ $(GABBLE_CFLAGS) \ - $(TELEPATHY_YTSTENUT_CFLAGS) + $(TELEPATHY_YTSTENUT_CFLAGS) \ + $(WOCKY_CFLAGS) plugindir = $(gabbleplugindir) @@ -12,20 +13,32 @@ plugin_LTLIBRARIES = ytstenut-gabble.la AM_LDFLAGS = -module -avoid-version -shared ytstenut_gabble_la_LIBADD = \ - $(GABBLE_LIBS) \ - $(TELEPATHY_YTSTENUT_LIBS) + $(TELEPATHY_YTSTENUT_LIBS) \ + $(WOCKY_LIBS) + +copied_files = \ + ytstenut.c \ + caps-manager.c \ + channel-manager.c \ + utils.c ytstenut_gabble_la_SOURCES = \ - $(top_srcdir)/plugin-base/ytstenut.c \ - $(top_srcdir)/plugin-base/ytstenut.h \ - $(top_srcdir)/plugin-base/caps-manager.c \ - $(top_srcdir)/plugin-base/caps-manager.h \ + $(copied_files) \ status.c \ - status.h \ - message-channel.c \ - message-channel.h \ - $(top_srcdir)/plugin-base/channel-manager.c \ - $(top_srcdir)/plugin-base/channel-manager.h \ - $(top_srcdir)/plugin-base/utils.c \ - $(top_srcdir)/plugin-base/utils.h + message-channel.c + +CLEANFILES = $(copied_files) +Android.mk: Makefile.am $(BUILT_SOURCES) + for i in $(copied_files); do \ + cp $(top_srcdir)/plugin-base/$$i .; \ + done + androgenizer -:PROJECT ytstenut-plugins \ + -:SHARED ytstenut-gabble -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(ytstenut_gabble_la_SOURCES) \ + -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CFLAGS) \ + -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ + -:LDFLAGS $(AM_LDFLAGS) $(ytstenut_gabble_la_LIBADD) -ltelepathy-gabble \ + > $@ diff --git a/mission-control/Makefile.am b/mission-control/Makefile.am index 939c5f1..ec189a6 100644 --- a/mission-control/Makefile.am +++ b/mission-control/Makefile.am @@ -22,3 +22,15 @@ mcp_account_manager_ytstenut_la_LDFLAGS = \ -avoid-version \ -no-undefined \ -export-symbols-regex 'mcp_plugin_ref_nth_object|mcd_plugin_init' + +Android.mk: Makefile.am + androgenizer -:PROJECT ytstenut_plugins \ + -:SHARED mcp-account-manager-ytstenut \ + -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(mcp_account_manager_ytstenut_la_SOURCES) \ + -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CFLAGS) \ + -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ + -:LDFLAGS $(mcp_account_manager_ytstenut_la_LIBADD) \ + > $@ diff --git a/salut/Makefile.am b/salut/Makefile.am index 20ea5ac..8ec5fa0 100644 --- a/salut/Makefile.am +++ b/salut/Makefile.am @@ -3,7 +3,8 @@ AM_CFLAGS = \ -DSALUT \ -I$(top_srcdir)/plugin-base \ $(SALUT_CFLAGS) \ - $(TELEPATHY_YTSTENUT_CFLAGS) + $(TELEPATHY_YTSTENUT_CFLAGS) \ + $(WOCKY_CFLAGS) plugindir = $(salutplugindir) @@ -12,8 +13,8 @@ plugin_LTLIBRARIES = ytstenut-salut.la AM_LDFLAGS = -module -avoid-version -shared ytstenut_salut_la_LIBADD = \ - $(SALUT_LIBS) \ - $(TELEPATHY_YTSTENUT_LIBS) + $(TELEPATHY_YTSTENUT_LIBS) \ + $(WOCKY_LIBS) ytstenut_salut_la_SOURCES = \ $(top_srcdir)/plugin-base/ytstenut.c \ @@ -28,3 +29,14 @@ ytstenut_salut_la_SOURCES = \ $(top_srcdir)/plugin-base/channel-manager.h \ $(top_srcdir)/plugin-base/utils.c \ $(top_srcdir)/plugin-base/utils.h + +Android.mk: Makefile.am $(BUILT_SOURCES) + androgenizer -:PROJECT ytstenut-plugins \ + -:SHARED ytstenut-salut -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(ytstenut_salut_la_SOURCES) \ + -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CFLAGS) -I../../wocky \ + -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) -DSALUT \ + -:LDFLAGS $(AM_LDFLAGS) $(ytstenut_salut_la_LIBADD) -ltelepathy-salut \ + > $@ -- 1.7.7.3