Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Commit

Permalink
refactor ARCH_OPTIONS in build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed Feb 28, 2020
1 parent 95261c1 commit 4c86999
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions build/android-libpng.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions build/android-x265.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions build/ios-gnutls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -84,7 +84,7 @@ fi
--with-included-unistring \
--without-idn \
--without-p11-kit \
${HARDWARE_ACCELERATION} \
${ARCH_OPTIONS} \
--enable-static \
--disable-openssl-compatibility \
--disable-shared \
Expand Down
8 changes: 4 additions & 4 deletions build/ios-libpng.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions build/ios-x265.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4c86999

Please sign in to comment.