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

android: x86 porting work.

üst e88f6ca6
......@@ -16,8 +16,13 @@ APP_PACKAGE=org.libreoffice
# code are very much self-contained pre-packaged thingies.
APP_DATA_PATH=/data/data/$(APP_PACKAGE)
SODEST=libs/armeabi-v7a
OBJLOCAL=obj/local/armeabi-v7a
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))) && \
......@@ -34,10 +39,10 @@ all: build-ant
properties:
echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
echo sdk.dir=$(ANDROID_SDK_HOME) >../../Bootstrap/local.properties
echo sdk.dir=$(ANDROID_SDK_HOME) >../../Bootstrap/local.properties
copy-stuff:
# First always clean
copy-stuff:
# First always clean
rm -rf libs $(OBJLOCAL)
mkdir -p $(SODEST) $(OBJLOCAL)
#
......@@ -134,7 +139,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++/libs/$(ABI_PATH)/libgnustl_shared.so)
#
# Then other "assets". Let the directory structure under assets mimic
# that under solver for now.
......@@ -234,7 +239,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/$(ABI_PATH) >$(SODEST)/gdb.setup
build-ant: copy-stuff properties
#
......@@ -269,4 +274,4 @@ run:
clean: properties
$(ANT) clean
rm -rf assets libs $(SODEST) $(OBJLOCAL)
rm -rf assets libs obj
......@@ -39,7 +39,7 @@
/*See: http://people.redhat.com/drepper/selinux-mem.html*/
#if defined(LINUX) || defined(OPENBSD) || defined(FREEBSD) \
|| defined(NETBSD) || defined(DRAGONFLY)
|| defined(NETBSD) || defined(DRAGONFLY) || defined (ANDROID)
#define USE_DOUBLE_MMAP
#endif
......
......@@ -42,7 +42,8 @@ ENABLE_EXCEPTIONS=TRUE
"$(COM)$(OS)$(CPU)$(COMNAME)" == "GCCOPENBSDIgcc3" || \
"$(COM)$(OS)$(CPU)$(COMNAME)" == "GCCFREEBSDIgcc3" || \
"$(COM)$(OS)$(CPU)$(COMNAME)" == "GCCNETBSDIgcc3" || \
"$(COM)$(OS)$(CPU)$(COMNAME)" == "GCCDRAGONFLYIgcc3"
"$(COM)$(OS)$(CPU)$(COMNAME)" == "GCCDRAGONFLYIgcc3" || \
"$(COM)$(OS)$(CPU)$(COMNAME)" == "GCCANDROIDIgcc3" || \
# In case someone enabled the non-standard -fomit-frame-pointer which does not
# work with the .cxx sources in this directory:
......
......@@ -129,18 +129,25 @@ ANDROID_ARCH=
ANDROID_NDK_HOME=
if test -n "$with_android_ndk"; then
ANDROID_NDK_HOME=$with_android_ndk
# Set up a lot of pre-canned defaults
# What if the NDK at some point starts including several toolchains for different
# gcc versions (like some 3rd-party improved NDK builds already do)?
# Then the use of a wildcard below will break.
ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/$with_android_arch-linux*/prebuilt/*/bin`
if test "$with_android_arch" = "arm"; then
ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/$with_android_arch-linux*/prebuilt/*/bin`
android_gcc_prefix=arm-linux-androideabi
else
ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/$with_android_arch-*/prebuilt/*/bin`
android_gcc_prefix=i686-android-linux
fi
test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-$with_android_arch
test -z "$AR" && AR=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-ar
test -z "$NM" && NM=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-nm
test -z "$OBJDUMP" && OBJDUMP=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-objdump
test -z "$RANLIB" && RANLIB=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-ranlib
test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-strip
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
test -z "$RANLIB" && RANLIB=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-ranlib
test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-strip
if test "$with_android_arch" = "arm"; then
ANDROIDCFLAGS="-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++/libs/armeabi-v7a"
......@@ -149,8 +156,8 @@ if test -n "$with_android_ndk"; then
ANDROIDCFLAGS="-march=atom --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-x86 -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/x86"
ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/x86/include"
fi
test -z "$CC" && CC="$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-gcc $ANDROIDCFLAGS"
test -z "$CXX" && CXX="$ANDROID_ABI_PREBUILT_BIN/$with_android_arch-linux-androideabi-g++ $ANDROIDCXXFLAGS"
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"
ANDROID_ARCH=$with_android_arch
fi
AC_SUBST(ANDROID_ARCH)
......@@ -3318,6 +3325,12 @@ linux-androideabi*)
RTL_ARCH=ARM_EABI
OUTPATH=unxandr
;;
i*86)
CPU=I
CPUNAME=INTEL
RTL_ARCH=x86
OUTPATH=unxandri
;;
*)
AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
;;
......
--host=i686-linux-androideabi
--with-android-arch=x86
--disable-cairo-canvas
--disable-cups
--disable-ext-pdfimport
--disable-ext-presenter-console
--disable-ext-presenter-minimizer
--disable-ext-report-builder
--disable-gconf
--disable-gnome-vfs
--disable-gstreamer
--disable-lockdown
--disable-mozilla
--disable-odk
--disable-opengl
--disable-postgresql-sdbc
--disable-python
--disable-randr
--disable-randr-link
--disable-systray
--disable-xmlsec
--enable-mergelibs
--enable-python=internal
--without-junit
--without-ppds
--without-stlport
......@@ -32,12 +32,17 @@ $(eval $(call gb_Module_add_targets,extensions,\
AllLangResTarget_scn \
AllLangResTarget_upd \
Library_abp \
Library_ldapbe2 \
Library_log \
Library_res \
Library_scn \
))
ifneq ($(filter-out IOS ANDROID,$(OS)),)
$(eval $(call gb_Module_add_targets,shell,\
Library_ldapbe2 \
))
endif
ifneq (,$(filter DBCONNECTIVITY,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,extensions,\
AllLangResTarget_bib \
......
......@@ -24,8 +24,8 @@
# Check to see if genccode can generate simple assembly.
GENCCODE_ASSEMBLY=
case "${host}" in
+*-*-linux-androideabi)
+ GENCCODE_ASSEMBLY="-a gcc-android"
+arm-*-linux-androideabi)
+ GENCCODE_ASSEMBLY="-a gcc-android-arm"
+ ;;
*-linux*|*-kfreebsd*-gnu*|i*86-*-*bsd*|i*86-pc-gnu)
if test "$GCC" = yes; then
......
......@@ -15,7 +15,7 @@
".long ","",HEX_0X
},
+ {"gcc-android",
+ {"gcc-android-arm",
+ "\t.arch armv5te\n"
+ "\t.fpu softvfp\n"
+ "\t.eabi_attribute 20, 1\n"
......
......@@ -21,9 +21,9 @@ all:
@echo "Therefore the version provided here does not need to be built in addition."
.ENDIF
.IF "$(OS)"=="WNT"
.IF "$(OS)"=="WNT" || "$(OS)"=="ANDROID" || "$(OS)"=="IOS"
all:
@echo "Openldap is not needed on Windows."
@echo "Openldap is not needed on Windows, Android or iOS."
.ENDIF
# --- Files --------------------------------------------------------
......
......@@ -1235,6 +1235,8 @@ lo_dlcall_argc_argv(void *function,
return result;
}
#ifndef X86
/* There is a bug in std::type_info::operator== and
* std::type_info::before() in libgnustl_shared.so in NDK r7 at
* least. They compare the type name pointers instead of comparing the
......@@ -1407,6 +1409,21 @@ patch_libgnustl_shared(void)
&replacement_method_before_arm);
}
// static native void patch_libgnustl_shared();
__attribute__ ((visibility("default")))
void
Java_org_libreoffice_android_Bootstrap_patch_1libgnustl_1shared(JNIEnv* env,
jobject clazz)
{
(void) env;
(void) clazz;
patch_libgnustl_shared();
}
#endif // not X86
#define UNPACK_TREE "/assets/unpack"
static int
......@@ -1520,19 +1537,6 @@ extract_files(const char *prefix)
lo_apk_closedir(tree);
}
// static native void patch_libgnustl_shared();
__attribute__ ((visibility("default")))
void
Java_org_libreoffice_android_Bootstrap_patch_1libgnustl_1shared(JNIEnv* env,
jobject clazz)
{
(void) env;
(void) clazz;
patch_libgnustl_shared();
}
// static native void extract_files();
__attribute__ ((visibility("default")))
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2010 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com>
# (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
#please make generic modifications to unxgcc.mk or linux.mk
gb_CPUDEFS += -DX86
gb_COMPILERDEFAULTOPTFLAGS := -Os
gb_CXXFLAGS += -fno-omit-frame-pointer
gb_CFLAGS += -fno-omit-frame-pointer
include $(GBUILDDIR)/platform/unxgcc.mk
# Link almost everything with -lgnustl_shared
gb_STDLIBS := \
gnustl_shared
gb_Library_PLAINLIBS_NONE := \
android \
gnustl_shared \
# No unit testing can be run
gb_CppunitTest_CPPTESTPRECOMMAND := :
# Re-define this from unxgcc.mk with some small but important
# changes. Just temporarily done this way, shm_get promised to
# eventually enable this to be done this in some more elegant and less
# redundant fashion.
gb_LinkTarget_LDFLAGS += \
-Wl,-z,defs \
-Wl,--as-needed \
-Wl,--no-add-needed
define gb_LinkTarget__command_dynamiclink
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
$(gb_CXX) \
-shared \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \
$(subst \d,$$,$(RPATH)) \
$(T_LDFLAGS) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
$(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \
-Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
$(LIBS) \
$(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))))) \
-o $(1))
endef
# Prefix UNO library filenames with "lib"
gb_Library_FILENAMES := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_UNOEXT)) \
$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_UNOEXT)) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
# No DT_RPATH or DT_RUNPATH support in the Bionic dynamic linker so
# don't bother generating such.
define gb_Library_get_rpath
endef
define gb_Executable_get_rpath
endef
gb_LinkTarget_LDFLAGS := $(subst -Wl$(COMMA)-rpath-link$(COMMA)$(SYSBASE)/lib:$(SYSBASE)/usr/lib,,$(gb_LinkTarget_LDFLAGS))
gb_Library__set_soversion_script_platform =
# vim: set noet sw=4:
......@@ -95,6 +95,10 @@
.INCLUDE : unxandr.mk
.ENDIF
.IF "$(COM)$(OS)$(CPU)" == "GCCANDROIDI"
.INCLUDE : unxandr.mk
.ENDIF
.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXA"
.INCLUDE : unxlnga.mk
.ENDIF
......
......@@ -29,7 +29,11 @@
CDEFAULTOPT=-Os
.INCLUDE : unxgcc.mk
.IF "$(CPU)" == "I"
CDEFS+=-DX86
.ELSE
CDEFS+=-DARM32
.ENDIF
CFLAGS+=-fno-omit-frame-pointer
# Override some macros set by unxgcc.mk
......
......@@ -90,8 +90,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_filters_test,\
ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \
unoxml/source/service/unoxml \
$(if $(filter DESKTOP,$(BUILD_TYPE)), \
xmlhelp/util/ucpchelp1) \
$(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \
))
$(eval $(call gb_CppunitTest_use_configuration,sw_filters_test))
......
......@@ -83,7 +83,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_odfimport,\
ucb/source/ucp/file/ucpfile1 \
unotools/util/utl \
unoxml/source/service/unoxml \
xmlhelp/util/ucpchelp1 \
$(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \
))
$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_odfimport))
......
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