PKGNAME=xz
PKGDES="General-purpose data compression software with a high compression ratio"
PKGDEP="glibc"
BUILDDEP="po4a"
PKGSEC=utils

ABTYPE=autotools
# Note: --enable-assume-ram=SIZE
#
# "If and only if the real amount of RAM cannot be determined, assume SIZE MiB.
# The default is 128 MiB. This affects the default memory usage limit."
#
# We won't specify any non-default value for this option.
#
# Note: --enable-unaligned-access=auto
#
# "Enable if the system supports *fast* unaligned memory access with 16-bit,
# 32-bit, and 64-bit integers. By default, this is enabled only on x86,
# x86_64, big endian PowerPC, and some ARM systems."
#
# FIXME: --enable-external-sha256 is not supported on Linux/Glibc.
MAKE_AFTER="pkgconfigdir=/usr/lib/pkgconfig"
AUTOTOOLS_AFTER=(
    '--disable-debug'
    '--disable-external-sha256'
    '--enable-microlzma'
    '--enable-lzip-decoder'
    '--enable-assembler'
    '--enable-clmul-crc'
    '--disable-small'
    '--enable-threads=yes'
    '--enable-xz'
    '--enable-xzdec'
    '--enable-lzmadec'
    '--enable-lzmainfo'
    '--enable-lzma-links'
    '--enable-scripts'
    '--enable-doc'
    '--enable-sandbox=landlock'
    '--enable-symbol-versions'
    '--enable-nls'
    '--disable-rpath'
    '--enable-largefile'
    '--enable-unaligned-access=auto'
    '--disable-unsafe-type-punning'
    '--disable-werror'
)

AB_FLAGS_O3=1

PKGESS=1

# Needed by Afterglow, whereas FAIL_ARCH defaults to mainline-only.
FAIL_ARCH="!(mainline|retro)"
