diff --git a/scripts/android/expat.sh b/scripts/android/expat.sh index f5dcc7b..a4ab53e 100755 --- a/scripts/android/expat.sh +++ b/scripts/android/expat.sh @@ -1,33 +1,13 @@ #!/bin/bash -if [[ -z ${ANDROID_NDK_ROOT} ]]; then - echo -e "\n(*) ANDROID_NDK_ROOT not defined\n" - exit 1 -fi - -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${API} ]]; then - echo -e "\n(*) API not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -. ${BASEDIR}/build/android-common.sh +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="expat" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) diff --git a/scripts/android/fontconfig.sh b/scripts/android/fontconfig.sh index 105cc96..b3e8ac4 100755 --- a/scripts/android/fontconfig.sh +++ b/scripts/android/fontconfig.sh @@ -1,33 +1,13 @@ #!/bin/bash -if [[ -z ${ANDROID_NDK_ROOT} ]]; then - echo -e "\n(*) ANDROID_NDK_ROOT not defined\n" - exit 1 -fi - -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${API} ]]; then - echo -e "\n(*) API not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -. ${BASEDIR}/build/android-common.sh +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="fontconfig" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) diff --git a/scripts/android/freetype.sh b/scripts/android/freetype.sh index cdd058e..9b9e579 100755 --- a/scripts/android/freetype.sh +++ b/scripts/android/freetype.sh @@ -1,33 +1,13 @@ #!/bin/bash -if [[ -z ${ANDROID_NDK_ROOT} ]]; then - echo -e "\n(*) ANDROID_NDK_ROOT not defined\n" - exit 1 -fi - -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${API} ]]; then - echo -e "\n(*) API not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -. ${BASEDIR}/build/android-common.sh +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="freetype" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) @@ -38,7 +18,7 @@ cd ${BASEDIR}/src/${LIB_NAME} || exit 1 make distclean 2>/dev/null 1>/dev/null -# OVERRIDING PKG-CONFIG +# OVERRIDE PKG-CONFIG export LIBPNG_CFLAGS="-I${BASEDIR}/prebuilt/android-$(get_target_build)/libpng/include" export LIBPNG_LIBS="-L${BASEDIR}/prebuilt/android-$(get_target_build)/libpng/lib" diff --git a/scripts/android/fribidi.sh b/scripts/android/fribidi.sh index 6ed88bc..801b9fe 100755 --- a/scripts/android/fribidi.sh +++ b/scripts/android/fribidi.sh @@ -1,33 +1,13 @@ #!/bin/bash -if [[ -z ${ANDROID_NDK_ROOT} ]]; then - echo -e "\n(*) ANDROID_NDK_ROOT not defined\n" - exit 1 -fi - -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${API} ]]; then - echo -e "\n(*) API not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -. ${BASEDIR}/build/android-common.sh +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="fribidi" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) diff --git a/scripts/android/jpeg.sh b/scripts/android/jpeg.sh index 48d5598..9bccc50 100755 --- a/scripts/android/jpeg.sh +++ b/scripts/android/jpeg.sh @@ -1,33 +1,13 @@ #!/bin/bash -if [[ -z ${ANDROID_NDK_ROOT} ]]; then - echo -e "\n(*) ANDROID_NDK_ROOT not defined\n" - exit 1 -fi - -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${API} ]]; then - echo -e "\n(*) API not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -. ${BASEDIR}/build/android-common.sh +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="jpeg" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) diff --git a/scripts/android/libass.sh b/scripts/android/libass.sh index 9f049f9..4e2872e 100755 --- a/scripts/android/libass.sh +++ b/scripts/android/libass.sh @@ -1,33 +1,13 @@ #!/bin/bash -if [[ -z ${ANDROID_NDK_ROOT} ]]; then - echo -e "\n(*) ANDROID_NDK_ROOT not defined\n" - exit 1 -fi - -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${API} ]]; then - echo -e "\n(*) API not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -. ${BASEDIR}/build/android-common.sh +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="libass" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) @@ -43,6 +23,7 @@ if [[ ${RECONF_libass} -eq 1 ]]; then autoreconf_library ${LIB_NAME} fi +# SET ARCH OPTIONS ASM_FLAGS="" case ${ARCH} in x86) diff --git a/scripts/android/libiconv.sh b/scripts/android/libiconv.sh index af07532..561b682 100755 --- a/scripts/android/libiconv.sh +++ b/scripts/android/libiconv.sh @@ -1,33 +1,13 @@ #!/bin/bash -if [[ -z ${ANDROID_NDK_ROOT} ]]; then - echo -e "\n(*) ANDROID_NDK_ROOT not defined\n" - exit 1 -fi - -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${API} ]]; then - echo -e "\n(*) API not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -. ${BASEDIR}/build/android-common.sh +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="libiconv" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) diff --git a/scripts/android/libilbc.sh b/scripts/android/libilbc.sh index 57e611d..1d15cd5 100755 --- a/scripts/android/libilbc.sh +++ b/scripts/android/libilbc.sh @@ -1,33 +1,13 @@ #!/bin/bash -if [[ -z ${ANDROID_NDK_ROOT} ]]; then - echo -e "\n(*) ANDROID_NDK_ROOT not defined\n" - exit 1 -fi - -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${API} ]]; then - echo -e "\n(*) API not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -. ${BASEDIR}/build/android-common.sh +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="libilbc" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) diff --git a/scripts/android/openh264.sh b/scripts/android/openh264.sh index e020ade..6a529cc 100755 --- a/scripts/android/openh264.sh +++ b/scripts/android/openh264.sh @@ -1,49 +1,30 @@ #!/bin/bash -if [[ -z ${ANDROID_NDK_ROOT} ]]; then - echo -e "\n(*) ANDROID_NDK_ROOT not defined\n" - exit 1 -fi - -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${API} ]]; then - echo -e "\n(*) API not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -. ${BASEDIR}/build/android-common.sh +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="openh264" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) CFLAGS=$(get_cflags ${LIB_NAME}) CXXFLAGS=$(get_cxxflags ${LIB_NAME}) LDFLAGS=$(get_ldflags ${LIB_NAME}) +# SET ARCH OPTIONS case ${ARCH} in arm-v7a-neon) - ASM_ARCH=arm + ARCH_OPTIONS=arm CFLAGS+=" -DHAVE_NEON -DANDROID_NDK" ;; arm64-v8a) - ASM_ARCH=arm64 + ARCH_OPTIONS=arm64 CFLAGS+=" -DHAVE_NEON_AARCH64 -DANDROID_NDK" ;; x86*) - ASM_ARCH=x86 + ARCH_OPTIONS=x86 CFLAGS+=" -DHAVE_AVX2 -DANDROID_NDK" ;; esac @@ -73,7 +54,7 @@ NDKLEVEL="${API}" \ NDKROOT="${ANDROID_NDK_ROOT}" \ NDK_TOOLCHAIN_VERSION=clang \ AR="$AR" \ -ASM_ARCH=${ASM_ARCH} \ +ARCH_OPTIONS=${ARCH_OPTIONS} \ TARGET="android-${API}" \ install-static || exit 1 diff --git a/scripts/objc/expat.sh b/scripts/objc/expat.sh index 337f76d..bb501ac 100755 --- a/scripts/objc/expat.sh +++ b/scripts/objc/expat.sh @@ -1,37 +1,13 @@ #!/bin/bash -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${TARGET_SDK} ]]; then - echo -e "\n(*) TARGET_SDK not defined\n" - exit 1 -fi - -if [[ -z ${SDK_PATH} ]]; then - echo -e "\n(*) SDK_PATH not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -if [[ ${FFMPEG_KIT_BUILD_TYPE} == "tvos" ]]; then - . ${BASEDIR}/build/tvos-common.sh -else - . ${BASEDIR}/build/ios-common.sh -fi +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="expat" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) diff --git a/scripts/objc/fontconfig.sh b/scripts/objc/fontconfig.sh index e20d513..5b20d17 100755 --- a/scripts/objc/fontconfig.sh +++ b/scripts/objc/fontconfig.sh @@ -1,37 +1,13 @@ #!/bin/bash -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${TARGET_SDK} ]]; then - echo -e "\n(*) TARGET_SDK not defined\n" - exit 1 -fi - -if [[ -z ${SDK_PATH} ]]; then - echo -e "\n(*) SDK_PATH not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -if [[ ${FFMPEG_KIT_BUILD_TYPE} == "tvos" ]]; then - . ${BASEDIR}/build/tvos-common.sh -else - . ${BASEDIR}/build/ios-common.sh -fi +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="fontconfig" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) diff --git a/scripts/objc/freetype.sh b/scripts/objc/freetype.sh index 30d2d14..ae3164e 100755 --- a/scripts/objc/freetype.sh +++ b/scripts/objc/freetype.sh @@ -1,37 +1,13 @@ #!/bin/bash -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${TARGET_SDK} ]]; then - echo -e "\n(*) TARGET_SDK not defined\n" - exit 1 -fi - -if [[ -z ${SDK_PATH} ]]; then - echo -e "\n(*) SDK_PATH not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -if [[ ${FFMPEG_KIT_BUILD_TYPE} == "tvos" ]]; then - . ${BASEDIR}/build/tvos-common.sh -else - . ${BASEDIR}/build/ios-common.sh -fi +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="freetype" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) @@ -42,7 +18,7 @@ cd ${BASEDIR}/src/${LIB_NAME} || exit 1 make distclean 2>/dev/null 1>/dev/null -# OVERRIDING PKG-CONFIG +# OVERRIDE PKG-CONFIG export LIBPNG_CFLAGS="-I${BASEDIR}/prebuilt/$(get_target_build_directory)/libpng/include" export LIBPNG_LIBS="-L${BASEDIR}/prebuilt/$(get_target_build_directory)/libpng/lib" diff --git a/scripts/objc/fribidi.sh b/scripts/objc/fribidi.sh index 56dda80..ef0610e 100755 --- a/scripts/objc/fribidi.sh +++ b/scripts/objc/fribidi.sh @@ -1,37 +1,13 @@ #!/bin/bash -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${TARGET_SDK} ]]; then - echo -e "\n(*) TARGET_SDK not defined\n" - exit 1 -fi - -if [[ -z ${SDK_PATH} ]]; then - echo -e "\n(*) SDK_PATH not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -if [[ ${FFMPEG_KIT_BUILD_TYPE} == "tvos" ]]; then - . ${BASEDIR}/build/tvos-common.sh -else - . ${BASEDIR}/build/ios-common.sh -fi +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="fribidi" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) diff --git a/scripts/objc/jpeg.sh b/scripts/objc/jpeg.sh index 51e4088..4753b10 100755 --- a/scripts/objc/jpeg.sh +++ b/scripts/objc/jpeg.sh @@ -1,44 +1,21 @@ #!/bin/bash -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${TARGET_SDK} ]]; then - echo -e "\n(*) TARGET_SDK not defined\n" - exit 1 -fi - -if [[ -z ${SDK_PATH} ]]; then - echo -e "\n(*) SDK_PATH not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -if [[ ${FFMPEG_KIT_BUILD_TYPE} == "tvos" ]]; then - . ${BASEDIR}/build/tvos-common.sh -else - . ${BASEDIR}/build/ios-common.sh -fi +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="jpeg" set_toolchain_paths ${LIB_NAME} export CCAS=${AS} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) export LDFLAGS=$(get_ldflags ${LIB_NAME}) export ASM_FLAGS=$(get_asmflags ${LIB_NAME}) +# SET ARCH OPTIONS ARCH_OPTIONS="" case ${ARCH} in armv7 | armv7s | arm64 | arm64e) diff --git a/scripts/objc/libass.sh b/scripts/objc/libass.sh index 008c040..2907332 100755 --- a/scripts/objc/libass.sh +++ b/scripts/objc/libass.sh @@ -1,43 +1,20 @@ #!/bin/bash -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${TARGET_SDK} ]]; then - echo -e "\n(*) TARGET_SDK not defined\n" - exit 1 -fi - -if [[ -z ${SDK_PATH} ]]; then - echo -e "\n(*) SDK_PATH not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -if [[ ${FFMPEG_KIT_BUILD_TYPE} == "tvos" ]]; then - . ${BASEDIR}/build/tvos-common.sh -else - . ${BASEDIR}/build/ios-common.sh -fi +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="libass" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) export LDFLAGS=$(get_ldflags ${LIB_NAME}) export PKG_CONFIG_LIBDIR=${INSTALL_PKG_CONFIG_DIR} +# SET ARCH OPTIONS ARCH_OPTIONS="" case ${ARCH} in x86-64 | x86-64-mac-catalyst) diff --git a/scripts/objc/libilbc.sh b/scripts/objc/libilbc.sh index 812f05d..fea6487 100755 --- a/scripts/objc/libilbc.sh +++ b/scripts/objc/libilbc.sh @@ -1,37 +1,13 @@ #!/bin/bash -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${TARGET_SDK} ]]; then - echo -e "\n(*) TARGET_SDK not defined\n" - exit 1 -fi - -if [[ -z ${SDK_PATH} ]]; then - echo -e "\n(*) SDK_PATH not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -if [[ ${FFMPEG_KIT_BUILD_TYPE} == "tvos" ]]; then - . ${BASEDIR}/build/tvos-common.sh -else - . ${BASEDIR}/build/ios-common.sh -fi +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="libilbc" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) diff --git a/scripts/objc/openh264.sh b/scripts/objc/openh264.sh index 7fecf90..d65b8b1 100755 --- a/scripts/objc/openh264.sh +++ b/scripts/objc/openh264.sh @@ -1,43 +1,20 @@ #!/bin/bash -if [[ -z ${ARCH} ]]; then - echo -e "\n(*) ARCH not defined\n" - exit 1 -fi - -if [[ -z ${TARGET_SDK} ]]; then - echo -e "\n(*) TARGET_SDK not defined\n" - exit 1 -fi - -if [[ -z ${SDK_PATH} ]]; then - echo -e "\n(*) SDK_PATH not defined\n" - exit 1 -fi - -if [[ -z ${BASEDIR} ]]; then - echo -e "\n(*) BASEDIR not defined\n" - exit 1 -fi - # ENABLE COMMON FUNCTIONS -if [[ ${FFMPEG_KIT_BUILD_TYPE} == "tvos" ]]; then - . ${BASEDIR}/build/tvos-common.sh -else - . ${BASEDIR}/build/ios-common.sh -fi +source "${BASEDIR}"/scripts/function-${FFMPEG_KIT_BUILD_TYPE}.sh # PREPARE PATHS & DEFINE ${INSTALL_PKG_CONFIG_DIR} LIB_NAME="openh264" set_toolchain_paths ${LIB_NAME} -# PREPARING FLAGS +# SET BUILD FLAGS BUILD_HOST=$(get_build_host) CFLAGS=$(get_cflags ${LIB_NAME}) CXXFLAGS=$(get_cxxflags ${LIB_NAME}) LDFLAGS=$(get_ldflags ${LIB_NAME}) -OS_OPTIONS="OS=ios" +# SET ARCH OPTIONS +ARCH_OPTIONS="OS=ios" case ${ARCH} in armv7 | armv7s) CFLAGS+=" -DHAVE_NEON" @@ -46,7 +23,7 @@ case ${ARCH} in CFLAGS+=" -DHAVE_NEON_AARCH64" ;; x86-64-mac-catalyst) - OS_OPTIONS="" + ARCH_OPTIONS="" CFLAGS+=" -DHAVE_AVX2" ;; *) @@ -74,7 +51,7 @@ CFLAGS="$CFLAGS" \ CXX="${CXX}" \ CXXFLAGS="${CXXFLAGS}" \ LDFLAGS="$LDFLAGS" \ -${OS_OPTIONS} \ +${ARCH_OPTIONS} \ PREFIX="${BASEDIR}/prebuilt/$(get_target_build_directory)/${LIB_NAME}" \ SDK_MIN="${IOS_MIN_VERSION}" \ SDKROOT="${SDK_PATH}" \ diff --git a/scripts/source.sh b/scripts/source.sh index a1bef3d..32054be 100644 --- a/scripts/source.sh +++ b/scripts/source.sh @@ -8,7 +8,12 @@ get_library_source() { case $1 in cpu-features) SOURCE_REPO_URL="https://github.com/tanersener/cpu_features" - SOURCE_ID="v0.4.1.1" # TAG + SOURCE_ID="v0.4.1.1" + SOURCE_TYPE="TAG" + ;; + expat) + SOURCE_REPO_URL="https://github.com/tanersener/libexpat" + SOURCE_ID="R_2_2_10" SOURCE_TYPE="TAG" ;; ffmpeg) @@ -16,6 +21,46 @@ get_library_source() { SOURCE_ID="d222da435e63a2665b85c0305ad2cf8a07b1af6d" # COMMIT -> v4.4-dev-416 SOURCE_TYPE="COMMIT" ;; + fontconfig) + SOURCE_REPO_URL="https://github.com/tanersener/fontconfig" + SOURCE_ID="2.13.92" + SOURCE_TYPE="TAG" + ;; + freetype) + SOURCE_REPO_URL="https://github.com/tanersener/freetype2" + SOURCE_ID="VER-2-10-2" + SOURCE_TYPE="TAG" + ;; + fribidi) + SOURCE_REPO_URL="https://github.com/tanersener/fribidi" + SOURCE_ID="v1.0.10" + SOURCE_TYPE="TAG" + ;; + jpeg) + SOURCE_REPO_URL="https://github.com/tanersener/libjpeg-turbo" + SOURCE_ID="2.0.5" + SOURCE_TYPE="TAG" + ;; + libass) + SOURCE_REPO_URL="https://github.com/tanersener/libass" + SOURCE_ID="0.15.0" + SOURCE_TYPE="TAG" + ;; + libiconv) + SOURCE_REPO_URL="https://github.com/tanersener/libiconv" + SOURCE_ID="v1.16" + SOURCE_TYPE="TAG" + ;; + libilbc) + SOURCE_REPO_URL="https://github.com/tanersener/libilbc" + SOURCE_ID="v2.0.2" + SOURCE_TYPE="TAG" + ;; + openh264) + SOURCE_REPO_URL="https://github.com/tanersener/openh264" + SOURCE_ID="v2.1.1" + SOURCE_TYPE="TAG" + ;; esac case $2 in diff --git a/src/.gitignore b/src/.gitignore index c20a8fc..c0783f1 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,2 +1,5 @@ cpu-features ffmpeg +fontconfig +freetype +libiconv