From 1fc317e37463a09d99a19c647064ccea9594dedb Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sat, 6 May 2017 10:59:10 +0000 Subject: [PATCH] Build zstandard with threading enabled --- lib/libzstd/Makefile | 4 +++- share/mk/src.libnames.mk | 1 + usr.bin/zstd/Makefile | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libzstd/Makefile b/lib/libzstd/Makefile index 3d34ce9477af..bb5ad0fdc5ed 100644 --- a/lib/libzstd/Makefile +++ b/lib/libzstd/Makefile @@ -22,7 +22,9 @@ SRCS= entropy_common.c \ zdict.c WARNS= 2 INCS= zstd.h -CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ +CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ \ + -DZSTD_MULTITHREAD=1 +LIBADD= pthread PRIVATELIB= yes diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 65d332726900..c94921815457 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -209,6 +209,7 @@ _LIBRARIES+= \ # 2nd+ order consumers. Auto-generating this would be better. _DP_80211= sbuf bsdxml _DP_archive= z bz2 lzma bsdxml +_DP_zstd= pthread .if ${MK_BLACKLIST} != "no" _DP_blacklist+= pthread .endif diff --git a/usr.bin/zstd/Makefile b/usr.bin/zstd/Makefile index 78f489c0dacd..8499b65a0dde 100644 --- a/usr.bin/zstd/Makefile +++ b/usr.bin/zstd/Makefile @@ -13,7 +13,8 @@ CFLAGS+= -I${SRCTOP}/contrib/zstd/programs \ -I${SRCTOP}/contrib/zstd/lib/dictBuilder \ -I${SRCTOP}/contrib/zstd/lib \ -DXXH_NAMESPACE=ZSTD_ \ - -DHAVE_THREAD=1 + -DHAVE_THREAD=1 \ + -DZSTD_MULTITHREAD=1 SCRIPTS= zstdgrep LINKS= ${BINDIR}/zstd ${BINDIR}/unzstd \ ${BINDIR}/zstd ${BINDIR}/zstdcat \