From 3d5e761744fb0e46a9818dd03d113a98e09e1253 Mon Sep 17 00:00:00 2001 From: Evangelos Foutras Date: Wed, 25 Dec 2024 17:50:50 +0200 Subject: Provide platform/assembly flags per architecture Trying to be mindful of downstream distros. --- PKGBUILD | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index fde48c0..bfbe5a8 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -20,11 +20,22 @@ prepare() { } build() { + local _platform_flags=() + + case $CARCH in + x86_64) + _platform_flags=(PLATFORM=x64 IS_X64=1 MY_ASM=uasm USE_ASM=1) + ;; + i686) + _platform_flags=(PLATFORM=x86 IS_X86=1 MY_ASM=uasm USE_ASM=1) + ;; + aarch64) + _platform_flags=(PLATFORM=arm64 IS_ARM64=1 MY_ASM=uasm USE_ASM=1) + ;; + esac + for component in Bundles/{Alone,Alone7z,Format7zF,SFXCon} UI/Console; do - make -C CPP/7zip/$component -f ../../cmpl_gcc.mak \ - MY_ASM=uasm \ - USE_ASM=1 \ - IS_X64=1 \ + make -C CPP/7zip/$component -f ../../cmpl_gcc.mak "${_platform_flags[@]}" \ CC="cc $CPPFLAGS $CFLAGS $LDFLAGS" \ CXX="g++ $CPPFLAGS $CXXFLAGS $LDFLAGS" done -- cgit v1.2.3-70-g09d2