From 572990dcd3f43386860b5b14015ad722fb96ea83 Mon Sep 17 00:00:00 2001 From: est31 Date: Wed, 10 Jun 2015 00:35:21 +0200 Subject: Add utf-8 conversion utilities and re-add intlGUIEditBox --- build/android/Makefile | 69 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) (limited to 'build/android/Makefile') diff --git a/build/android/Makefile b/build/android/Makefile index 1b33a4599..798d56037 100644 --- a/build/android/Makefile +++ b/build/android/Makefile @@ -131,6 +131,13 @@ FREETYPE_TIMESTAMP = $(FREETYPE_DIR)timestamp FREETYPE_TIMESTAMP_INT = $(ROOT)/deps/freetype_timestamp FREETYPE_URL_GIT = https://github.com/cdave1/freetype2-android +ICONV_VERSION = 1.14 +ICONV_DIR = $(ROOT)/deps/libiconv/ +ICONV_LIB = $(ICONV_DIR)/iconv.so +ICONV_TIMESTAMP = $(ICONV_DIR)timestamp +ICONV_TIMESTAMP_INT = $(ROOT)/deps/iconv_timestamp +ICONV_URL_HTTP = http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$(ICONV_VERSION).tar.gz + SQLITE3_FOLDER = sqlite-amalgamation-3080704 SQLITE3_URL = http://www.sqlite.org/2014/$(SQLITE3_FOLDER).zip @@ -431,6 +438,64 @@ $(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP) clean_freetype : $(RM) -rf ${FREETYPE_DIR} +$(ICONV_TIMESTAMP) : iconv_download + @LAST_MODIF=$$(find ${ICONV_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \ + if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \ + touch ${ICONV_TIMESTAMP}; \ + fi + +iconv_download : + @if [ ! -d ${ICONV_DIR} ] ; then \ + echo "iconv sources missing, downloading..."; \ + mkdir -p ${ROOT}/deps; \ + cd ${ROOT}/deps; \ + wget ${ICONV_URL_HTTP} || exit 1; \ + tar -xzf libiconv-${ICONV_VERSION}.tar.gz || exit 1; \ + rm libiconv-${ICONV_VERSION}.tar.gz; \ + ln -s libiconv-${ICONV_VERSION} libiconv; \ + cd ${ICONV_DIR}; \ + patch -p1 < ${ROOT}/libiconv_android.patch; \ + patch -p1 < ${ROOT}/libiconv_android_mk.patch; \ + patch -p1 < ${ROOT}/libiconv_stdio.patch; \ + cd jni; \ + ln -s .. src; \ + fi + +iconv : $(ICONV_LIB) + +$(ICONV_LIB) : $(ICONV_TIMESTAMP) + @REFRESH=0; \ + if [ ! -e ${ICONV_TIMESTAMP_INT} ] ; then \ + REFRESH=1; \ + fi; \ + if [ ! -e ${ICONV_LIB} ] ; then \ + REFRESH=1; \ + fi; \ + if [ ${ICONV_TIMESTAMP} -nt ${ICONV_TIMESTAMP_INT} ] ; then \ + REFRESH=1; \ + fi; \ + if [ $$REFRESH -ne 0 ] ; then \ + mkdir -p ${ICONV_DIR}; \ + export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \ + echo "changed timestamp for iconv detected building..."; \ + cd ${ICONV_DIR}; \ + ./configure; \ + make; \ + export NDK_PROJECT_PATH=${ICONV_DIR}; \ + ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \ + APP_PLATFORM=${APP_PLATFORM} APP_ABI=${TARGET_ABI} \ + TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \ + TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \ + TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \ + touch ${ICONV_TIMESTAMP}; \ + touch ${ICONV_TIMESTAMP_INT}; \ + else \ + echo "nothing to be done for iconv"; \ + fi + +clean_iconv : + $(RM) -rf ${ICONV_DIR} + #Note: Texturehack patch is required for gpu's not supporting color format # correctly. Known bad GPU: # -geforce on emulator @@ -736,7 +801,7 @@ assets : $(ASSETS_TIMESTAMP) clean_assets : @$(RM) -r assets -apk: $(PATHCFGFILE) assets $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) $(LEVELDB_TARGET) \ +apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) $(LEVELDB_TARGET) \ $(OPENAL_LIB) $(OGG_LIB) prep_srcdir $(ROOT)/jni/src/android_version.h \ sqlite3_download @export NDEBUG=$$NDEBUG; $(MAKE) manifest; \ @@ -778,7 +843,7 @@ envpaths : clean_all : @$(MAKE) clean_apk; \ - $(MAKE) clean_assets clean_irrlicht clean_leveldb clean_curl clean_openssl \ + $(MAKE) clean_assets clean_iconv clean_irrlicht clean_leveldb clean_curl clean_openssl \ clean_openal clean_ogg clean_gmp clean_manifest; \ sleep 1; \ $(RM) -r gen libs obj deps bin Debug and_env -- cgit v1.2.3