Kaydet (Commit) 68d7b72f authored tarafından Michael Meeks's avatar Michael Meeks

android: share more of the Makefile / build logic

üst b5abb829
...@@ -70,6 +70,28 @@ clean: android_version_setup properties ...@@ -70,6 +70,28 @@ clean: android_version_setup properties
$(ANT) clean $(ANT) clean
rm -rf assets libs $(SODEST) $(OBJLOCAL) 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 # 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 # 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 # you stop and start... No idea if this holds for a device, too. (And you
......
include ../../../config_host.mk include ../../../config_host.mk
BOOTSTRAPDIR=../../Bootstrap
include $(BOOTSTRAPDIR)/Makefile.shared
# The package of this app # The package of this app
APP_PACKAGE=org.libreoffice.android.examples APP_PACKAGE=org.libreoffice.android.examples
# We can't keep assuming APP_DATA_PATH like this, surely this can vary with BOOTSTRAPDIR=../../Bootstrap
# Android versions and whatnot, this is temporary and works at least with the include $(BOOTSTRAPDIR)/Makefile.shared
# 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
# The default target just builds. # The default target just builds.
all: build-ant 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: copy-stuff:
# Then "assets". Let the directory structure under assets mimic # Then "assets". Let the directory structure under assets mimic
# that under solver for now. # that under solver for now.
......
include ../../../config_host.mk 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. # The default target just builds.
all: build-ant all: build-ant
BOOTSTRAPDIR=../../Bootstrap
include $(BOOTSTRAPDIR)/Makefile.shared
# The package of this app # The package of this app
APP_PACKAGE=org.libreoffice APP_PACKAGE=org.libreoffice
link-so: BOOTSTRAPDIR=../../Bootstrap
# Build the single .so for this app include $(BOOTSTRAPDIR)/Makefile.shared
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: copy-stuff:
# Then "assets". Let the directory structure under assets mimic # Then "assets". Let the directory structure under assets mimic
......
...@@ -196,8 +196,7 @@ copy-stuff: buildrcs ...@@ -196,8 +196,7 @@ copy-stuff: buildrcs
cp $(ANDROID_NDK_GDBSERVER) $(SODEST) cp $(ANDROID_NDK_GDBSERVER) $(SODEST)
echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup
build-ant: android_version_setup copy-stuff link-so properties
build-ant: copy-stuff properties
unset JAVA_HOME && $(ANT) debug unset JAVA_HOME && $(ANT) debug
run: run:
......
/* -*- 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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment