* [Buildroot] [PATCH v3 2/6] zstd: add host libzstd support
2018-04-16 19:39 [Buildroot] [PATCH v3 1/6] squashfs: add license hash Peter Seiderer
@ 2018-04-16 19:39 ` Peter Seiderer
2018-04-23 7:56 ` Yann E. MORIN
2018-04-25 21:37 ` Thomas Petazzoni
2018-04-16 19:39 ` [Buildroot] [PATCH v3 3/6] squashfs: add host zstd support Peter Seiderer
` (4 subsequent siblings)
5 siblings, 2 replies; 17+ messages in thread
From: Peter Seiderer @ 2018-04-16 19:39 UTC (permalink / raw)
To: buildroot
For the host only the libzstd library is built (no
need for host-lz4 host-xz host-zlib dependencies
because they affect only the cmdline tool).
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v2 -> v3:
- fix trailing spaces
- clarify the no need for host-lz4 host-xz host-zlib dependency
(suggested by Yann E. MORIN)
Changes v1 -> v2:
- split off host libzstd support (suggested by Yann E. MORIN)
- no ZSTD_OPTS for host libarary build
---
package/zstd/zstd.mk | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk
index c0fa88026c..98f8f779aa 100644
--- a/package/zstd/zstd.mk
+++ b/package/zstd/zstd.mk
@@ -46,4 +46,16 @@ define ZSTD_INSTALL_TARGET_CMDS
DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install
endef
+# note: no 'HAVE_...' options for host library build only
+define HOST_ZSTD_BUILD_CMDS
+ $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
+ -C $(@D) lib
+endef
+
+define HOST_ZSTD_INSTALL_CMDS
+ $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
+ DESTDIR=$(HOST_DIR) PREFIX=/usr -C $(@D)/lib install
+endef
+
$(eval $(generic-package))
+$(eval $(host-generic-package))
--
2.16.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 2/6] zstd: add host libzstd support
2018-04-16 19:39 ` [Buildroot] [PATCH v3 2/6] zstd: add host libzstd support Peter Seiderer
@ 2018-04-23 7:56 ` Yann E. MORIN
2018-04-25 21:37 ` Thomas Petazzoni
1 sibling, 0 replies; 17+ messages in thread
From: Yann E. MORIN @ 2018-04-23 7:56 UTC (permalink / raw)
To: buildroot
Peter, All,
On 2018-04-16 21:39 +0200, Peter Seiderer spake thusly:
> For the host only the libzstd library is built (no
> need for host-lz4 host-xz host-zlib dependencies
> because they affect only the cmdline tool).
>
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Just a note, see below...
> ---
> Changes v2 -> v3:
> - fix trailing spaces
> - clarify the no need for host-lz4 host-xz host-zlib dependency
> (suggested by Yann E. MORIN)
>
> Changes v1 -> v2:
> - split off host libzstd support (suggested by Yann E. MORIN)
> - no ZSTD_OPTS for host libarary build
> ---
> package/zstd/zstd.mk | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk
> index c0fa88026c..98f8f779aa 100644
> --- a/package/zstd/zstd.mk
> +++ b/package/zstd/zstd.mk
> @@ -46,4 +46,16 @@ define ZSTD_INSTALL_TARGET_CMDS
> DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install
> endef
>
> +# note: no 'HAVE_...' options for host library build only
> +define HOST_ZSTD_BUILD_CMDS
> + $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
> + -C $(@D) lib
> +endef
> +
> +define HOST_ZSTD_INSTALL_CMDS
> + $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \
> + DESTDIR=$(HOST_DIR) PREFIX=/usr -C $(@D)/lib install
For the build command, you do: -C $(@D) lib
while for the install, you do: -C $(@D)/lib install
It is not very consistent (not your fault, just the package's). But
would it be possible to build with: -C $(@D)/lib
This way, we would get a semblance of artificial consistency...
But that does not bar this from be applied as is...
Regards,
Yann E. MORIN.
> +endef
> +
> $(eval $(generic-package))
> +$(eval $(host-generic-package))
> --
> 2.16.3
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 2/6] zstd: add host libzstd support
2018-04-16 19:39 ` [Buildroot] [PATCH v3 2/6] zstd: add host libzstd support Peter Seiderer
2018-04-23 7:56 ` Yann E. MORIN
@ 2018-04-25 21:37 ` Thomas Petazzoni
1 sibling, 0 replies; 17+ messages in thread
From: Thomas Petazzoni @ 2018-04-25 21:37 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 16 Apr 2018 21:39:49 +0200, Peter Seiderer wrote:
> For the host only the libzstd library is built (no
> need for host-lz4 host-xz host-zlib dependencies
> because they affect only the cmdline tool).
>
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v2 -> v3:
> - fix trailing spaces
> - clarify the no need for host-lz4 host-xz host-zlib dependency
> (suggested by Yann E. MORIN)
I've applied, after changing the build command to use -C $(@D)/lib, as
suggested by Yann E. Morin (and verifying that it does work).
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 3/6] squashfs: add host zstd support
2018-04-16 19:39 [Buildroot] [PATCH v3 1/6] squashfs: add license hash Peter Seiderer
2018-04-16 19:39 ` [Buildroot] [PATCH v3 2/6] zstd: add host libzstd support Peter Seiderer
@ 2018-04-16 19:39 ` Peter Seiderer
2018-04-23 7:57 ` Yann E. MORIN
2018-04-25 21:38 ` Thomas Petazzoni
2018-04-16 19:39 ` [Buildroot] [PATCH v3 4/6] fs/squashfs: add " Peter Seiderer
` (3 subsequent siblings)
5 siblings, 2 replies; 17+ messages in thread
From: Peter Seiderer @ 2018-04-16 19:39 UTC (permalink / raw)
To: buildroot
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v2 -> v3:
- no changes
Changes v1 -> v2:
- split off host zstd support (suggested by Yann E. MORIN)
---
package/squashfs/squashfs.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/squashfs/squashfs.mk b/package/squashfs/squashfs.mk
index e656218f97..67025ac68a 100644
--- a/package/squashfs/squashfs.mk
+++ b/package/squashfs/squashfs.mk
@@ -46,7 +46,7 @@ else
SQUASHFS_MAKE_ARGS += GZIP_SUPPORT=0
endif
-HOST_SQUASHFS_DEPENDENCIES = host-zlib host-lz4 host-lzo host-xz
+HOST_SQUASHFS_DEPENDENCIES = host-zlib host-lz4 host-lzo host-xz host-zstd
HOST_SQUASHFS_MAKE_ARGS = \
XATTR_SUPPORT=1 \
@@ -55,7 +55,7 @@ HOST_SQUASHFS_MAKE_ARGS = \
LZ4_SUPPORT=1 \
LZO_SUPPORT=1 \
LZMA_XZ_SUPPORT=1 \
- ZSTD_SUPPORT=0
+ ZSTD_SUPPORT=1
define SQUASHFS_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) \
--
2.16.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 3/6] squashfs: add host zstd support
2018-04-16 19:39 ` [Buildroot] [PATCH v3 3/6] squashfs: add host zstd support Peter Seiderer
@ 2018-04-23 7:57 ` Yann E. MORIN
2018-04-25 21:38 ` Thomas Petazzoni
1 sibling, 0 replies; 17+ messages in thread
From: Yann E. MORIN @ 2018-04-23 7:57 UTC (permalink / raw)
To: buildroot
Peter, All,
On 2018-04-16 21:39 +0200, Peter Seiderer spake thusly:
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
> Changes v2 -> v3:
> - no changes
>
> Changes v1 -> v2:
> - split off host zstd support (suggested by Yann E. MORIN)
> ---
> package/squashfs/squashfs.mk | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/package/squashfs/squashfs.mk b/package/squashfs/squashfs.mk
> index e656218f97..67025ac68a 100644
> --- a/package/squashfs/squashfs.mk
> +++ b/package/squashfs/squashfs.mk
> @@ -46,7 +46,7 @@ else
> SQUASHFS_MAKE_ARGS += GZIP_SUPPORT=0
> endif
>
> -HOST_SQUASHFS_DEPENDENCIES = host-zlib host-lz4 host-lzo host-xz
> +HOST_SQUASHFS_DEPENDENCIES = host-zlib host-lz4 host-lzo host-xz host-zstd
>
> HOST_SQUASHFS_MAKE_ARGS = \
> XATTR_SUPPORT=1 \
> @@ -55,7 +55,7 @@ HOST_SQUASHFS_MAKE_ARGS = \
> LZ4_SUPPORT=1 \
> LZO_SUPPORT=1 \
> LZMA_XZ_SUPPORT=1 \
> - ZSTD_SUPPORT=0
> + ZSTD_SUPPORT=1
>
> define SQUASHFS_BUILD_CMDS
> $(TARGET_MAKE_ENV) $(MAKE) \
> --
> 2.16.3
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 3/6] squashfs: add host zstd support
2018-04-16 19:39 ` [Buildroot] [PATCH v3 3/6] squashfs: add host zstd support Peter Seiderer
2018-04-23 7:57 ` Yann E. MORIN
@ 2018-04-25 21:38 ` Thomas Petazzoni
1 sibling, 0 replies; 17+ messages in thread
From: Thomas Petazzoni @ 2018-04-25 21:38 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 16 Apr 2018 21:39:50 +0200, Peter Seiderer wrote:
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v2 -> v3:
> - no changes
I hate when we add unconditional dependencies to host packages, when
those dependencies are in fact optional. Long term, we really need to
find a better way of doing this.
In the mean time: applied, thanks!
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 4/6] fs/squashfs: add zstd support
2018-04-16 19:39 [Buildroot] [PATCH v3 1/6] squashfs: add license hash Peter Seiderer
2018-04-16 19:39 ` [Buildroot] [PATCH v3 2/6] zstd: add host libzstd support Peter Seiderer
2018-04-16 19:39 ` [Buildroot] [PATCH v3 3/6] squashfs: add host zstd support Peter Seiderer
@ 2018-04-16 19:39 ` Peter Seiderer
2018-04-25 21:40 ` Thomas Petazzoni
2018-04-16 19:39 ` [Buildroot] [PATCH v3 5/6] zstd: add libzstd support Peter Seiderer
` (2 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Peter Seiderer @ 2018-04-16 19:39 UTC (permalink / raw)
To: buildroot
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Changes v2 -> v3:
- no changes
Changes v1 -> v2:
- add reviewed-by: Yann E. MORIN
---
fs/squashfs/Config.in | 3 +++
fs/squashfs/squashfs.mk | 2 ++
2 files changed, 5 insertions(+)
diff --git a/fs/squashfs/Config.in b/fs/squashfs/Config.in
index ca9ddb2218..dde2097cb7 100644
--- a/fs/squashfs/Config.in
+++ b/fs/squashfs/Config.in
@@ -27,5 +27,8 @@ config BR2_TARGET_ROOTFS_SQUASHFS4_LZO
config BR2_TARGET_ROOTFS_SQUASHFS4_XZ
bool "xz"
+config BR2_TARGET_ROOTFS_SQUASHFS4_ZSTD
+ bool "zstd"
+
endchoice
endif
diff --git a/fs/squashfs/squashfs.mk b/fs/squashfs/squashfs.mk
index 51abd5d7d0..34ab048603 100644
--- a/fs/squashfs/squashfs.mk
+++ b/fs/squashfs/squashfs.mk
@@ -16,6 +16,8 @@ else ifeq ($(BR2_TARGET_ROOTFS_SQUASHFS4_LZMA),y)
ROOTFS_SQUASHFS_ARGS += -comp lzma
else ifeq ($(BR2_TARGET_ROOTFS_SQUASHFS4_XZ),y)
ROOTFS_SQUASHFS_ARGS += -comp xz
+else ifeq ($(BR2_TARGET_ROOTFS_SQUASHFS4_ZSTD),y)
+ROOTFS_SQUASHFS_ARGS += -comp zstd
else
ROOTFS_SQUASHFS_ARGS += -comp gzip
endif
--
2.16.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 5/6] zstd: add libzstd support
2018-04-16 19:39 [Buildroot] [PATCH v3 1/6] squashfs: add license hash Peter Seiderer
` (2 preceding siblings ...)
2018-04-16 19:39 ` [Buildroot] [PATCH v3 4/6] fs/squashfs: add " Peter Seiderer
@ 2018-04-16 19:39 ` Peter Seiderer
2018-04-23 8:08 ` Yann E. MORIN
2018-04-25 21:48 ` Thomas Petazzoni
2018-04-16 19:39 ` [Buildroot] [PATCH v3 6/6] squashfs: add zstd support Peter Seiderer
2018-04-25 21:34 ` [Buildroot] [PATCH v3 1/6] squashfs: add license hash Thomas Petazzoni
5 siblings, 2 replies; 17+ messages in thread
From: Peter Seiderer @ 2018-04-16 19:39 UTC (permalink / raw)
To: buildroot
Add patch to split libzstd install target into pc, static, shared
and includes target. Call only the needed ones for the buildroot
staging/target install steps (respect the static/shared configuration).
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v2 -> v3:
- split libray install targets for static/shared
(suggested by Yann E. MORIN)
Changes v1 -> v2:
- split off target libzstd support (suggested by Yann E. MORIN)
---
...ry-install-target-into-pc-static-shared-a.patch | 51 ++++++++++++++++++++++
package/zstd/zstd.mk | 46 +++++++++++++++++++
2 files changed, 97 insertions(+)
create mode 100644 package/zstd/0001-Split-library-install-target-into-pc-static-shared-a.patch
diff --git a/package/zstd/0001-Split-library-install-target-into-pc-static-shared-a.patch b/package/zstd/0001-Split-library-install-target-into-pc-static-shared-a.patch
new file mode 100644
index 0000000000..af9b2bf3f9
--- /dev/null
+++ b/package/zstd/0001-Split-library-install-target-into-pc-static-shared-a.patch
@@ -0,0 +1,51 @@
+From 2623a12bff19049b6ad5bc066e3ef9c6259d415c Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Mon, 16 Apr 2018 20:44:49 +0200
+Subject: [PATCH] Split library install target into pc, static, shared and
+ include only target
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ lib/Makefile | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index cdfdc5c..b592aa6 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -159,20 +159,29 @@ libzstd.pc: libzstd.pc.in
+ -e 's|@VERSION@|$(VERSION)|' \
+ $< >$@
+
+-install: libzstd.a libzstd libzstd.pc
++install: install-pc install-static install-shared install-includes
++ @echo zstd static and shared library installed
++
++install-pc: libzstd.pc
+ @$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/ $(DESTDIR)$(INCLUDEDIR)/
+ @$(INSTALL_DATA) libzstd.pc $(DESTDIR)$(PKGCONFIGDIR)/
+- @echo Installing libraries
++
++install-static: libzstd.a
++ @echo Installing static library
+ @$(INSTALL_DATA) libzstd.a $(DESTDIR)$(LIBDIR)
++
++install-shared: libzstd
++ @echo Installing shared library
+ @$(INSTALL_PROGRAM) $(LIBZSTD) $(DESTDIR)$(LIBDIR)
+ @ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
+ @ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT)
++
++install-includes:
+ @echo Installing includes
+ @$(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR)
+ @$(INSTALL_DATA) common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR)
+ @$(INSTALL_DATA) deprecated/zbuff.h $(DESTDIR)$(INCLUDEDIR) # prototypes generate deprecation warnings
+ @$(INSTALL_DATA) dictBuilder/zdict.h $(DESTDIR)$(INCLUDEDIR)
+- @echo zstd static and shared library installed
+
+ uninstall:
+ @$(RM) $(DESTDIR)$(LIBDIR)/libzstd.a
+--
+2.16.3
+
diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk
index 98f8f779aa..6be36cf398 100644
--- a/package/zstd/zstd.mk
+++ b/package/zstd/zstd.mk
@@ -6,6 +6,7 @@
ZSTD_VERSION = v1.3.3
ZSTD_SITE = $(call github,facebook,zstd,$(ZSTD_VERSION))
+ZSTD_INSTALL_STAGING = YES
ZSTD_LICENSE = BSD-3-Clause or GPL-2.0
ZSTD_LICENSE_FILES = LICENSE COPYING
@@ -36,15 +37,60 @@ else
ZSTD_OPTS += HAVE_LZ4=0
endif
+ifeq ($(BR2_STATIC_LIBS),y)
define ZSTD_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
+ -C $(@D)/lib libzstd.a
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
-C $(@D) zstd
endef
+else ifeq ($(BR2_SHARED_LIBS),y)
+define ZSTD_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
+ -C $(@D)/lib libzstd
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
+ -C $(@D) zstd
+endef
+else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+define ZSTD_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
+ -C $(@D) lib zstd
+endef
+endif
+ifeq ($(BR2_STATIC_LIBS),y)
+define ZSTD_INSTALL_STAGING_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
+ DESTDIR=$(STAGING_DIR) PREFIX=/usr -C $(@D)/lib \
+ install-pc install-static install-includes
+endef
+else ifeq ($(BR2_SHARED_LIBS),y)
+define ZSTD_INSTALL_STAGING_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
+ DESTDIR=$(STAGING_DIR) PREFIX=/usr -C $(@D)/lib \
+ install-pc install-shared install-includes
+endef
+else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
+define ZSTD_INSTALL_STAGING_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
+ DESTDIR=$(STAGING_DIR) PREFIX=/usr -C $(@D)/lib \
+ install
+endef
+endif
+
+ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
+define ZSTD_INSTALL_TARGET_CMDS
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
+ DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/lib install-shared
+ $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
+ DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install
+endef
+else
define ZSTD_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install
endef
+endif
# note: no 'HAVE_...' options for host library build only
define HOST_ZSTD_BUILD_CMDS
--
2.16.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 5/6] zstd: add libzstd support
2018-04-16 19:39 ` [Buildroot] [PATCH v3 5/6] zstd: add libzstd support Peter Seiderer
@ 2018-04-23 8:08 ` Yann E. MORIN
2018-04-25 21:48 ` Thomas Petazzoni
1 sibling, 0 replies; 17+ messages in thread
From: Yann E. MORIN @ 2018-04-23 8:08 UTC (permalink / raw)
To: buildroot
Peter, All,
On 2018-04-16 21:39 +0200, Peter Seiderer spake thusly:
> Add patch to split libzstd install target into pc, static, shared
> and includes target. Call only the needed ones for the buildroot
> staging/target install steps (respect the static/shared configuration).
>
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
[--SNIP--]
> diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk
> index 98f8f779aa..6be36cf398 100644
> --- a/package/zstd/zstd.mk
> +++ b/package/zstd/zstd.mk
[--SNIP--]
> @@ -36,15 +37,60 @@ else
> ZSTD_OPTS += HAVE_LZ4=0
> endif
>
> +ifeq ($(BR2_STATIC_LIBS),y)
> define ZSTD_BUILD_CMDS
> + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> + -C $(@D)/lib libzstd.a
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> -C $(@D) zstd
> endef
> +else ifeq ($(BR2_SHARED_LIBS),y)
> +define ZSTD_BUILD_CMDS
> + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> + -C $(@D)/lib libzstd
> + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> + -C $(@D) zstd
> +endef
> +else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
> +define ZSTD_BUILD_CMDS
> + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> + -C $(@D) lib zstd
> +endef
> +endif
I don't like much that we redefine the BUILD_CMDS, INSTALL_TARGET_CMDS,
and INSTALL_STAGING_CMDS multiple times under various conditions. When
we have that situation, we tend to define additional macros, like so:
ifeq ($(BR2_STATIC_LIBS),y)
ZSTD_BUILD_LIBS = libzstd.a
ZSTD_INSTALL_LIBS = install-static
else ifeq ($(BR2_SHARED_LIBS),y)
ZSTD_BUILD_LIBS = libzstd
ZSTD_INSTALL_LIBS = install-shared
else
ZSTD_BUILD_LIBS = libzstd.a libzstd
ZSTD_INSTALL_LIBS = install-static install-shared
endif
define ZSTD_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
-C $(@D)/lib $(ZSTD_BUILD_LIBS)
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
-C $(@D) zstd
endef
define ZSTD_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
DESTDIR=$(STAGING_DIR) PREFIX=/usr -C $(@D)/lib \
install-pc install-includes $(ZSTD_INSTALL_LIBS)
endef
define ZSTD_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/lib $(ZSTD_INSTALL_LIBS)
endef
Note: yes, the target install would also install the static libs, but
they will be removed in target-finalize anyway. So, given this matches
our usual practice, and that it makes the code smaller and easier to
read, I'd suggest we go this route.
Regards,
Yann E. MORIN.
> +ifeq ($(BR2_STATIC_LIBS),y)
> +define ZSTD_INSTALL_STAGING_CMDS
> + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> + DESTDIR=$(STAGING_DIR) PREFIX=/usr -C $(@D)/lib \
> + install-pc install-static install-includes
> +endef
> +else ifeq ($(BR2_SHARED_LIBS),y)
> +define ZSTD_INSTALL_STAGING_CMDS
> + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> + DESTDIR=$(STAGING_DIR) PREFIX=/usr -C $(@D)/lib \
> + install-pc install-shared install-includes
> +endef
> +else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
> +define ZSTD_INSTALL_STAGING_CMDS
> + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> + DESTDIR=$(STAGING_DIR) PREFIX=/usr -C $(@D)/lib \
> + install
> +endef
> +endif
> +
> +ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)
> +define ZSTD_INSTALL_TARGET_CMDS
> + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> + DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/lib install-shared
> + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> + DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install
> +endef
> +else
> define ZSTD_INSTALL_TARGET_CMDS
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install
> endef
> +endif
>
> # note: no 'HAVE_...' options for host library build only
> define HOST_ZSTD_BUILD_CMDS
> --
> 2.16.3
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 5/6] zstd: add libzstd support
2018-04-16 19:39 ` [Buildroot] [PATCH v3 5/6] zstd: add libzstd support Peter Seiderer
2018-04-23 8:08 ` Yann E. MORIN
@ 2018-04-25 21:48 ` Thomas Petazzoni
2018-04-30 18:48 ` Peter Seiderer
1 sibling, 1 reply; 17+ messages in thread
From: Thomas Petazzoni @ 2018-04-25 21:48 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 16 Apr 2018 21:39:52 +0200, Peter Seiderer wrote:
> Add patch to split libzstd install target into pc, static, shared
> and includes target. Call only the needed ones for the buildroot
> staging/target install steps (respect the static/shared configuration).
>
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v2 -> v3:
> - split libray install targets for static/shared
> (suggested by Yann E. MORIN)
Applied to master after implementing the suggestion from Yann:
[Thomas: as suggested by Yann E. Morin, refactor the build/install
commands to use only one invocation, with intermediate ZSTD_BUILD_LIBS
and ZSTD_INSTALL_LIBS variables, defined depending on whether
static/shared/static+shared is selected.]
Also, did you submit the patch upstream ?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 5/6] zstd: add libzstd support
2018-04-25 21:48 ` Thomas Petazzoni
@ 2018-04-30 18:48 ` Peter Seiderer
0 siblings, 0 replies; 17+ messages in thread
From: Peter Seiderer @ 2018-04-30 18:48 UTC (permalink / raw)
To: buildroot
Hello Yann, Thomas,
On Wed, 25 Apr 2018 23:48:31 +0200, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Mon, 16 Apr 2018 21:39:52 +0200, Peter Seiderer wrote:
> > Add patch to split libzstd install target into pc, static, shared
> > and includes target. Call only the needed ones for the buildroot
> > staging/target install steps (respect the static/shared configuration).
> >
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > ---
> > Changes v2 -> v3:
> > - split libray install targets for static/shared
> > (suggested by Yann E. MORIN)
>
> Applied to master after implementing the suggestion from Yann:
Thanks for review, suggestions and fixing it on the fly....
>
> [Thomas: as suggested by Yann E. Morin, refactor the build/install
> commands to use only one invocation, with intermediate ZSTD_BUILD_LIBS
> and ZSTD_INSTALL_LIBS variables, defined depending on whether
> static/shared/static+shared is selected.]
>
> Also, did you submit the patch upstream ?
Just done, see [1]...
Regards,
Peter
[1] https://github.com/facebook/zstd/pull/1114
>
> Thanks!
>
> Thomas
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 6/6] squashfs: add zstd support
2018-04-16 19:39 [Buildroot] [PATCH v3 1/6] squashfs: add license hash Peter Seiderer
` (3 preceding siblings ...)
2018-04-16 19:39 ` [Buildroot] [PATCH v3 5/6] zstd: add libzstd support Peter Seiderer
@ 2018-04-16 19:39 ` Peter Seiderer
2018-04-23 8:18 ` Yann E. MORIN
2018-04-25 21:49 ` Thomas Petazzoni
2018-04-25 21:34 ` [Buildroot] [PATCH v3 1/6] squashfs: add license hash Thomas Petazzoni
5 siblings, 2 replies; 17+ messages in thread
From: Peter Seiderer @ 2018-04-16 19:39 UTC (permalink / raw)
To: buildroot
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v2 -> v3:
- move up the zstd section to keep gzip as default (suggested by
Yann E. MORIN)
Changes v1 -> v2:
- split off target zstd support (suggested by Yann E. MORIN)
---
package/squashfs/Config.in | 6 ++++++
package/squashfs/squashfs.mk | 9 ++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/package/squashfs/Config.in b/package/squashfs/Config.in
index 70c0fc9808..c16ebbf27f 100644
--- a/package/squashfs/Config.in
+++ b/package/squashfs/Config.in
@@ -41,6 +41,12 @@ config BR2_PACKAGE_SQUASHFS_XZ
help
Support XZ compression algorithm
+config BR2_PACKAGE_SQUASHFS_ZSTD
+ bool "zstd support"
+ select BR2_PACKAGE_ZSTD
+ help
+ Support ZSTD compression algorithm
+
endif
comment "squashfs needs a toolchain w/ threads"
diff --git a/package/squashfs/squashfs.mk b/package/squashfs/squashfs.mk
index 67025ac68a..7467342c48 100644
--- a/package/squashfs/squashfs.mk
+++ b/package/squashfs/squashfs.mk
@@ -9,7 +9,7 @@ SQUASHFS_SITE = https://git.kernel.org/pub/scm/fs/squashfs/squashfs-tools.git
SQUASHFS_SITE_METHOD = git
SQUASHFS_LICENSE = GPL-2.0+
SQUASHFS_LICENSE_FILES = COPYING
-SQUASHFS_MAKE_ARGS = XATTR_SUPPORT=1 ZSTD_SUPPORT=0
+SQUASHFS_MAKE_ARGS = XATTR_SUPPORT=1
ifeq ($(BR2_PACKAGE_SQUASHFS_LZ4),y)
SQUASHFS_DEPENDENCIES += lz4
@@ -39,6 +39,13 @@ else
SQUASHFS_MAKE_ARGS += LZO_SUPPORT=0
endif
+ifeq ($(BR2_PACKAGE_SQUASHFS_ZSTD),y)
+SQUASHFS_DEPENDENCIES += zstd
+SQUASHFS_MAKE_ARGS += ZSTD_SUPPORT=1 COMP_DEFAULT=zstd
+else
+SQUASHFS_MAKE_ARGS += ZSTD_SUPPORT=0
+endif
+
ifeq ($(BR2_PACKAGE_SQUASHFS_GZIP),y)
SQUASHFS_DEPENDENCIES += zlib
SQUASHFS_MAKE_ARGS += GZIP_SUPPORT=1 COMP_DEFAULT=gzip
--
2.16.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 6/6] squashfs: add zstd support
2018-04-16 19:39 ` [Buildroot] [PATCH v3 6/6] squashfs: add zstd support Peter Seiderer
@ 2018-04-23 8:18 ` Yann E. MORIN
2018-04-25 21:49 ` Thomas Petazzoni
1 sibling, 0 replies; 17+ messages in thread
From: Yann E. MORIN @ 2018-04-23 8:18 UTC (permalink / raw)
To: buildroot
Peter, All,
On 2018-04-16 21:39 +0200, Peter Seiderer spake thusly:
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
> Changes v2 -> v3:
> - move up the zstd section to keep gzip as default (suggested by
> Yann E. MORIN)
>
> Changes v1 -> v2:
> - split off target zstd support (suggested by Yann E. MORIN)
> ---
> package/squashfs/Config.in | 6 ++++++
> package/squashfs/squashfs.mk | 9 ++++++++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/package/squashfs/Config.in b/package/squashfs/Config.in
> index 70c0fc9808..c16ebbf27f 100644
> --- a/package/squashfs/Config.in
> +++ b/package/squashfs/Config.in
> @@ -41,6 +41,12 @@ config BR2_PACKAGE_SQUASHFS_XZ
> help
> Support XZ compression algorithm
>
> +config BR2_PACKAGE_SQUASHFS_ZSTD
> + bool "zstd support"
> + select BR2_PACKAGE_ZSTD
> + help
> + Support ZSTD compression algorithm
> +
> endif
>
> comment "squashfs needs a toolchain w/ threads"
> diff --git a/package/squashfs/squashfs.mk b/package/squashfs/squashfs.mk
> index 67025ac68a..7467342c48 100644
> --- a/package/squashfs/squashfs.mk
> +++ b/package/squashfs/squashfs.mk
> @@ -9,7 +9,7 @@ SQUASHFS_SITE = https://git.kernel.org/pub/scm/fs/squashfs/squashfs-tools.git
> SQUASHFS_SITE_METHOD = git
> SQUASHFS_LICENSE = GPL-2.0+
> SQUASHFS_LICENSE_FILES = COPYING
> -SQUASHFS_MAKE_ARGS = XATTR_SUPPORT=1 ZSTD_SUPPORT=0
> +SQUASHFS_MAKE_ARGS = XATTR_SUPPORT=1
>
> ifeq ($(BR2_PACKAGE_SQUASHFS_LZ4),y)
> SQUASHFS_DEPENDENCIES += lz4
> @@ -39,6 +39,13 @@ else
> SQUASHFS_MAKE_ARGS += LZO_SUPPORT=0
> endif
>
> +ifeq ($(BR2_PACKAGE_SQUASHFS_ZSTD),y)
> +SQUASHFS_DEPENDENCIES += zstd
> +SQUASHFS_MAKE_ARGS += ZSTD_SUPPORT=1 COMP_DEFAULT=zstd
> +else
> +SQUASHFS_MAKE_ARGS += ZSTD_SUPPORT=0
> +endif
> +
> ifeq ($(BR2_PACKAGE_SQUASHFS_GZIP),y)
> SQUASHFS_DEPENDENCIES += zlib
> SQUASHFS_MAKE_ARGS += GZIP_SUPPORT=1 COMP_DEFAULT=gzip
> --
> 2.16.3
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 6/6] squashfs: add zstd support
2018-04-16 19:39 ` [Buildroot] [PATCH v3 6/6] squashfs: add zstd support Peter Seiderer
2018-04-23 8:18 ` Yann E. MORIN
@ 2018-04-25 21:49 ` Thomas Petazzoni
1 sibling, 0 replies; 17+ messages in thread
From: Thomas Petazzoni @ 2018-04-25 21:49 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 16 Apr 2018 21:39:53 +0200, Peter Seiderer wrote:
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v2 -> v3:
> - move up the zstd section to keep gzip as default (suggested by
> Yann E. MORIN)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Buildroot] [PATCH v3 1/6] squashfs: add license hash
2018-04-16 19:39 [Buildroot] [PATCH v3 1/6] squashfs: add license hash Peter Seiderer
` (4 preceding siblings ...)
2018-04-16 19:39 ` [Buildroot] [PATCH v3 6/6] squashfs: add zstd support Peter Seiderer
@ 2018-04-25 21:34 ` Thomas Petazzoni
5 siblings, 0 replies; 17+ messages in thread
From: Thomas Petazzoni @ 2018-04-25 21:34 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 16 Apr 2018 21:39:48 +0200, Peter Seiderer wrote:
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v2 -> v3:
> - new patch
> ---
> package/squashfs/squashfs.hash | 3 +++
> 1 file changed, 3 insertions(+)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 17+ messages in thread