aboutsummaryrefslogtreecommitdiff
path: root/package/zstd/zstd.mk
diff options
context:
space:
mode:
Diffstat (limited to 'package/zstd/zstd.mk')
-rw-r--r--package/zstd/zstd.mk24
1 files changed, 17 insertions, 7 deletions
diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk
index e2ba12b058..a4f0632fcf 100644
--- a/package/zstd/zstd.mk
+++ b/package/zstd/zstd.mk
@@ -4,7 +4,7 @@
#
################################################################################
-ZSTD_VERSION = 1.4.5
+ZSTD_VERSION = 1.4.8
ZSTD_SITE = https://github.com/facebook/zstd/releases/download/v$(ZSTD_VERSION)
ZSTD_INSTALL_STAGING = YES
ZSTD_LICENSE = BSD-3-Clause or GPL-2.0
@@ -48,6 +48,14 @@ ZSTD_BUILD_LIBS = libzstd.a libzstd
ZSTD_INSTALL_LIBS = install-static install-shared
endif
+# The HAVE_THREAD flag is read by the 'programs' makefile but not by the 'lib'
+# one. Building a multi-threaded binary with a library (which defaults to
+# single-threaded) gives a runtime error when compressing files.
+# The 'lib' makefile provides specific '%-mt' targets for this purpose.
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+ZSTD_BUILD_LIBS := $(addsuffix -mt,$(ZSTD_BUILD_LIBS))
+endif
+
define ZSTD_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
-C $(@D)/lib $(ZSTD_BUILD_LIBS)
@@ -68,18 +76,20 @@ define ZSTD_INSTALL_TARGET_CMDS
DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/lib $(ZSTD_INSTALL_LIBS)
endef
-# note: no 'HAVE_...' options for host library build only
+# note: only limited 'HAVE_...' options for host library build only
+HOST_ZSTD_OPTS = HAVE_THREAD=1
+
define HOST_ZSTD_BUILD_CMDS
- $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
- -C $(@D)/lib
- $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
+ $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) $(HOST_ZSTD_OPTS) \
+ -C $(@D)/lib libzstd.a-mt libzstd-mt
+ $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) $(HOST_ZSTD_OPTS) \
-C $(@D) zstd
endef
define HOST_ZSTD_INSTALL_CMDS
- $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
+ $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) $(HOST_ZSTD_OPTS) \
DESTDIR=$(HOST_DIR) PREFIX=/usr -C $(@D)/lib install
- $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
+ $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) $(HOST_ZSTD_OPTS) \
DESTDIR=$(HOST_DIR) PREFIX=/usr -C $(@D)/programs install
endef