2017-04-15 20:05:22 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
LIB= zstd
|
|
|
|
SRCS= entropy_common.c \
|
|
|
|
error_private.c \
|
|
|
|
fse_decompress.c \
|
|
|
|
pool.c \
|
|
|
|
threading.c \
|
|
|
|
xxhash.c \
|
|
|
|
zstd_common.c \
|
|
|
|
fse_compress.c \
|
|
|
|
huf_compress.c \
|
|
|
|
zstd_compress.c \
|
2019-08-08 16:54:22 +00:00
|
|
|
zstd_compress_literals.c \
|
|
|
|
zstd_compress_sequences.c \
|
2020-05-23 21:23:46 +00:00
|
|
|
zstd_compress_superblock.c \
|
2017-04-15 20:05:22 +00:00
|
|
|
zstdmt_compress.c \
|
|
|
|
huf_decompress.c \
|
2018-12-29 21:18:01 +00:00
|
|
|
zstd_ddict.c \
|
2017-04-15 20:05:22 +00:00
|
|
|
zstd_decompress.c \
|
2018-12-29 21:18:01 +00:00
|
|
|
zstd_decompress_block.c \
|
2017-04-15 20:05:22 +00:00
|
|
|
zbuff_common.c \
|
|
|
|
zbuff_compress.c \
|
|
|
|
zbuff_decompress.c \
|
|
|
|
cover.c \
|
|
|
|
divsufsort.c \
|
2017-11-11 13:57:30 +00:00
|
|
|
zdict.c \
|
|
|
|
zstd_fast.c \
|
|
|
|
zstd_lazy.c \
|
|
|
|
zstd_ldm.c \
|
|
|
|
zstd_opt.c \
|
2018-10-22 18:29:12 +00:00
|
|
|
zstd_double_fast.c \
|
|
|
|
debug.c \
|
|
|
|
hist.c \
|
|
|
|
fastcover.c
|
2020-09-11 13:28:37 +00:00
|
|
|
WARNS?= 2
|
2017-04-15 20:05:22 +00:00
|
|
|
INCS= zstd.h
|
2017-05-06 10:59:10 +00:00
|
|
|
CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ \
|
2021-01-03 19:26:01 +00:00
|
|
|
-DZSTD_MULTITHREAD=1 -fvisibility=hidden
|
2017-05-06 10:59:10 +00:00
|
|
|
LIBADD= pthread
|
2017-04-15 20:05:22 +00:00
|
|
|
|
|
|
|
PRIVATELIB= yes
|
2020-11-12 14:04:08 +00:00
|
|
|
PACKAGE= runtime
|
2017-04-15 20:05:22 +00:00
|
|
|
|
2017-11-14 05:03:38 +00:00
|
|
|
ZSTDDIR= ${SRCTOP}/sys/contrib/zstd
|
2017-04-15 20:05:22 +00:00
|
|
|
.PATH: ${ZSTDDIR}/lib/common ${ZSTDDIR}/lib/compress \
|
|
|
|
${ZSTDDIR}/lib/decompress ${ZSTDDIR}/lib/deprecated \
|
|
|
|
${ZSTDDIR}/lib/dictBuilder ${ZSTDDIR}/lib
|
|
|
|
|
2019-08-08 16:54:22 +00:00
|
|
|
.include <bsd.compiler.mk>
|
|
|
|
|
|
|
|
# https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1]
|
|
|
|
# "Note that [GCC] autovectorization still does not do a good job on the
|
|
|
|
# optimized version, so it's turned off via attribute and flag. I found
|
|
|
|
# that neither attribute nor command-line flag were entirely successful in
|
|
|
|
# turning off vectorization, which is why there were both."
|
|
|
|
.if ${COMPILER_TYPE} == "gcc"
|
|
|
|
CFLAGS.zstd_decompress_block.c+= -fno-tree-vectorize
|
|
|
|
.endif
|
|
|
|
|
2018-03-18 03:42:57 +00:00
|
|
|
# Work around lack of __bswap[sd]i2() intrinsics on riscv. Probably should be
|
|
|
|
# added to one of the runtime C libraries instead.
|
|
|
|
.if ${MACHINE_CPUARCH} == "riscv"
|
|
|
|
.PATH: ${ZSTDDIR}/lib/freebsd
|
|
|
|
SRCS+= zstd_kfreebsd.c
|
|
|
|
.endif
|
|
|
|
|
2017-04-15 20:05:22 +00:00
|
|
|
.include <bsd.lib.mk>
|