From 3c62f13eed47cbcdbbcb59e31e3902cd48f051e3 Mon Sep 17 00:00:00 2001 From: Javernaut Date: Thu, 21 Oct 2021 19:28:47 +0300 Subject: [PATCH] Further simplifying of export-build-variables.sh --- scripts/export-build-variables.sh | 19 +++++++------------ scripts/ffmpeg/build.sh | 2 +- scripts/libdav1d/build.sh | 2 +- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/scripts/export-build-variables.sh b/scripts/export-build-variables.sh index 5c58904..13ae035 100755 --- a/scripts/export-build-variables.sh +++ b/scripts/export-build-variables.sh @@ -23,34 +23,29 @@ export TARGET_TRIPLE_OS="android" case $ANDROID_ABI in armeabi-v7a) #cc armv7a-linux-androideabi16-clang - #binutils arm -linux-androideabi -ld - export TARGET_TRIPLE_MACHINE_BINUTILS=arm + export TARGET_TRIPLE_MACHINE_ARCH=arm TARGET_TRIPLE_MACHINE_CC=armv7a export TARGET_TRIPLE_OS=androideabi ;; arm64-v8a) #cc aarch64-linux-android21-clang - #binutils aarch64-linux-android -ld - export TARGET_TRIPLE_MACHINE_BINUTILS=aarch64 + export TARGET_TRIPLE_MACHINE_ARCH=aarch64 ;; x86) #cc i686-linux-android16-clang - #binutils i686-linux-android -ld - export TARGET_TRIPLE_MACHINE_BINUTILS=i686 + export TARGET_TRIPLE_MACHINE_ARCH=i686 CPU_FAMILY=x86 ;; x86_64) #cc x86_64-linux-android21-clang - #binutils x86_64-linux-android -ld - export TARGET_TRIPLE_MACHINE_BINUTILS=x86_64 + export TARGET_TRIPLE_MACHINE_ARCH=x86_64 ;; esac # If the cc-specific variable isn't set, we fallback to binutils version -[ -z "${TARGET_TRIPLE_MACHINE_CC}" ] && TARGET_TRIPLE_MACHINE_CC=${TARGET_TRIPLE_MACHINE_BINUTILS} -export TARGET_TRIPLE_MACHINE_CC=$TARGET_TRIPLE_MACHINE_CC +[ -z "${TARGET_TRIPLE_MACHINE_CC}" ] && TARGET_TRIPLE_MACHINE_CC=${TARGET_TRIPLE_MACHINE_ARCH} -[ -z "${CPU_FAMILY}" ] && CPU_FAMILY=${TARGET_TRIPLE_MACHINE_BINUTILS} +[ -z "${CPU_FAMILY}" ] && CPU_FAMILY=${TARGET_TRIPLE_MACHINE_ARCH} export CPU_FAMILY=$CPU_FAMILY # Common prefix for ld, as, etc. @@ -70,7 +65,7 @@ export FAM_STRINGS=${CROSS_PREFIX_WITH_PATH}strings export FAM_STRIP=${CROSS_PREFIX_WITH_PATH}strip export TARGET=${TARGET_TRIPLE_MACHINE_CC}-linux-${TARGET_TRIPLE_OS}${ANDROID_PLATFORM} -# The name for compiler is slightly different, so it is defined separatly. +# The name for compiler is slightly different, so it is defined separately. export FAM_CC=${TOOLCHAIN_PATH}/bin/${TARGET}-clang export FAM_CXX=${FAM_CC}++ export FAM_LD=${FAM_CC} diff --git a/scripts/ffmpeg/build.sh b/scripts/ffmpeg/build.sh index eabf874..18f7b29 100755 --- a/scripts/ffmpeg/build.sh +++ b/scripts/ffmpeg/build.sh @@ -29,7 +29,7 @@ DEP_LD_FLAGS="-L${BUILD_DIR_EXTERNAL}/${ANDROID_ABI}/lib $FFMPEG_EXTRA_LD_FLAGS" --prefix=${BUILD_DIR_FFMPEG}/${ANDROID_ABI} \ --enable-cross-compile \ --target-os=android \ - --arch=${TARGET_TRIPLE_MACHINE_BINUTILS} \ + --arch=${TARGET_TRIPLE_MACHINE_ARCH} \ --sysroot=${SYSROOT_PATH} \ --cc=${FAM_CC} \ --cxx=${FAM_CXX} \ diff --git a/scripts/libdav1d/build.sh b/scripts/libdav1d/build.sh index ce60d61..b186ac6 100755 --- a/scripts/libdav1d/build.sh +++ b/scripts/libdav1d/build.sh @@ -19,7 +19,7 @@ sys_root = '${SYSROOT_PATH}' [host_machine] system = 'linux' cpu_family = '${CPU_FAMILY}' -cpu = '${TARGET_TRIPLE_MACHINE_BINUTILS}' +cpu = '${TARGET_TRIPLE_MACHINE_ARCH}' endian = 'little' [paths]