diff --git a/build/android-common.sh b/build/android-common.sh index 8d3425b86..536331048 100755 --- a/build/android-common.sh +++ b/build/android-common.sh @@ -206,7 +206,7 @@ get_android_arch() { } get_common_includes() { - echo "-I${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot/usr/include -I${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/sysroot/usr/local/include" + echo "" } get_common_cflags() { diff --git a/build/android-openh264.sh b/build/android-openh264.sh index ca9193ce6..6a200265e 100755 --- a/build/android-openh264.sh +++ b/build/android-openh264.sh @@ -35,39 +35,29 @@ LDFLAGS=$(get_ldflags ${LIB_NAME}) case ${ARCH} in arm-v7a-neon) + ASM_ARCH=arm # Enabling NEON causes undefined symbol error for WelsCopy8x8_neon # CFLAGS+=" -DHAVE_NEON" ;; arm64-v8a) + ASM_ARCH=arm64 CFLAGS+=" -DHAVE_NEON_AARCH64" ;; x86*) + ASM_ARCH=x86 CFLAGS+=" -DHAVE_AVX2" ;; esac cd ${BASEDIR}/src/${LIB_NAME} || exit 1 -# MAKE SURE THAT ASM IS ENABLED FOR ALL IOS ARCHITECTURES -${SED_INLINE} 's/arm64 aarch64/arm64% aarch64/g' ${BASEDIR}/src/${LIB_NAME}/build/arch.mk -${SED_INLINE} 's/%86 x86_64,/%86 x86_64 x86-64,/g' ${BASEDIR}/src/${LIB_NAME}/build/arch.mk -${SED_INLINE} 's/filter-out arm64,/filter-out arm64%,/g' ${BASEDIR}/src/${LIB_NAME}/build/arch.mk -${SED_INLINE} 's/CFLAGS += -DHAVE_NEON/#CFLAGS += -DHAVE_NEON/g' ${BASEDIR}/src/${LIB_NAME}/build/arch.mk -${SED_INLINE} 's/ifeq (\$(ASM_ARCH), arm64)/ifneq (\$(filter arm64%, \$(ASM_ARCH)),)/g' ${BASEDIR}/src/${LIB_NAME}/codec/common/targets.mk -${SED_INLINE} 's/ifeq (\$(ASM_ARCH), x86)/ifneq (\$(filter %86 x86-64, \$(ASM_ARCH)),)/g' ${BASEDIR}/src/${LIB_NAME}/codec/common/targets.mk -${SED_INLINE} 's/ifeq (\$(ASM_ARCH), arm)/ifneq (\$(filter armv%, \$(ASM_ARCH)),)/g' ${BASEDIR}/src/${LIB_NAME}/codec/common/targets.mk - -# DO NOT USE DEFAULT ANDROID ARCH FLAGS -${SED_INLINE} 's/ CFLAGS +=/ #CFLAGS +=/g' ${BASEDIR}/src/${LIB_NAME}/build/platform-android.mk -${SED_INLINE} 's/ LDFLAGS +=/ #LDFLAGS +=/g' ${BASEDIR}/src/${LIB_NAME}/build/platform-android.mk - make clean 2>/dev/null 1>/dev/null make -j$(get_cpu_count) \ ARCH="$(get_toolchain_arch)" \ -CC="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/${CC}" \ +CC="$CC" \ CFLAGS="$CFLAGS" \ -CXX="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${TOOLCHAIN}/bin/${CXX}" \ +CXX="$CXX" \ CXXFLAGS="${CXXFLAGS}" \ LDFLAGS="$LDFLAGS" \ OS=android \ @@ -75,8 +65,10 @@ PREFIX="${BASEDIR}/prebuilt/android-$(get_target_build)/${LIB_NAME}" \ NDKLEVEL="${API}" \ NDKROOT="${ANDROID_NDK_ROOT}" \ NDK_TOOLCHAIN_VERSION=clang \ +AR="$AR" \ +ASM_ARCH=${ASM_ARCH} \ TARGET="android-${API}" \ install-static || exit 1 # MANUALLY COPY PKG-CONFIG FILES -cp ${BASEDIR}/src/${LIB_NAME}/openh264-static.pc ${INSTALL_PKG_CONFIG_DIR}/openh264.pc || exit 1 \ No newline at end of file +cp ${BASEDIR}/src/${LIB_NAME}/openh264-static.pc ${INSTALL_PKG_CONFIG_DIR}/openh264.pc || exit 1