am 73fe4952: Merge "32-bit dicttool"

* commit '73fe49523b70b0cf649fa7fc0f096f91431f44f0':
  32-bit dicttool
main
Ken Wakasa 2014-04-04 12:37:18 +00:00 committed by Android Git Automerger
commit 9268c09163
2 changed files with 11 additions and 9 deletions

View File

@ -29,13 +29,7 @@ ifeq ($(FLAG_DBG), true)
LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline
endif #FLAG_DBG
ifneq ($(strip $(HOST_JDK_IS_64BIT_VERSION)),)
LOCAL_CFLAGS += -m64
LOCAL_LDFLAGS += -m64
endif #HOST_JDK_IS_64BIT_VERSION
LOCAL_CFLAGS += -DHOST_TOOL -fPIC -Wno-deprecated
LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
LOCAL_CFLAGS += -DHOST_TOOL -fPIC -Wno-deprecated -Wno-unused-parameter -Wno-unused-function
LOCAL_CLANG := true
# For C++11
@ -44,7 +38,6 @@ LOCAL_CFLAGS += -std=c++11
LATINIME_NATIVE_JNI_DIR := $(LATINIME_DIR_RELATIVE_TO_DICTTOOL)/native/jni
LATINIME_NATIVE_SRC_DIR := $(LATINIME_DIR_RELATIVE_TO_DICTTOOL)/native/jni/src
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(LATINIME_NATIVE_SRC_DIR)
# Used in jni_common.cpp to avoid registering useless methods.
include $(LOCAL_PATH)/$(LATINIME_NATIVE_JNI_DIR)/NativeFileList.mk

View File

@ -68,5 +68,14 @@ else
libpath="$frameworkdir/$lib"
fi
# Check if the host Java executable supports a 32-bit JVM. It needs to do because the JNI
# library is 32-bit.
${DICTTOOL_JAVA-java} -d32 -version > /dev/null 2>&1
if [[ $? != 0 ]] ; then
echo Please specify a Java executable that supports a 32-bit JVM as DICTTOOL_JAVA.
exit 1
fi
# might need more memory, e.g. -Xmx128M
exec java -ea -classpath "$libpath":"$jarpath" -Djava.library.path="$libdir" "$classname" "$@"
exec ${DICTTOOL_JAVA-java} -d32 -ea -classpath "$libpath":"$jarpath" \
-Djava.library.path="$libdir" "$classname" "$@"