zstd: build program and add menuconfig entry for host variant
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Wed, 4 Jul 2018 07:07:37 +0000 (09:07 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 4 Jul 2018 19:53:37 +0000 (21:53 +0200)
The zstd (de)compression tool may be used in post-image scripts to
compress certain elements of the final image.

In order to allow that, make host-zstd selectable in the 'Host
utilities' menu, and build the binary in addition to the library.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/Config.in.host
package/zstd/Config.in.host [new file with mode: 0644]
package/zstd/zstd.mk

index 38543e7390339aea87d8543c974aeaa4ec721e69..7838ffc219cd738da588163141dc74a2755d4c7d 100644 (file)
@@ -62,5 +62,6 @@ menu "Host utilities"
        source "package/vboot-utils/Config.in.host"
        source "package/xorriso/Config.in.host"
        source "package/zip/Config.in.host"
+       source "package/zstd/Config.in.host"
 
 endmenu
diff --git a/package/zstd/Config.in.host b/package/zstd/Config.in.host
new file mode 100644 (file)
index 0000000..05751f8
--- /dev/null
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HOST_ZSTD
+       bool "host zstd"
+       help
+         Zstandard, or zstd as short version, is a fast lossless
+         compression algorithm, targeting real-time compression
+         scenarios at zlib-level and better compression ratios
+
+         https://facebook.github.io/zstd
index 4915cee07d50442f0a8edd523985ac9a09354bda..0b613a6da45ad3847b7ae126c51e17d80eadc744 100644 (file)
@@ -72,11 +72,15 @@ endef
 define HOST_ZSTD_BUILD_CMDS
        $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
                -C $(@D)/lib
+       $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
+               -C $(@D) zstd
 endef
 
 define HOST_ZSTD_INSTALL_CMDS
        $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
                DESTDIR=$(HOST_DIR) PREFIX=/usr -C $(@D)/lib install
+       $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
+               DESTDIR=$(HOST_DIR) PREFIX=/usr -C $(@D)/programs install
 endef
 
 $(eval $(generic-package))