android: share more common Makefile pieces between a couple of users
Try to start consolidating the complexity here. generate Application.mk to specify the required ABI fold common distro-config pieces out of README
This commit is contained in:
22
README.cross
22
README.cross
@@ -348,10 +348,8 @@ CXX_FOR_BUILD=ccache /Xcode3/usr/bin/g++-4.0 -mmacosx-version-min=10.4
|
||||
--build=x86_64-apple-darwin11
|
||||
--disable-zenity
|
||||
--enable-werror
|
||||
--with-distro=LibreOfficeAndroid
|
||||
--disable-python
|
||||
--without-helppack-integration
|
||||
--without-myspell-dicts
|
||||
--with-distro=LibreOfficeAndroid
|
||||
--with-java
|
||||
|
||||
And here is an autogen.lastrun for Android when cross-compiling from Linux:
|
||||
@@ -363,12 +361,24 @@ CXX_FOR_BUILD=ccache g++
|
||||
--with-ant-home=/opt/apache-ant-1.8.2
|
||||
--build=x86_64-unknown-linux-gnu
|
||||
--disable-zenity
|
||||
--with-distro=LibreOfficeAndroid
|
||||
--disable-python
|
||||
--with-distro=LibreOfficeAndroid
|
||||
--with-num-cpus=1
|
||||
--with-max-jobs=1
|
||||
--without-helppack-integration
|
||||
--without-myspell-dicts
|
||||
|
||||
And here is an autogen.lastrun for Android when cross-compiling to x86 from Linux:
|
||||
|
||||
CC_FOR_BUILD=ccache gcc
|
||||
CXX_FOR_BUILD=ccache g++
|
||||
--with-android-ndk=/opt/libreoffice/android-ndk-r8b
|
||||
--with-android-ndk-toolchain-version=4.6
|
||||
--with-android-sdk=/opt/libreoffice/android-sdk-linux
|
||||
--build=i586-suse-linux
|
||||
--enable-ccache
|
||||
--disable-zenity
|
||||
--with-distro=LibreOfficeAndroidX86
|
||||
--with-num-cpus=6
|
||||
--with-max-jobs=6
|
||||
|
||||
There is no interactive end-user "app" you could run yet that would
|
||||
use LibreOffice code, but you can build some non-interactive unit
|
||||
|
53
android/Bootstrap/Makefile.shared
Normal file
53
android/Bootstrap/Makefile.shared
Normal file
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# Common Makefile pieces for building Java / Android apps.
|
||||
#
|
||||
|
||||
# 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)
|
||||
|
||||
# Adapt to both Intel and ARM architectures
|
||||
ifeq ($(CPU),I)
|
||||
ABI_PATH=x86
|
||||
else
|
||||
ABI_PATH=armeabi-v7a
|
||||
endif
|
||||
SODEST=libs/$(ABI_PATH)
|
||||
OBJLOCAL=obj/local/$(ABI_PATH)
|
||||
|
||||
define COPYSO
|
||||
cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \
|
||||
cp $(1) $(OBJLOCAL)$(if $(2),/$(2))
|
||||
endef
|
||||
|
||||
define COPYSOJAR
|
||||
cp $(1) libs
|
||||
endef
|
||||
|
||||
#
|
||||
# Helpful rules ...
|
||||
#
|
||||
|
||||
properties:
|
||||
echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
|
||||
echo sdk.dir=$(ANDROID_SDK_HOME) >../../Bootstrap/local.properties
|
||||
echo "APP_ABI := $(ABI_PATH)" > jni/Application.mk
|
||||
echo "APP_PLATFORM := android-14" >> jni/Application.mk
|
||||
|
||||
install: build-ant
|
||||
unset JAVA_HOME && $(ANT) debug install
|
||||
@echo
|
||||
@echo 'Run it with something like what "make run" does (see Makefile)'
|
||||
@echo
|
||||
|
||||
uninstall:
|
||||
$(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(APP_PACKAGE)
|
||||
|
||||
clean: properties
|
||||
$(ANT) clean
|
||||
rm -rf assets $(SODEST) $(OBJLOCAL)
|
@@ -1,46 +1,13 @@
|
||||
include ../../../config_host.mk
|
||||
include ../../Bootstrap/Makefile.shared
|
||||
|
||||
# The package of this app
|
||||
APP_PACKAGE=org.libreoffice
|
||||
|
||||
# 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)
|
||||
|
||||
ifeq ($(CPU),I)
|
||||
ABI_PATH=x86
|
||||
else
|
||||
ABI_PATH=armeabi-v7a
|
||||
endif
|
||||
SODEST=libs/$(ABI_PATH)
|
||||
OBJLOCAL=obj/local/$(ABI_PATH)
|
||||
|
||||
define COPYSO
|
||||
cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \
|
||||
cp $(1) $(OBJLOCAL)$(if $(2),/$(2))
|
||||
endef
|
||||
|
||||
define COPYJAR
|
||||
cp $(1) libs
|
||||
endef
|
||||
|
||||
# The default target just builds.
|
||||
|
||||
all: build-ant
|
||||
|
||||
properties:
|
||||
echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
|
||||
echo sdk.dir=$(ANDROID_SDK_HOME) >../../Bootstrap/local.properties
|
||||
|
||||
copy-stuff:
|
||||
# First always clean
|
||||
rm -rf libs $(OBJLOCAL)
|
||||
@@ -253,25 +220,11 @@ build-ant: copy-stuff properties
|
||||
unoil \
|
||||
unoloader \
|
||||
); do \
|
||||
$(call COPYJAR,$(OUTDIR)/bin/$${F}.jar); \
|
||||
$(call COPYSOJAR,$(OUTDIR)/bin/$${F}.jar); \
|
||||
done
|
||||
#
|
||||
unset JAVA_HOME && $(ANT) debug
|
||||
|
||||
install: build-ant
|
||||
unset JAVA_HOME && $(ANT) debug install
|
||||
@echo
|
||||
@echo 'Run it with something like what "make run" does (see Makefile)'
|
||||
@echo
|
||||
|
||||
uninstall:
|
||||
$(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(APP_PACKAGE)
|
||||
|
||||
run:
|
||||
# /data/local/tmp/sample-document.odt
|
||||
adb shell am start -n $(APP_PACKAGE)/.ui.LibreOfficeUIActivity -e input /assets/test1.odt
|
||||
|
||||
|
||||
clean: properties
|
||||
$(ANT) clean
|
||||
rm -rf assets libs $(SODEST) $(OBJLOCAL)
|
||||
|
@@ -1,3 +1,2 @@
|
||||
# File needed by ndk-gdb
|
||||
APP_ABI := armeabi-v7a
|
||||
APP_ABI := x86
|
||||
APP_PLATFORM := android-14
|
||||
|
@@ -2,6 +2,7 @@
|
||||
# 'lo_main' from
|
||||
|
||||
include ../../../config_host.mk
|
||||
include ../../Bootstrap/Makefile.shared
|
||||
|
||||
# The package of this app
|
||||
APP_PACKAGE=org.libreoffice.android.libo
|
||||
@@ -9,32 +10,10 @@ APP_PACKAGE=org.libreoffice.android.libo
|
||||
# The name of the Bootstrap activity class
|
||||
BOOTSTRAP=org.libreoffice.android.Bootstrap
|
||||
|
||||
# The full path the the app's directory needs to be supplied in a
|
||||
# couple of places, unfortunately.
|
||||
|
||||
APP_DATA_PATH=/data/data/$(APP_PACKAGE)
|
||||
|
||||
ifeq ($(CPU),I)
|
||||
ABI_PATH=x86
|
||||
else
|
||||
ABI_PATH=armeabi-v7a
|
||||
endif
|
||||
SODEST=libs/$(ABI_PATH)
|
||||
OBJLOCAL=obj/local/$(ABI_PATH)
|
||||
|
||||
define COPY
|
||||
cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \
|
||||
cp $(1) $(OBJLOCAL)$(if $(2),/$(2))
|
||||
endef
|
||||
|
||||
# The default target just builds.
|
||||
|
||||
all: build-ant
|
||||
|
||||
properties:
|
||||
echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
|
||||
echo sdk.dir=$(ANDROID_SDK_HOME) >../../Bootstrap/local.properties
|
||||
|
||||
buildrcs:
|
||||
# main sofficerc ini ...
|
||||
mkdir -p assets/program/
|
||||
@@ -53,7 +32,7 @@ buildrcs:
|
||||
echo "LO_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/fundamentalrc
|
||||
echo "URE_LIB_DIR=file://$(APP_DATA_PATH)/lib/" >> assets/program/fundamentalrc # checkme - is this used to find configs ?
|
||||
echo "BRAND_BASE_DIR=file:///assets" >> assets/program/fundamentalrc
|
||||
echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry module:$${BRAND_BASE_DIR}/share/registry/modules res:$${BRAND_BASE_DIR}/share/registry user:$${$$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/registrymodifications.xcu' >> assets/program/fundamentalrc
|
||||
echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry module:$${BRAND_BASE_DIR}/share/registry/modules res:$${BRAND_BASE_DIR}/share/registry' >> assets/program/fundamentalrc
|
||||
echo 'URE_BIN_DIR=file:///assets/ure/bin/dir/not-here/can-we/exec-anyway' >> assets/program/fundamentalrc
|
||||
echo 'URE_MORE_TYPES=file:///assets/ure/share/misc/types.rdb file:///assets/program/types/types.rdb' >> assets/program/fundamentalrc
|
||||
echo 'URE_MORE_SERVICES= <$$BRAND_BASE_DIR/program/services>*' >> assets/program/fundamentalrc
|
||||
@@ -193,12 +172,12 @@ copy-stuff: buildrcs
|
||||
chartmodello \
|
||||
charttoolslo \
|
||||
); do \
|
||||
$(call COPY,$(OUTDIR)/lib/lib$${F}.so); \
|
||||
$(call COPYSO,$(OUTDIR)/lib/lib$${F}.so); \
|
||||
done
|
||||
|
||||
#
|
||||
# Then the shared GNU C++ library
|
||||
$(call COPY,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/libs/$(ABI_PATH)/libgnustl_shared.so)
|
||||
$(call COPYSO,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/$(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)libs/$(ABI_PATH)/libgnustl_shared.so)
|
||||
#
|
||||
# Then other "assets" that can be left in the .apk. Let the directory
|
||||
# structure under assets mimic the install set - except for the fact
|
||||
@@ -238,28 +217,18 @@ copy-stuff: buildrcs
|
||||
#
|
||||
# Then gdbserver and gdb.setup so that we can debug with ndk-gdb.
|
||||
#
|
||||
cp $(ANDROID_NDK_HOME)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver $(SODEST)
|
||||
cp $(ANDROID_NDK_GDBSERVER) $(SODEST)
|
||||
echo set solib-search-path ./obj/local/$(ABI_PATH) >$(SODEST)/gdb.setup
|
||||
|
||||
|
||||
build-ant: copy-stuff properties
|
||||
unset JAVA_HOME && $(ANT) debug
|
||||
|
||||
install: copy-stuff properties
|
||||
$(ANDROID_SDK_HOME)/platform-tools/adb shell rm -r $(APP_DATA_PATH)
|
||||
unset JAVA_HOME && $(ANT) debug install
|
||||
@echo
|
||||
@echo 'Run it with "make run"'
|
||||
@echo
|
||||
|
||||
uninstall:
|
||||
$(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(APP_PACKAGE)
|
||||
|
||||
run:
|
||||
echo "-env:INIFILENAME=file:///assets/program/sofficerc" > cmdline
|
||||
# echo "file:///assets/demo/writer.odt" > cmdline
|
||||
$(ANDROID_SDK_HOME)/platform-tools/adb push cmdline $(APP_DATA_PATH)/cmdline
|
||||
$(ANDROID_SDK_HOME)/platform-tools/adb shell am start -n $(APP_PACKAGE)/$(BOOTSTRAP) -e lo-strace yes -e lo-main-indirect-cmdline "$(APP_DATA_PATH)/cmdline"
|
||||
$(ANDROID_SDK_HOME)/platform-tools/adb shell am start -n $(APP_PACKAGE)/$(BOOTSTRAP) -e lo-main-delay 20 -e lo-main-indirect-cmdline "$(APP_DATA_PATH)/cmdline"
|
||||
# add -e lo-strace yes # if you want that
|
||||
|
||||
# If you reinstall an app several times, even if you uninstall it
|
||||
@@ -268,7 +237,4 @@ run:
|
||||
stop-start-cycle:
|
||||
$(ANDROID_SDK_HOME)/platform-tools/adb shell stop && $(ANDROID_SDK_HOME)/platform-tools/adb shell start && sleep 10
|
||||
|
||||
clean: properties
|
||||
$(ANT) clean
|
||||
rm -rf assets $(SODEST) $(OBJLOCAL)
|
||||
|
||||
|
@@ -1,2 +1,2 @@
|
||||
APP_ABI := armeabi-v7a
|
||||
APP_ABI := x86
|
||||
APP_PLATFORM := android-14
|
||||
|
@@ -22,3 +22,5 @@
|
||||
--without-junit
|
||||
--without-ppds
|
||||
--without-stlport
|
||||
--without-helppack-integration
|
||||
--without-myspell-dicts
|
||||
|
@@ -23,3 +23,5 @@
|
||||
--without-junit
|
||||
--without-ppds
|
||||
--without-stlport
|
||||
--without-helppack-integration
|
||||
--without-myspell-dicts
|
||||
|
Reference in New Issue
Block a user