Kaydet (Commit) 5476c14d authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Adapt to disable-dynloading style

No need to load any native libraries here any more.

For now, using the same native-code.cxx as over in ../DocumentLoader
works. In other words, we end up with the same code in
liblo-native-code.so. This will obviously change if/when the UNO APIs
that are called start to differ.

Change-Id: Ia47ce833c5a290a93986005f92e981c89f63bf71
üst 3a5d6a9a
include ../../../config_host.mk
include ../../Bootstrap/Makefile.shared
# The package of this app
APP_PACKAGE=org.libreoffice
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
include ../../Bootstrap/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,--stats -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)
cp $(OBJLOCAL)/liblo-native-code.so $(SODEST)
$(STRIP) --strip-debug $(SODEST)/liblo-native-code.so
copy-stuff:
# First always clean
rm -rf libs $(OBJLOCAL)
mkdir -p $(SODEST) $(OBJLOCAL)
#
# Copy shared libraries (including UNO components) we need to
# libs/$(ANDROID_APP_ABI) so that ant will include them in the .apk.
#
# Copy them to obj/local/$(ANDROID_APP_ABI), too, where gdb will look for
# them.
#
for F in $(strip \
basegfxlo \
bootstrap.uno \
chartcontrollerlo \
chartcorelo \
comphelpgcc3 \
dbaxmllo \
dbtoolslo \
expwrap.uno \
frmlo \
gcc3_uno \
i18nisolang1gcc3 \
icudatalo \
icui18nlo \
iculelo \
icuuclo \
introspection.uno \
java_uno \
juh \
juhx \
jvmaccessgcc3 \
jvmfwk \
libotouchlo \
lo-bootstrap \
localedata_en \
localedata_es \
localedata_euro \
localedata_others \
lwpftlo \
mergedlo \
msfilterlo \
mswordlo \
ooxlo \
reflection.uno \
reg \
sclo \
sclo \
scdlo \
scfiltlo \
sdlo \
sddlo \
smdlo \
stocservices.uno \
store \
svgfilterlo \
swdlo \
swlo \
swdlo \
t602filterlo \
textinstream.uno \
tllo \
ucbhelper4gcc3 \
ucppkg1 \
uno_cppu \
uno_cppuhelpergcc3 \
uno_sal \
uno_salhelpergcc3 \
uno_cppuhelpergcc3 \
unordflo \
unoxmllo \
vbahelperlo \
vbaswobj.uno \
wpftdrawlo \
wpftwriterlo \
xml2 \
xmlfdlo \
xmlreader \
xmlsecurity \
xoflo \
xslt \
); do \
$(call COPYSO,$(OUTDIR)/lib/lib$${F}.so); \
done
#
# Then the shared GNU C++ library
$(call COPYSO,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/$(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)libs/$(ANDROID_APP_ABI)/libgnustl_shared.so)
#
# Then other "assets". Let the directory structure under assets mimic
# Then "assets". Let the directory structure under assets mimic
# that under solver for now.
#
# Please note that I have no idea what all of this is really necessary and for
......@@ -195,10 +129,11 @@ copy-stuff:
#
# Then gdbserver and gdb.setup so that we can debug with ndk-gdb.
#
mkdir -p $(SODEST)
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: copy-stuff link-so properties
echo sdk.dir=$(ANDROID_SDK_HOME) >../../abs-lib/local.properties
# ActionBarSherlock uses the v4 support library, apparently one needs to copy
# it like this for it to be found
......@@ -221,6 +156,4 @@ build-ant: copy-stuff properties
unset JAVA_HOME && $(ANT) debug
run:
# /data/local/tmp/sample-document.odt
# add -e lo-strace to strace
adb shell am start -n $(APP_PACKAGE)/.ui.LibreOfficeUIActivity -e lo-strace -e input /assets/test1.odt
adb shell am start -n $(APP_PACKAGE)/.ui.LibreOfficeUIActivity -e input /assets/test1.odt
/* -*- 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 * avmedia_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 * 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[] = {
{ "libavmedialo.a", avmedia_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: */
......@@ -961,12 +961,6 @@ public class DocumentLoader
// Avoid all the old style OSL_TRACE calls especially in vcl
Bootstrap.putenv("SAL_LOG=+WARN+INFO-INFO.legacy.osl");
// Load a lot of shlibs here explicitly in advance because that
// makes debugging work better, sigh
Bootstrap.dlopen("libmergedlo.so");
Bootstrap.dlopen("libswdlo.so");
Bootstrap.dlopen("libswlo.so");
// Log.i(TAG, "Sleeping NOW");
// Thread.sleep(20000);
......
......@@ -139,11 +139,6 @@ public class LibreOfficeUIActivity extends SherlockActivity implements ActionBar
Bootstrap.putenv("SAL_LOG=yes");
// Load a lot of shlibs here explicitly in advance because that
// makes debugging work better, sigh
Bootstrap.dlopen("libmergedlo.so");
Bootstrap.dlopen("libswdlo.so");
Bootstrap.dlopen("libswlo.so");
}
public void createUI(){
......
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