package/zstd: build multithreaded host-zstd
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Mon, 18 Jan 2021 20:37:52 +0000 (21:37 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 18 Jan 2021 21:12:59 +0000 (22:12 +0100)
Under the assumption that all Buildroot build hosts nowadays are
multithreaded, we can boost performance of host-zstd by enabling
multithreaded operation.

See also commit 52154e52069d20105f62191e6c9f903f188a5129.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/zstd/zstd.mk

index c3af9bd58c00777e8ba06dd85dbead9d9696bdd6..a4f0632fcf3ada5398ea605b6144f531193e33c2 100644 (file)
@@ -76,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 libzstd.a libzstd
-       $(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