aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-06-21 02:26:19 +0200
committerSven Gothel <[email protected]>2021-06-21 02:26:19 +0200
commite9c9140dda7b5aef852876db54923e64e9ca8383 (patch)
treea0caadf6f0a292dad0f27de07c731cee8022472e /scripts
parent34159ceb1b74cbf3bb83b531cd78f41e87136a64 (diff)
scripts/build-botan.sh: Enable armhf and arm64, supported: armhf, arm64 and amd64
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build-botan.sh (renamed from scripts/build-botan-amd64.sh)39
1 files changed, 30 insertions, 9 deletions
diff --git a/scripts/build-botan-amd64.sh b/scripts/build-botan.sh
index 4df3c12..1756c62 100644
--- a/scripts/build-botan-amd64.sh
+++ b/scripts/build-botan.sh
@@ -3,17 +3,19 @@
sdir=`dirname $(readlink -f $0)`
rootdir=`dirname $sdir`
+. $sdir/setup-machine-arch.sh
+
cd $rootdir/botan
MOD_HW_COMMON=simd,chacha_simd32,chacha_avx2,simd_avx2
#MOD_HW_AMD64=aes_ni,sha1_sse2,sha1_x86,sha2_32_x86,$MOD_HW_COMMON
MOD_HW_AMD64=sha1_sse2,sha1_x86,sha2_32_x86,$MOD_HW_COMMON
-#MOD_HW_ARM64=aes_armv8,pmull,sha1_armv8,sha2_32_armv8,$MOD_HW_COMMON
-MOD_HW_ARM64=pmull,sha1_armv8,sha2_32_armv8,$MOD_HW_COMMON
-USE_CPU=x86_64
-MOD_HW_THIS=$MOD_HW_AMD64
+#MOD_HW_ARM64=aes_armv8,sha1_armv8,sha2_32_armv8,$MOD_HW_COMMON
+MOD_HW_ARM64=sha1_armv8,sha2_32_armv8,$MOD_HW_COMMON
+
+MOD_HW_ARM32=$MOD_HW_COMMON
MOD_RNG=system_rng
@@ -24,16 +26,35 @@ MOD_CIPHER=chacha,chacha20poly1305,aead,stream
#MOD_BASIC=base,cryptobox,pubkey,rsa,x509,eme_oaep,eme_raw
MOD_BASIC=base,pubkey,rsa,x509,eme_oaep,eme_raw,emsa1
+case "$archabi" in
+ "armhf")
+ USE_CPU=armhf
+ MOD_HW_THIS=$MOD_HW_ARM32
+ ;;
+ "arm64")
+ USE_CPU=aarch64
+ MOD_HW_THIS=$MOD_HW_ARM64
+ ;;
+ "amd64")
+ USE_CPU=x86_64
+ MOD_HW_THIS=$MOD_HW_AMD64
+ ;;
+ *)
+ echo "Unsupported archabi $archabi"
+ exit 1
+ ;;
+esac
+
# CXX_FLAGS="-fno-rtti"
# LD_FLAGS="-fno-rtti"
CXX_FLAGS=
LD_FLAGS=
-mkdir -p $rootdir/include/amalgamation-amd64
-rm -f $rootdir/include/amalgamation-amd64/botan_all.h
-rm -f $rootdir/include/amalgamation-amd64/botan_all.cpp
+mkdir -p $rootdir/include/amalgamation-$archabi
+rm -f $rootdir/include/amalgamation-$archabi/botan_all.h
+rm -f $rootdir/include/amalgamation-$archabi/botan_all.cpp
-./configure.py --cpu=$USE_CPU --prefix=`pwd`/dist-amd64-min --minimized-build \
+./configure.py --cpu=$USE_CPU --prefix=`pwd`/dist-$archabi-min --minimized-build \
--enable-modules=$MOD_BASIC,$MOD_CIPHER,$MOD_HASH,$MOD_RNG,$MOD_HW_THIS \
--cxxflags=$CXX_FLAGS \
--ldflags=$LD_FLAGS \
@@ -42,6 +63,6 @@ rm -f $rootdir/include/amalgamation-amd64/botan_all.cpp
# --with-lzma --with-bzip2 \
-mv botan_all.cpp botan_all.h $rootdir/include/amalgamation-amd64/
+mv botan_all.cpp botan_all.h $rootdir/include/amalgamation-$archabi/
cd $rootdir