[Libreoffice-commits] .: android/Bootstrap android/experimental android/qa config_host.mk.in configure.in

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 23 02:38:57 PDT 2012


 android/Bootstrap/Makefile.shared                 |   12 +++---------
 android/experimental/DocumentLoader/Makefile      |   17 ++++++-----------
 android/experimental/LibreOffice4Android/Makefile |    8 ++++----
 android/qa/desktop/Makefile                       |    8 ++++----
 android/qa/sc/Makefile                            |   12 ++++++------
 android/qa/simple/Makefile                        |   10 +++++-----
 config_host.mk.in                                 |    1 +
 configure.in                                      |   11 ++++++++---
 8 files changed, 37 insertions(+), 42 deletions(-)

New commits:
commit c02e838ec21408cd5ba70e0e7b53309411d49db2
Author: Tor Lillqvist <tml at iki.fi>
Date:   Thu Aug 23 12:26:52 2012 +0300

    Factor out the Android APP_ABI sanely instead of copy-paste galore
    
    Change-Id: I66e97d73c410ac6f2e481ba9b2b22183f57438bd

diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index f18c187..2dd2023 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -11,14 +11,8 @@
 # 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)
+SODEST=libs/$(ANDROID_APP_ABI)
+OBJLOCAL=obj/local/$(ANDROID_APP_ABI)
 
 define COPYSO
 cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \
@@ -36,7 +30,7 @@ endef
 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_ABI := $(ANDROID_APP_ABI)" > jni/Application.mk
 	echo "APP_PLATFORM := android-14" >> jni/Application.mk
 
 install: build-ant
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 917004a..804d915 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -16,13 +16,8 @@ APP_PACKAGE=org.libreoffice.android.examples
 # 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)
+SODEST=libs/$(ANDROID_APP_ABI)
+OBJLOCAL=obj/local/$(ANDROID_APP_ABI)
 
 define COPYSO
 cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \
@@ -47,9 +42,9 @@ copy-stuff:
 	mkdir -p $(SODEST) $(OBJLOCAL)
 #
 # Copy shared libraries (including UNO components) we need to
-# libs/armeabi-v7a so that ant will include them in the .apk.
+# libs/$(ANDROID_APP_ABI) so that ant will include them in the .apk.
 #
-# Copy them to obj/local/armeabi-v7a, too, where gdb will look for
+# Copy them to obj/local/$(ANDROID_APP_ABI), too, where gdb will look for
 # them.
 #
 	for F in $(strip \
@@ -135,7 +130,7 @@ copy-stuff:
 	done
 #
 # Then the shared GNU C++ library
-	$(call COPYSO,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/$(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)libs/$(ABI_PATH)/libgnustl_shared.so)
+	$(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
 # that under solver for now.
@@ -235,7 +230,7 @@ copy-stuff:
 # Then gdbserver and gdb.setup so that we can debug with ndk-gdb.
 #
 	cp $(ANDROID_NDK_GDBSERVER) $(SODEST)
-	echo set solib-search-path ./obj/local/$(ABI_PATH) >$(SODEST)/gdb.setup
+	echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup
 
 build-ant: copy-stuff properties
 #
diff --git a/android/experimental/LibreOffice4Android/Makefile b/android/experimental/LibreOffice4Android/Makefile
index bb2c02e..837f930 100644
--- a/android/experimental/LibreOffice4Android/Makefile
+++ b/android/experimental/LibreOffice4Android/Makefile
@@ -14,9 +14,9 @@ copy-stuff:
 	mkdir -p $(SODEST) $(OBJLOCAL)
 #
 # Copy shared libraries (including UNO components) we need to
-# libs/armeabi-v7a so that ant will include them in the .apk.
+# libs/$(ANDROID_APP_ABI) so that ant will include them in the .apk.
 #
-# Copy them to obj/local/armeabi-v7a, too, where gdb will look for
+# Copy them to obj/local/$(ANDROID_APP_ABI), too, where gdb will look for
 # them.
 #
 	for F in $(strip \
@@ -114,7 +114,7 @@ copy-stuff:
 	done
 #
 # Then the shared GNU C++ library
-	$(call COPYSO,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/$(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)libs/$(ABI_PATH)/libgnustl_shared.so)
+	$(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
 # that under solver for now.
@@ -214,7 +214,7 @@ copy-stuff:
 # Then gdbserver and gdb.setup so that we can debug with ndk-gdb.
 #
 	cp $(ANDROID_NDK_GDBSERVER) $(SODEST)
-	echo set solib-search-path ./obj/local/$(ABI_PATH) >$(SODEST)/gdb.setup
+	echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup
 
 build-ant: copy-stuff properties
 	echo sdk.dir=$(ANDROID_SDK_HOME) >../../abs-lib/local.properties
diff --git a/android/qa/desktop/Makefile b/android/qa/desktop/Makefile
index 3c9efd7..2fbd815 100644
--- a/android/qa/desktop/Makefile
+++ b/android/qa/desktop/Makefile
@@ -77,10 +77,10 @@ buildrcs:
 
 copy-stuff: buildrcs
 #
-# Copy shared libraries we need to libs/armeabi-v7a so that ant will
+# Copy shared libraries we need to libs/$(ANDROID_APP_ABI) so that ant will
 # include them in the .apk.
 #
-# Copy them to obj/local/armeabi-v7a, too, where gdb will look for
+# Copy them to obj/local/$(ANDROID_APP_ABI), too, where gdb will look for
 # them.
 #
 	mkdir -p $(SODEST) $(OBJLOCAL)
@@ -165,7 +165,7 @@ copy-stuff: buildrcs
 
 #
 # Then the shared GNU C++ library
-	$(call COPYSO,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/$(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)libs/$(ABI_PATH)/libgnustl_shared.so)
+	$(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" that can be left in the .apk. Let the directory
 # structure under assets mimic the install set - except for the fact
@@ -206,7 +206,7 @@ copy-stuff: buildrcs
 # Then gdbserver and gdb.setup so that we can debug with ndk-gdb.
 #
 	cp $(ANDROID_NDK_GDBSERVER) $(SODEST)
-	echo set solib-search-path ./obj/local/$(ABI_PATH) >$(SODEST)/gdb.setup
+	echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup
 
 
 build-ant: copy-stuff properties
diff --git a/android/qa/sc/Makefile b/android/qa/sc/Makefile
index 1c70fd8..91f4c48 100644
--- a/android/qa/sc/Makefile
+++ b/android/qa/sc/Makefile
@@ -11,8 +11,8 @@ BOOTSTRAP=org.libreoffice.android.Bootstrap
 
 APP_DATA_PATH=/data/data/$(APP_PACKAGE)
 
-SODEST=libs/armeabi-v7a
-OBJLOCAL=obj/local/armeabi-v7a
+SODEST=libs/$(ANDROID_APP_ABI)
+OBJLOCAL=obj/local/$(ANDROID_APP_ABI)
 
 define COPY
 cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \
@@ -29,10 +29,10 @@ properties:
 
 copy-stuff:
 #
-# Copy shared libraries we need to libs/armeabi-v7a so that ant will
+# Copy shared libraries we need to libs/$(ANDROID_APP_ABI) so that ant will
 # include them in the .apk.
 #
-# Copy them to obj/local/armeabi-v7a, too, where gdb will look for
+# Copy them to obj/local/$(ANDROID_APP_ABI), too, where gdb will look for
 # them.
 #
 	mkdir -p $(SODEST) $(OBJLOCAL)
@@ -114,7 +114,7 @@ copy-stuff:
 	done
 #
 # Then the shared GNU C++ library
-	$(call COPY,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libgnustl_shared.so)
+	$(call COPY,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/libs/$(ANDROID_APP_ABI)/libgnustl_shared.so)
 #
 # Then other "assets" that can be left in the .apk. Let the directory
 # structure under assets mimic that under solver or workdir for now.
@@ -151,7 +151,7 @@ copy-stuff:
 #
 # 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)
-	echo set solib-search-path ./obj/local/armeabi-v7a >$(SODEST)/gdb.setup
+	echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup
 
 
 build-ant: copy-stuff properties
diff --git a/android/qa/simple/Makefile b/android/qa/simple/Makefile
index fad7730..fa97425 100644
--- a/android/qa/simple/Makefile
+++ b/android/qa/simple/Makefile
@@ -14,8 +14,8 @@ BOOTSTRAP=org.libreoffice.android.Bootstrap
 
 APP_DATA_PATH=/data/data/$(APP_PACKAGE)
 
-SODEST=libs/armeabi-v7a
-OBJLOCAL=obj/local/armeabi-v7a
+SODEST=libs/$(ANDROID_APP_ABI)
+OBJLOCAL=obj/local/$(ANDROID_APP_ABI)
 
 define COPY
 cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \
@@ -28,10 +28,10 @@ all: build-ant
 
 copy-stuff:
 #
-# Copy shared libraries we need to libs/armeabi-v7a so that ant will
+# Copy shared libraries we need to libs/$(ANDROID_APP_ABI) so that ant will
 # include them in the .apk.
 #
-# Copy them to obj/local/armeabi-v7a, too, where gdb will look for
+# Copy them to obj/local/$(ANDROID_APP_ABI), too, where gdb will look for
 # them.
 #
 	mkdir -p $(SODEST) $(OBJLOCAL)
@@ -87,7 +87,7 @@ copy-stuff:
 	done
 #
 # Then the shared GNU C++ library
-	$(call COPY,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libgnustl_shared.so)
+	$(call COPY,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/libs/$(ANDROID_APP_ABI)/libgnustl_shared.so)
 #
 # bridgetest components, not in solver
 	for F in bridgetest constructors cppobj; do \
diff --git a/config_host.mk.in b/config_host.mk.in
index a3723ab..b28cb7b 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -15,6 +15,7 @@ export ANT=@ANT@
 export ANT_HOME=@ANT_HOME@
 export ANT_LIB=@ANT_LIB@
 export ANCIENT_BISON=@ANCIENT_BISON@
+export ANDROID_APP_ABI=@ANDROID_APP_ABI@
 export ANDROID_NDK_HOME=@ANDROID_NDK_HOME@
 export ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=@ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR@
 export ANDROID_NDK_GDBSERVER=@ANDROID_NDK_GDBSERVER@
diff --git a/configure.in b/configure.in
index 39aaecc..94c8243 100644
--- a/configure.in
+++ b/configure.in
@@ -178,12 +178,16 @@ if test -n "$with_android_ndk"; then
     test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-strip
 
     if test $host_cpu = arm; then
-        ANDROIDCFLAGS="-Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8 --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-arm -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/armeabi-v7a"
+        ANDROID_APP_ABI=armeabi-v7a
+        ANDROIDCFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
     elif test $host_cpu = mips; then
-        ANDROIDCFLAGS="-Wno-psabi --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-mips -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/mips"
+        ANDROID_APP_ABI=mips
+        ANDROIDCFLAGS=""
     else # x86
-        ANDROIDCFLAGS="-Wno-psabi -march=atom --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-x86 -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/x86"
+        ANDROID_APP_ABI=x86
+        ANDROIDCFLAGS="-march=atom"
     fi
+    ANDROIDCFLAGS="$ANDROIDCFLAGS -Wno-psabi --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-$android_cpu -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/$ANDROID_APP_ABI"
 
     # When using the 4.6 or newer toolchain, use the gold linker
     case "$with_android_ndk_toolchain_version" in
@@ -218,6 +222,7 @@ fi
 AC_SUBST(ANDROID_NDK_HOME)
 AC_SUBST(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)
 AC_SUBST(ANDROID_NDK_GDBSERVER)
+AC_SUBST(ANDROID_APP_ABI)
 
 dnl ===================================================================
 dnl Also --with-android-sdk is mandatory


More information about the Libreoffice-commits mailing list