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

Tor Lillqvist tml at kemper.freedesktop.org
Tue Jul 31 00:02:40 PDT 2012


 android/experimental/DocumentLoader/Makefile |    4 +-
 config_host.mk.in                            |    2 +
 configure.in                                 |   47 ++++++++++++++++++---------
 3 files changed, 36 insertions(+), 17 deletions(-)

New commits:
commit 963f417fa89746fe087f7b7e585edb79fdd3b14d
Author: Tor Lillqvist <tml at iki.fi>
Date:   Tue Jul 31 09:53:58 2012 +0300

    More NDK r8b adaptation
    
    Change-Id: Ic65795a1b7bfe0435292f87f27ae39e2c3069fed

diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 9423336..cdbf196 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -134,7 +134,7 @@ copy-stuff:
 	done
 #
 # Then the shared GNU C++ library
-	$(call COPYSO,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libgnustl_shared.so)
+	$(call COPYSO,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/$(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)libs/armeabi-v7a/libgnustl_shared.so)
 #
 # Then other "assets". Let the directory structure under assets mimic
 # that under solver for now.
@@ -233,7 +233,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)
+	cp $(ANDROID_NDK_GDBSERVER) $(SODEST)
 	echo set solib-search-path ./obj/local/armeabi-v7a >$(SODEST)/gdb.setup
 
 build-ant: copy-stuff properties
diff --git a/config_host.mk.in b/config_host.mk.in
index 52ec1fc..6926012 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -16,6 +16,8 @@ export ANT_HOME=@ANT_HOME@
 export ANT_LIB=@ANT_LIB@
 export ANCIENT_BISON=@ANCIENT_BISON@
 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@
 export ANDROID_SDK_HOME=@ANDROID_SDK_HOME@
 export AR=@AR@
 export ATL_INCLUDE=@ATL_INCLUDE@
diff --git a/configure.in b/configure.in
index 20d5b88..48009d0 100644
--- a/configure.in
+++ b/configure.in
@@ -141,27 +141,33 @@ if test -n "$with_android_ndk"; then
     # linking especially our libmerged. Work to support that in progress. Until
     # that is done, please use no newer NDK than r8.
 
-    ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/$host_cpu-*$with_android_ndk_toolchain_version/prebuilt/*/bin`
+    if test $host_cpu = arm; then
+        android_gcc_prefix=arm-linux-androideabi
+        android_cpu=arm
+    else
+        android_gcc_prefix=i686-android-linux
+        # host_cpu is something like "i386" or "i686" I guess, NDK uses
+        # "x86" in some contexts
+        android_cpu=x86
+    fi
+
+    ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/$android_cpu-*$with_android_ndk_toolchain_version/prebuilt/*/bin`
     # Check if there are several toolchain versions
     case "$ANDROID_ABI_PREBUILT_BIN" in
     */bin\ */bin*)
         AC_MSG_ERROR([Several toolchain versions in NDK, you must specify --with-android-ndk-toolchain-version])
     esac
 
-    toolchain_version_subdir=
-    case "`echo $ANDROID_NDK_HOME/toolchains/$host_cpu-*/prebuilt/*/bin`" in
+    # This stays empty if there is just one version of the toolchain in the NDK
+    ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=
+    case "`echo $ANDROID_NDK_HOME/toolchains/$android_cpu-*/prebuilt/*/bin`" in
     */bin\ */bin*)
-        toolchain_version_subdir="${with_android_ndk_toolchain_version}/"
+        # Trailing slash intentional and necessary, compare to how this is used
+        ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR="${with_android_ndk_toolchain_version}/"
         ;;
     esac
 
-    if test $host_cpu = arm; then
-        android_gcc_prefix=arm-linux-androideabi
-    else
-        android_gcc_prefix=i686-android-linux
-    fi
-
-    test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-$host_cpu
+    test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-$android_cpu
     test -z "$AR" && AR=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-ar
     test -z "$NM" && NM=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-nm
     test -z "$OBJDUMP" && OBJDUMP=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-objdump
@@ -169,9 +175,9 @@ 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++/${toolchain_version_subdir}libs/armeabi-v7a"
+        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"
     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++/${toolchain_version_subdir}libs/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"
     fi
 
     # When using the 4.6 or newer toolchain, use the gold linker
@@ -181,16 +187,27 @@ if test -n "$with_android_ndk"; then
         ;;
     esac
 
+    # gdbserver can be in different locations
+    if test -f $ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver; then
+        ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver
+    elif test -f $ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver; then
+        ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver
+    else
+        AC_MSG_ERROR([Can't find gdbserver for your Android target])
+    fi
+
     if test $host_cpu = arm; then
-        ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${toolchain_version_subdir}include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${toolchain_version_subdir}libs/armeabi-v7a/include"
+        ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/armeabi-v7a/include"
     else # x86
-        ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${toolchain_version_subdir}include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${toolchain_version_subdir}libs/x86/include"
+        ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/x86/include"
     fi
 
     test -z "$CC" && CC="$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-gcc $ANDROIDCFLAGS"
     test -z "$CXX" && CXX="$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-g++ $ANDROIDCXXFLAGS"
 fi
 AC_SUBST(ANDROID_NDK_HOME)
+AC_SUBST(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)
+AC_SUBST(ANDROID_NDK_GDBSERVER)
 
 dnl ===================================================================
 dnl Also --with-android-sdk is mandatory


More information about the Libreoffice-commits mailing list