Skip to content

Commit

Permalink
Fix Android deps mkdir bug and verbose make, remove libhidapi.so
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceLR committed Nov 1, 2023
1 parent 626c52f commit a607d34
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 34 deletions.
2 changes: 2 additions & 0 deletions arch/android/CONFIG.ANDROID
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

# TODO: GL fixed renderers don't work. Probably not worth fixing.

[ -z "$NDK_PATH" ] && { echo "Must define NDK_PATH!"; exit 1; }

./config.sh --platform android --enable-release --disable-utils \
--disable-libpng --disable-gl-fixed "$@"
66 changes: 36 additions & 30 deletions arch/android/Makefile.deps
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SDL_VERSION ?= 2.28.2
LIBOGG_VERSION ?= 1.3.5
LIBVORBIS_VERSION ?= 1.3.7
WGET ?= wget
TAR ?= tar

DEPS := arch/android/deps
DEPS_BUILD := arch/android/deps/.build
Expand All @@ -34,53 +35,59 @@ ifeq (${HOST},${HOST_WIN64})
NDK_BUILD := ${NDK_PATH}/ndk-build.cmd
endif

ifneq (${V},1)
WGET := @${WGET}
TAR := @${TAR}
NDK_BUILD := @${NDK_BUILD}
endif

${DEPS} ${JNI_INCLUDES}:
$(if @{V},,@echo " MKDIR " $@)
@${MKDIR} -p $@
${MKDIR} -p $@

ifeq (${ANDROID_TARGET},)

${DEPS}/SDL2-${SDL_VERSION}: | ${DEPS}
$(if ${V},,@echo " WGET " $@)
@${RM} -f [email protected]
@${WGET} https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz [email protected]
@tar -xzf [email protected] -C ${DEPS}/
${RM} -f [email protected]
${WGET} https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz [email protected]
${TAR} -xzf [email protected] -C ${DEPS}/

${DEPS}/libogg-${LIBOGG_VERSION}: | ${DEPS}
$(if ${V},,@echo " WGET " $@)
@${RM} -f [email protected]
@${WGET} http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz [email protected]
@tar -xzf [email protected] -C ${DEPS}/
${RM} -f [email protected]
${WGET} http://downloads.xiph.org/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz [email protected]
${TAR} -xzf [email protected] -C ${DEPS}/

${DEPS}/libvorbis-${LIBVORBIS_VERSION}: | ${DEPS}
$(if ${V},,@echo " WGET " $@)
@${RM} -f [email protected]
@${WGET} http://downloads.xiph.org/releases/vorbis/libvorbis-${LIBVORBIS_VERSION}.tar.gz [email protected]
@tar -xzf [email protected] -C ${DEPS}/
${RM} -f [email protected]
${WGET} http://downloads.xiph.org/releases/vorbis/libvorbis-${LIBVORBIS_VERSION}.tar.gz [email protected]
${TAR} -xzf [email protected] -C ${DEPS}/

${DEPS_BUILD}:
$(if ${V},,@echo " MKDIR " $@)
@${MKDIR} -p ${DEPS_BUILD}
${MKDIR} -p ${DEPS_BUILD}

${DEPS_BUILD}/libogg: ${DEPS}/libogg-${LIBOGG_VERSION} | ${DEPS_BUILD}
@${RM} -rf $@
@${CP} -r $< $@
@${CP} arch/android/libogg-Android.mk "$@/Android.mk"
@${CP} arch/android/config_types.h "$@/include/ogg/"
${RM} -rf $@
${CP} -r $< $@
${CP} arch/android/libogg-Android.mk "$@/Android.mk"
${CP} arch/android/config_types.h "$@/include/ogg/"

${DEPS_BUILD}/libvorbis: ${DEPS}/libvorbis-${LIBVORBIS_VERSION} | ${DEPS_BUILD}
@${RM} -rf $@
@${CP} -r $< $@
@${CP} arch/android/libvorbis-Android.mk "$@/Android.mk"
${RM} -rf $@
${CP} -r $< $@
${CP} arch/android/libvorbis-Android.mk "$@/Android.mk"

${DEPS_BUILD}/SDL2: ${DEPS}/SDL2-${SDL_VERSION} | ${DEPS_BUILD}
@${RM} -rf $@
@${CP} -r $< $@
${RM} -rf $@
${CP} -r $< $@

${DEPS_BUILD}/out: ${DEPS_BUILD}/libogg ${DEPS_BUILD}/libvorbis ${DEPS_BUILD}/SDL2
@${CP} ${JNI_DIR}/Android.mk ${DEPS_BUILD}
${CP} ${JNI_DIR}/Android.mk ${DEPS_BUILD}
$(if ${V},,@echo " NDKBUILD")
@${NDK_BUILD} \
${NDK_BUILD} \
NDK_PROJECT_PATH="${DEPS_BUILD}" \
NDK_LIBS_OUT="${DEPS_BUILD}/out" \
APP_BUILD_SCRIPT="${DEPS_BUILD}/Android.mk" \
Expand All @@ -96,35 +103,34 @@ dep_targets := \
${JNI_INCLUDES}/ogg \
${JNI_INCLUDES}/vorbis \
${JNI_LIBS}/libSDL2.so \
${JNI_LIBS}/libhidapi.so \
${JNI_LIBS}/libogg.so \
${JNI_LIBS}/libvorbis.so \
${JNI_LIBS}/libvorbisfile.so

${DEPS_BUILD}/out/${ABI}/%.so:
@test -s $@ || { echo "Missing $@! Aborting..."; exit 1; }
@test -f $@ || { echo "Missing $@! Aborting..."; exit 1; }

${JNI_LIBS}/%.so: ${DEPS_BUILD}/out/${ABI}/%.so | ${JNI_LIBS}
$(if ${V},,@echo " CP " $< " " $@)
@${CP} $< $@
${CP} $< $@

${JNI_INCLUDES}/SDL2: ${DEPS_BUILD}/SDL2 | ${JNI_INCLUDES}
$(if ${V},,@echo " CP " "$</include/*" $@)
@${MKDIR} -p $@
@${CP} $</include/* $@
${MKDIR} -p $@
${CP} $</include/* $@

${JNI_INCLUDES}/ogg: ${DEPS_BUILD}/libogg | ${JNI_INCLUDES}
$(if ${V},,@echo " CP " $</include ${JNI_INCLUDES})
@${CP} -r "$</include/ogg" ${JNI_INCLUDES}
${CP} -r "$</include/ogg" ${JNI_INCLUDES}

${JNI_INCLUDES}/vorbis: ${DEPS_BUILD}/libvorbis | ${JNI_INCLUDES}
$(if ${V},,@echo " CP " $</include ${JNI_INCLUDES})
@${CP} -r "$</include/vorbis" ${JNI_INCLUDES}
${CP} -r "$</include/vorbis" ${JNI_INCLUDES}

deps-install: ${dep_targets}

deps-uninstall:
$(if ${V},,@echo " RM " ${dep_targets})
@${RM} -rf ${dep_targets}
${RM} -rf ${dep_targets}

endif
8 changes: 4 additions & 4 deletions arch/android/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ ifeq (${NDK_PATH},)
$(error "Must define $$NDK_PATH!")
endif

${JNI_LIB_DIR}/%:
$(if ${V},,@echo " MKDIR " $@)
@${MKDIR} -p "$@"

#
# Determine ${TOOLCHAIN} (the common NDK toolchain path) if not provided.
# Requires determining ${HOST} since currently the NDK toolchain path relies on it.
Expand Down Expand Up @@ -149,6 +145,10 @@ LIBPNG_LDFLAGS := -L${JNI_LIBS} -lpng16
VORBIS_CFLAGS := -I${JNI_INCLUDES}
VORBIS_LDFLAGS := -L${JNI_LIBS} -logg -lvorbis -lvorbisfile

${JNI_LIB_DIR}/${ABI}:
$(if ${V},,@echo " MKDIR " $@)
${MKDIR} -p "$@"

package: all | ${JNI_LIB_DIR}/${ABI}
ifneq (${BUILD_EDITOR},)
$(if ${V},,@echo " MV " ${mzx} "${JNI_LIB_DIR}/${ABI}/${JNI_LIB_SO}")
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ DEVELOPERS
+ _FILE_OFFSET_BITS=64 is now used for 64-bit fseeko, ftello,
readdir, and stat/fstat support for 32-bit Linux builds.
+ Applied various Opal fixes from OpenMPT.
+ Updated Android SDL to 2.28.2. (asie)
+ Updated Android NDK to r23c. (asie)
+ Fixed Android build system handling of missing libraries.
- String values are now allocated separately from the string
struct and name. This may make strings very slightly slower,
but means string pointers are now stable through an entire
Expand Down

0 comments on commit a607d34

Please sign in to comment.