diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-12-14 11:50:22 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-02-15 10:52:38 +0000 |
commit | 68d7b72fcc7a1636a93e5bfb2295fd24df8685c3 (patch) | |
tree | 512f6afc836ddd6b30705f9e744180db3f3a6938 /android | |
parent | b5abb829ed5bb151dfbce595c6cd86b45e373f38 (diff) |
android: share more of the Makefile / build logic
Diffstat (limited to 'android')
-rw-r--r-- | android/Bootstrap/Makefile.shared | 22 | ||||
-rw-r--r-- | android/experimental/DocumentLoader/Makefile | 43 | ||||
-rw-r--r-- | android/experimental/LibreOffice4Android/Makefile | 23 | ||||
-rw-r--r-- | android/qa/desktop/Makefile | 3 | ||||
-rw-r--r-- | android/qa/desktop/native-code.cxx | 105 |
5 files changed, 132 insertions, 64 deletions
diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared index 0fa264a5eab5..01e8aa301225 100644 --- a/android/Bootstrap/Makefile.shared +++ b/android/Bootstrap/Makefile.shared @@ -70,6 +70,28 @@ clean: android_version_setup properties $(ANT) clean rm -rf assets libs $(SODEST) $(OBJLOCAL) +# +# Build / link the single .so for this app +# +LIBS = \ + -Wl,--start-group \ + $(wildcard $(OUTDIR)/lib/lib*.a) \ + -Wl,--end-group + +WHOLELIBS = \ + -Wl,--whole-archive \ + $(addprefix -l,$(strip \ + juh \ + )) \ + -Wl,--no-whole-archive + +link-so: + mkdir -p $(OBJLOCAL) + $(CXX) -Wl,-Map,liblo-native-code.map -Wl,--gc-sections -Wl,--version-script=../../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz + mkdir -p $(SODEST) + $(STRIP) -o $(SODEST)/liblo-native-code.so $(OBJLOCAL)/liblo-native-code.so + + # If you reinstall an app several times *on the emulator*, even if you # uninstall it between, disk space seems to leak that won't get recycled until # you stop and start... No idea if this holds for a device, too. (And you diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile index 193184efdd4c..1333aaf43619 100644 --- a/android/experimental/DocumentLoader/Makefile +++ b/android/experimental/DocumentLoader/Makefile @@ -1,54 +1,15 @@ include ../../../config_host.mk -BOOTSTRAPDIR=../../Bootstrap -include $(BOOTSTRAPDIR)/Makefile.shared - # The package of this app APP_PACKAGE=org.libreoffice.android.examples -# We can't keep assuming APP_DATA_PATH like this, surely this can vary with -# Android versions and whatnot, this is temporary and works at least with the -# SDK 16 emulator... - -# Probably would be best to just stop fooling around with the possibilities to -# set various stuff with the -env command line parameters (and environment -# variables?) and in a plethora of rc files, and hardcode construction of -# *all* required pathnames based on the app installation location for Android -# (and iOS), etc. We don't really win anything by having so many layers of -# configurability on platforms like Android and iOS where apps based on LO -# code are very much self-contained pre-packaged thingies. -APP_DATA_PATH=/data/data/$(APP_PACKAGE) - -SODEST=libs/$(ANDROID_APP_ABI) -OBJLOCAL=obj/local/$(ANDROID_APP_ABI) - -define COPYJAR -cp $(1) libs -endef - -LIBS = \ - -Wl,--start-group \ - $(wildcard $(OUTDIR)/lib/lib*.a) \ - -Wl,--end-group - -WHOLELIBS = \ - -Wl,--whole-archive \ - $(addprefix -l,$(strip \ - juh \ - )) \ - -Wl,--no-whole-archive +BOOTSTRAPDIR=../../Bootstrap +include $(BOOTSTRAPDIR)/Makefile.shared # The default target just builds. all: build-ant -link-so: -# Build the single .so for this app - mkdir -p $(OBJLOCAL) - $(CXX) -Wl,-Map,liblo-native-code.map -Wl,--gc-sections -Wl,--version-script=../../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz - mkdir -p $(SODEST) - $(STRIP) -o $(SODEST)/liblo-native-code.so $(OBJLOCAL)/liblo-native-code.so - copy-stuff: # Then "assets". Let the directory structure under assets mimic # that under solver for now. diff --git a/android/experimental/LibreOffice4Android/Makefile b/android/experimental/LibreOffice4Android/Makefile index 284e9c38b384..24ebbe589ab5 100644 --- a/android/experimental/LibreOffice4Android/Makefile +++ b/android/experimental/LibreOffice4Android/Makefile @@ -1,33 +1,14 @@ include ../../../config_host.mk -LIBS = \ - -Wl,--start-group \ - $(wildcard $(OUTDIR)/lib/lib*.a) \ - -Wl,--end-group - -WHOLELIBS = \ - -Wl,--whole-archive \ - $(addprefix -l,$(strip \ - juh \ - )) \ - -Wl,--no-whole-archive - # The default target just builds. all: build-ant -BOOTSTRAPDIR=../../Bootstrap -include $(BOOTSTRAPDIR)/Makefile.shared - # The package of this app APP_PACKAGE=org.libreoffice -link-so: -# Build the single .so for this app - mkdir -p $(OBJLOCAL) - $(CXX) -Wl,-Map,liblo-native-code.map -Wl,--gc-sections -Wl,--version-script=../../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz - mkdir -p $(SODEST) - $(STRIP) -o $(SODEST)/liblo-native-code.so $(OBJLOCAL)/liblo-native-code.so +BOOTSTRAPDIR=../../Bootstrap +include $(BOOTSTRAPDIR)/Makefile.shared copy-stuff: # Then "assets". Let the directory structure under assets mimic diff --git a/android/qa/desktop/Makefile b/android/qa/desktop/Makefile index 37f283e32a5a..f90a4220172c 100644 --- a/android/qa/desktop/Makefile +++ b/android/qa/desktop/Makefile @@ -196,8 +196,7 @@ copy-stuff: buildrcs cp $(ANDROID_NDK_GDBSERVER) $(SODEST) echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup - -build-ant: copy-stuff properties +build-ant: android_version_setup copy-stuff link-so properties unset JAVA_HOME && $(ANT) debug run: diff --git a/android/qa/desktop/native-code.cxx b/android/qa/desktop/native-code.cxx new file mode 100644 index 000000000000..22c9a7e04ab7 --- /dev/null +++ b/android/qa/desktop/native-code.cxx @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "osl/detail/android-bootstrap.h" + +extern "C" +{ + extern void * animcore_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * avmedia_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * dba_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * dbaxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * evtatt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * fileacc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * frm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * fsstorage_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * fwk_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * fwl_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * fwm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * hwp_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * hyphen_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * lng_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * lnth_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * lotuswordpro_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * oox_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sb_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * scd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * scfilt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sdd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * smd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * spell_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * svgfilter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * sw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * swd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * t602filter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * textfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * unoxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * unordf_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * wpftdraw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * wpftwriter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * xmlfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * xmlsecurity_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * xo_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); + extern void * xof_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey ); +} + +extern "C" +__attribute__ ((visibility("default"))) +const lib_to_component_mapping * +lo_get_libmap(void) +{ + static lib_to_component_mapping map[] = { + { "libanimcorelo.a", animcore_component_getFactory }, + { "libavmedialo.a", avmedia_component_getFactory }, + { "libdbalo.a", dba_component_getFactory }, + { "libdbaxmllo.a", dbaxml_component_getFactory }, + { "libevtattlo.a", evtatt_component_getFactory }, + { "libfileacc.a", fileacc_component_getFactory }, + { "libfrmlo.a", frm_component_getFactory }, + { "libfsstorage.uno.a", fsstorage_component_getFactory }, + { "libfwklo.a", fwk_component_getFactory }, + { "libfwllo.a", fwl_component_getFactory }, + { "libfwmlo.a", fwm_component_getFactory }, + { "libhwplo.a", hwp_component_getFactory }, + { "libhyphenlo.a", hyphen_component_getFactory }, + { "liblnglo.a", lng_component_getFactory }, + { "liblnthlo.a", lnth_component_getFactory }, + { "liblwpftlo.a", lotuswordpro_component_getFactory }, + { "libooxlo.a", oox_component_getFactory }, + { "libscdlo.a", scd_component_getFactory }, + { "libscfiltlo.a", scfilt_component_getFactory }, + { "libsblo.a", sb_component_getFactory }, + { "libsclo.a", sc_component_getFactory }, + { "libsddlo.a", sdd_component_getFactory }, + { "libsdlo.a", sd_component_getFactory }, + { "libsmdlo.a", smd_component_getFactory }, + { "libsmlo.a", sm_component_getFactory }, + { "libsvgfilterlo.a", svgfilter_component_getFactory }, + { "libswdlo.a", swd_component_getFactory }, + { "libswlo.a", sw_component_getFactory }, + { "libt602filterlo.a", t602filter_component_getFactory }, + { "libtextfdlo.a", textfd_component_getFactory }, + { "libunordflo.a", unordf_component_getFactory }, + { "libunoxmllo.a", unoxml_component_getFactory }, + { "libwpftdrawlo.a", wpftdraw_component_getFactory }, + { "libwpftwriterlo.a", wpftwriter_component_getFactory }, + { "libxmlfdlo.a", xmlfd_component_getFactory }, + { "libxmlsecurity.a", xmlsecurity_component_getFactory }, + { "libxoflo.a", xof_component_getFactory }, + { "libxolo.a", xo_component_getFactory }, + { NULL, NULL } + }; + + return map; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |