CONFIGURE_OPT=(
    '--prefix=/usr'
    '--with-bzip'
    '--with-lzma'
    '--with-zlib'
    '--with-tpm'
    '--with-os-feature=getrandom'
    '--with-debug-info'
    '--with-rst2man'
    '--without-documentation'
)
if ab_match_arch loongarch64_nosimd; then
    CONFIGURE_OPT+=('--disable-modules=simd_4x32')

fi
if ab_match_arch ppc64el; then
# FIXME:
# /var/cache/acbs/build/acbs.hznbfrx2/Botan-3.11.1/src/lib/block/aes/aes_power8/aes_power8.cpp:51:42: error: inlining failed in call to ‘always_inline’ ‘Botan::(anonymous namespace)::store_block(unsigned long long __vector(2), unsigned char*)’: target specific option mismatch
# 51 | BOTAN_FN_ISA_AES BOTAN_FORCE_INLINE void store_block(Altivec64x2 src, uint8_t dest[]) {
# | ^~~~~~~~~~~
# /var/cache/acbs/build/acbs.hznbfrx2/Botan-3.11.1/src/lib/block/aes/aes_power8/aes_power8.cpp:59:15: note: called from here
# 59 | store_block(B3, out + 16 * 3);
# | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
    CONFIGURE_OPT+=('--disable-modules=aes_power8')
fi

abinfo "Configuring botan ..."
"$SRCDIR"/configure.py \
    ${CONFIGURE_OPT[@]}

abinfo "Building botan ..."
make

abinfo "Installing botan ..."
make install DESTDIR="$PKGDIR"

abinfo "Fixing up permissions for headers ..."
chmod -Rv 644 "$PKGDIR"/usr/include
