From 4c86999458135184f2d1b4e99b847d8c5e392744 Mon Sep 17 00:00:00 2001 From: Taner Sener Date: Fri, 28 Feb 2020 23:11:48 +0000 Subject: [PATCH] refactor ARCH_OPTIONS in build scripts --- build/android-libpng.sh | 10 +++++----- build/android-x265.sh | 12 ++++++------ build/ios-gnutls.sh | 10 +++++----- build/ios-libpng.sh | 8 ++++---- build/ios-x265.sh | 12 ++++++------ 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/build/android-libpng.sh b/build/android-libpng.sh index 03dfcecfb..c0824ee2c 100755 --- a/build/android-libpng.sh +++ b/build/android-libpng.sh @@ -33,19 +33,19 @@ export CFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) export LDFLAGS=$(get_ldflags ${LIB_NAME}) -CPU_SPECIFIC_OPTIONS="" +ARCH_OPTIONS="" case ${ARCH} in x86 | x86-64) - CPU_SPECIFIC_OPTIONS="--enable-hardware-optimizations --enable-intel-sse=yes" + ARCH_OPTIONS="--enable-hardware-optimizations --enable-intel-sse=yes" ;; arm-v7a-neon | arm64-v8a) - CPU_SPECIFIC_OPTIONS="--enable-hardware-optimizations --enable-arm-neon=yes" + ARCH_OPTIONS="--enable-hardware-optimizations --enable-arm-neon=yes" ;; arm-v7a) # hardware-optimizations not enabled because # when --enable-hardware-optimizations is added # make tries to build arm-neon specific instructions, which breaks compilation - CPU_SPECIFIC_OPTIONS="--enable-arm-neon=no" + ARCH_OPTIONS="--enable-arm-neon=no" ;; esac @@ -67,7 +67,7 @@ fi --disable-fast-install \ --disable-unversioned-libpng-pc \ --disable-unversioned-libpng-config \ - ${CPU_SPECIFIC_OPTIONS} \ + ${ARCH_OPTIONS} \ --host=${BUILD_HOST} || exit 1 make -j$(get_cpu_count) || exit 1 diff --git a/build/android-x265.sh b/build/android-x265.sh index 01dae6da1..c13ff3e81 100755 --- a/build/android-x265.sh +++ b/build/android-x265.sh @@ -42,19 +42,19 @@ if [[ ${DOWNLOAD_RESULT} -ne 0 ]]; then fi cd ${BASEDIR}/src/${LIB_NAME} || exit 1 -ASM_OPTIONS="" +ARCH_OPTIONS="" case ${ARCH} in arm-v7a | arm-v7a-neon) - ASM_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=1" + ARCH_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=1" ;; arm64-v8a) - ASM_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=1" + ARCH_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=1" ;; x86) - ASM_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=0" + ARCH_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=0" ;; x86-64) - ASM_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=0" + ARCH_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=0" ;; esac @@ -87,7 +87,7 @@ cmake -Wno-dev \ -DSTATIC_LINK_CRT=1 \ -DENABLE_PIC=1 \ -DENABLE_CLI=0 \ - ${ASM_OPTIONS} \ + ${ARCH_OPTIONS} \ -DCMAKE_SYSTEM_PROCESSOR="${ARCH}" \ -DENABLE_SHARED=0 ../source || exit 1 diff --git a/build/ios-gnutls.sh b/build/ios-gnutls.sh index 4646e0028..26c2b29b0 100755 --- a/build/ios-gnutls.sh +++ b/build/ios-gnutls.sh @@ -48,18 +48,18 @@ export HOGWEED_LIBS="-L${BASEDIR}/prebuilt/$(get_target_build_directory)/nettle/ export GMP_CFLAGS="-I${BASEDIR}/prebuilt/$(get_target_build_directory)/gmp/include" export GMP_LIBS="-L${BASEDIR}/prebuilt/$(get_target_build_directory)/gmp/lib -lgmp" -HARDWARE_ACCELERATION="" +ARCH_OPTIONS="" case ${ARCH} in arm64 | arm64e) - HARDWARE_ACCELERATION="--enable-hardware-acceleration" + ARCH_OPTIONS="--enable-hardware-acceleration" ;; i386) # DISABLING thread_local WHICH IS NOT SUPPORTED ON i386 export CFLAGS+=" -D__thread=" - HARDWARE_ACCELERATION="--enable-hardware-acceleration" + ARCH_OPTIONS="--enable-hardware-acceleration" ;; *) - HARDWARE_ACCELERATION="--enable-hardware-acceleration" + ARCH_OPTIONS="--enable-hardware-acceleration" ;; esac @@ -84,7 +84,7 @@ fi --with-included-unistring \ --without-idn \ --without-p11-kit \ - ${HARDWARE_ACCELERATION} \ + ${ARCH_OPTIONS} \ --enable-static \ --disable-openssl-compatibility \ --disable-shared \ diff --git a/build/ios-libpng.sh b/build/ios-libpng.sh index 159ba6761..ac67fa71c 100755 --- a/build/ios-libpng.sh +++ b/build/ios-libpng.sh @@ -38,13 +38,13 @@ export CPPFLAGS=$(get_cflags ${LIB_NAME}) export CXXFLAGS=$(get_cxxflags ${LIB_NAME}) export LDFLAGS=$(get_ldflags ${LIB_NAME}) -CPU_SPECIFIC_OPTIONS="--enable-hardware-optimizations=yes" +ARCH_OPTIONS="--enable-hardware-optimizations=yes" case ${ARCH} in x86 | x86-64 | x86-64-mac-catalyst) - CPU_SPECIFIC_OPTIONS+=" --enable-intel-sse=yes" + ARCH_OPTIONS+=" --enable-intel-sse=yes" ;; armv7 | armv7s | arm64 | arm64e) - CPU_SPECIFIC_OPTIONS+=" --enable-arm-neon=yes" + ARCH_OPTIONS+=" --enable-arm-neon=yes" ;; esac @@ -66,7 +66,7 @@ fi --disable-fast-install \ --disable-unversioned-libpng-pc \ --disable-unversioned-libpng-config \ - ${CPU_SPECIFIC_OPTIONS} \ + ${ARCH_OPTIONS} \ --host=${BUILD_HOST} || exit 1 make -j$(get_cpu_count) || exit 1 diff --git a/build/ios-x265.sh b/build/ios-x265.sh index b3a4ada4d..11dec4a87 100755 --- a/build/ios-x265.sh +++ b/build/ios-x265.sh @@ -46,19 +46,19 @@ if [[ ${DOWNLOAD_RESULT} -ne 0 ]]; then fi cd ${BASEDIR}/src/${LIB_NAME} || exit 1 -ASM_OPTIONS="" +ARCH_OPTIONS="" case ${ARCH} in armv7 | armv7s) - ASM_OPTIONS="-DENABLE_ASSEMBLY=1 -DCROSS_COMPILE_ARM=1" + ARCH_OPTIONS="-DENABLE_ASSEMBLY=1 -DCROSS_COMPILE_ARM=1" ;; arm64 | arm64e) - ASM_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=1" + ARCH_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=1" ;; x86-64-mac-catalyst) - ASM_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=0" + ARCH_OPTIONS="-DENABLE_ASSEMBLY=0 -DCROSS_COMPILE_ARM=0" ;; *) - ASM_OPTIONS="-DENABLE_ASSEMBLY=1 -DCROSS_COMPILE_ARM=0" + ARCH_OPTIONS="-DENABLE_ASSEMBLY=1 -DCROSS_COMPILE_ARM=0" ;; esac @@ -126,7 +126,7 @@ cmake -Wno-dev \ -DSTATIC_LINK_CRT=1 \ -DENABLE_PIC=1 \ -DENABLE_CLI=0 \ - ${ASM_OPTIONS} \ + ${ARCH_OPTIONS} \ -DCMAKE_SYSTEM_PROCESSOR=$(get_target_arch) \ -DENABLE_SHARED=0 ../source || exit 1