ZSTD_INSTALL_LIBS = install-static install-shared
endif
+# prefer zstd-dll unless no library is available
+ifeq ($(BR2_STATIC_LIBS),y)
+ZSTD_BUILD_PROG_TARGET = zstd-release
+else
+ZSTD_BUILD_PROG_TARGET = zstd-dll
+endif
+
# The HAVE_THREAD flag is read by the 'programs' makefile but not by the 'lib'
# one. Building a multi-threaded binary with a static library (which defaults
# to single-threaded) gives a runtime error when compressing files.
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
-C $(@D)/lib $(ZSTD_BUILD_LIBS) libzstd.pc
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
- -C $(@D) zstd-release
+ -C $(@D)/programs $(ZSTD_BUILD_PROG_TARGET)
endef
define ZSTD_INSTALL_STAGING_CMDS