diff --git a/build/android/Makefile b/build/android/Makefile index 983c234f4..1ceafadf3 100644 --- a/build/android/Makefile +++ b/build/android/Makefile @@ -78,19 +78,12 @@ OPENAL_TIMESTAMP = $(OPENAL_DIR)/timestamp OPENAL_TIMESTAMP_INT = $(ROOT)/deps/openal_timestamp OPENAL_URL_HTTP = http://kcat.strangesoft.net/openal-releases/openal-soft-$(OPENAL_VERSION).tar.bz2 -OGG_VERSION = 1.3.2 -OGG_DIR = $(ROOT)/deps/libogg-$(OGG_VERSION) -OGG_LIB = $(OGG_DIR)/build/libogg.so -OGG_TIMESTAMP = $(OGG_DIR)/timestamp +OGG_DIR = $(ROOT)/deps/libvorbis-libogg-android/ +OGG_LIB = $(OGG_DIR)libs/$(TARGET_ABI)/libogg.so +VORBIS_LIB = $(OGG_DIR)libs/$(TARGET_ABI)/libogg.so +OGG_TIMESTAMP = $(OGG_DIR)timestamp OGG_TIMESTAMP_INT = $(ROOT)/deps/ogg_timestamp -OGG_URL_HTTP = http://downloads.xiph.org/releases/ogg/libogg-$(OGG_VERSION).tar.gz - -VORBIS_VERSION = 1.3.5 -VORBIS_DIR = $(ROOT)/deps/libvorbis-$(VORBIS_VERSION) -VORBIS_LIB = $(VORBIS_DIR)/build/libvorbis.so -VORBIS_TIMESTAMP = $(VORBIS_DIR)/timestamp -VORBIS_TIMESTAMP_INT = $(ROOT)/deps/vorbis_timestamp -VORBIS_URL_HTTP = http://downloads.xiph.org/releases/vorbis/libvorbis-$(VORBIS_VERSION).tar.gz +OGG_URL_GIT = https://github.com/vincentjames501/libvorbis-libogg-android IRRLICHT_REVISION = 5122 IRRLICHT_DIR = $(ROOT)/deps/irrlicht/ @@ -170,7 +163,7 @@ endif $(ASSETS_TIMESTAMP) $(LEVELDB_TIMESTAMP) \ $(OPENAL_TIMESTAMP) $(OGG_TIMESTAMP) \ $(IRRLICHT_TIMESTAMP) $(CURL_TIMESTAMP) \ - $(OPENSSL_TIMESTAMP) $(VORBIS_TIMESTAMP\ + $(OPENSSL_TIMESTAMP) \ $(ROOT)/jni/src/android_version.h \ $(ROOT)/jni/src/android_version_githash.h @@ -293,16 +286,16 @@ ogg_download : echo "ogg sources missing, downloading..."; \ mkdir -p ${ROOT}/deps; \ cd ${ROOT}/deps ; \ - wget ${OGG_URL_HTTP} || exit 1; \ - tar -xzf libogg-${OGG_VERSION}.tar.gz; \ - rm libogg-${OGG_VERSION}.tar.gz; \ - ln -s libogg-${OGG_VERSION} libogg; \ + git clone ${OGG_URL_GIT}|| exit 1; \ + cd libvorbis-libogg-android ; \ + patch -p1 < ../../libvorbis-libogg-fpu.patch || exit 1; \ + sed -i 's-:-?-' jni/Application.mk; \ fi ogg : $(OGG_LIB) $(OGG_LIB): $(OGG_TIMESTAMP) - @REFRESH=0; \ + + @REFRESH=0; \ if [ ! -e ${OGG_TIMESTAMP_INT} ] ; then \ echo "${OGG_TIMESTAMP_INT} doesn't exist"; \ REFRESH=1; \ @@ -311,98 +304,23 @@ $(OGG_LIB): $(OGG_TIMESTAMP) REFRESH=1; \ fi; \ if [ $$REFRESH -ne 0 ] ; then \ + export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \ echo "changed timestamp for ogg detected building..."; \ cd ${OGG_DIR}; \ - export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-ogg; \ - ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ - --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \ - --install-dir=$${TOOLCHAIN}; \ - export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ - export CXX=${CROSS_PREFIX}g++; \ - export CC=${CROSS_PREFIX}gcc; \ - export AR=${CROSS_PREFIX}ar; \ - export LD=${CROSS_PREFIX}ld; \ - export AS=${CROSS_PREFIX}as; \ - export NM=${CROSS_PREFIX}nm; \ - export STRIP=${CROSS_PREFIX}strip; \ - export RANLIB=${CROSS_PREFIX}ranlib; \ - export OBJDUMP=${CROSS_PREFIX}objdump; \ - export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \ - CC=${CROSS_PREFIX}gcc ./configure --host=${TARGET_HOST} --target=${TARGET_HOST} \ - --build=x86_64-linux --with-sysroot="${TOOLCHAIN}" --prefix="${TOOLCHAIN}" || exit 1; \ - $(MAKE) -s || exit 1; \ + ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \ + APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} \ + TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \ + TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \ + TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \ touch ${OGG_TIMESTAMP}; \ touch ${OGG_TIMESTAMP_INT}; \ - $(RM) -rf $${TOOLCHAIN}; \ else \ - echo "nothing to be done for ogg"; \ + echo "nothing to be done for libogg/libvorbis"; \ fi clean_ogg : $(RM) -rf ${OGG_DIR} -$(VORBIS_TIMESTAMP) : vorbis_download - @LAST_MODIF=$$(find ${VORBIS_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \ - if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \ - touch ${VORBIS_TIMESTAMP}; \ - fi - -vorbis_download : - @if [ ! -d ${VORBIS_DIR} ] ; then \ - echo "vorbis sources missing, downloading..."; \ - mkdir -p ${ROOT}/deps; \ - cd ${ROOT}/deps ; \ - wget ${VORBIS_URL_HTTP} || exit 1; \ - tar -xzf libvorbis-${VORBIS_VERSION}.tar.gz; \ - rm libvorbis-${VORBIS_VERSION}.tar.gz; \ - ln -s libvorbis-${VORBIS_VERSION} libvorbis; \ - fi - -vorbis : $(VORBIS_LIB) - -$(VORBIS_LIB): $(VORBIS_TIMESTAMP) $(OGG_LIB) - @REFRESH=0; \ - if [ ! -e ${VORBIS_TIMESTAMP_INT} ] ; then \ - echo "${VORBIS_TIMESTAMP_INT} doesn't exist"; \ - REFRESH=1; \ - fi; \ - if [ ${VORBIS_TIMESTAMP} -nt ${VORBIS_TIMESTAMP_INT} ] ; then \ - REFRESH=1; \ - fi; \ - if [ $$REFRESH -ne 0 ] ; then \ - echo "changed timestamp for vorbis detected building..."; \ - cd ${VORBIS_DIR}; \ - export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-vorbis; \ - ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ - --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \ - --install-dir=$${TOOLCHAIN}; \ - export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ - export CXX=${CROSS_PREFIX}g++; \ - export CC=${CROSS_PREFIX}gcc; \ - export AR=${CROSS_PREFIX}ar; \ - export LD=${CROSS_PREFIX}ld; \ - export AS=${CROSS_PREFIX}as; \ - export NM=${CROSS_PREFIX}nm; \ - export STRIP=${CROSS_PREFIX}strip; \ - export RANLIB=${CROSS_PREFIX}ranlib; \ - export OBJDUMP=${CROSS_PREFIX}objdump; \ - export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \ - CC=${CROSS_PREFIX}gcc ./configure --host=${TARGET_HOST} --target=${TARGET_HOST} \ - --build=x86_64-linux --with-sysroot="${TOOLCHAIN}" \ - --with-ogg-libraries="${VORBIS_DIR}/../libogg/src/.libs" \ - --with-ogg-includes="${VORBIS_DIR}/../libogg/include" OGG_CFLAGS="${VORBIS_DIR}/../libogg" \ - --prefix="${TOOLCHAIN}" || exit 1; \ - CC=${CROSS_PREFIX}gcc ANDROID_DEV=/tmp/ndk-${TARGET_HOST}-vorbis make || exit 1; \ - touch ${VORBIS_TIMESTAMP}; \ - touch ${VORBIS_TIMESTAMP_INT}; \ - $(RM) -rf $${TOOLCHAIN}; \ - else \ - echo "nothing to be done for vorbis"; \ - fi - -clean_vorbis : - $(RM) -rf ${VORBIS_DIR} - $(OPENSSL_TIMESTAMP) : openssl_download @LAST_MODIF=$$(find ${OPENSSL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \ if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \ @@ -883,8 +801,8 @@ assets : $(ASSETS_TIMESTAMP) clean_assets : @$(RM) -r assets -apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) $(LEVELDB_TARGET) \ - $(OPENAL_LIB) $(OGG_LIB) $(VORBIS_LIB) prep_srcdir $(ROOT)/jni/src/android_version.h \ +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 \ $(ROOT)/jni/src/android_version_githash.h sqlite3_download @export NDEBUG=$$NDEBUG; $(MAKE) manifest; \ export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \ @@ -926,7 +844,7 @@ envpaths : clean_all : @$(MAKE) clean_apk; \ $(MAKE) clean_assets clean_iconv clean_irrlicht clean_leveldb clean_curl clean_openssl \ - clean_openal clean_ogg clean_vorbis clean_gmp clean_manifest; \ + clean_openal clean_ogg clean_gmp clean_manifest; \ sleep 1; \ $(RM) -r gen libs obj deps bin Debug and_env diff --git a/build/android/jni/Android.mk b/build/android/jni/Android.mk index e6977c9ab..6fe0fa25a 100644 --- a/build/android/jni/Android.mk +++ b/build/android/jni/Android.mk @@ -36,12 +36,12 @@ include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := ogg -LOCAL_SRC_FILES := deps/libogg/src/.libs/libogg.so +LOCAL_SRC_FILES := deps/libvorbis-libogg-android/libs/$(TARGET_LIBDIR)/libogg.so include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := vorbis -LOCAL_SRC_FILES := deps/libvorbis/lib/.libs/libvorbis.so +LOCAL_SRC_FILES := deps/libvorbis-libogg-android/libs/$(TARGET_LIBDIR)/libvorbis.so include $(PREBUILT_SHARED_LIBRARY) include $(CLEAR_VARS) @@ -111,8 +111,7 @@ LOCAL_C_INCLUDES := \ deps/freetype/include \ deps/curl/include \ deps/openal/include \ - deps/libogg/include \ - deps/libvorbis/include \ + deps/libvorbis-libogg-android/jni/include \ deps/gmp/usr/include \ deps/leveldb/include \ deps/sqlite/