[v2,2/6] zstd: add host libzstd support

Message ID 20180409200429.22650-2-ps.report@gmx.net
State New
Headers show
Series
  • [v2,1/6] squashfs: bump version to e38956b92f738518c29734399629e7cdb33072d3
Related show

Commit Message

Peter Seiderer April 9, 2018, 8:04 p.m.
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
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(+)

Comments

Yann E. MORIN April 11, 2018, 9:19 p.m. | #1
Peter, All,

On 2018-04-09 22:04 +0200, Peter Seiderer spake thusly:
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> 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..1b76b0164c 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))

The target variant has optional dependencies on zlib, xz, and lz4, which
all have host variants.

So, if you don;t specify the dependency in the host-zstd, you get a
host-zstd that may or may not have support for zlib, xz, or lz4,
depending on hether another package a dependency on them.

We don't have spport for optional host dependencies (because there are
not config options for those host packages), so I don't see a solution
but to always depend on all three. So:

    HOST_ZSTD_DEPENDENCIES = host-lz4 host-xz host-zlib

Regards,
Yann E. MORIN.
Baruch Siach April 12, 2018, 3:33 a.m. | #2
Hi Yann,

On Wed, Apr 11, 2018 at 11:19:07PM +0200, Yann E. MORIN wrote:
> On 2018-04-09 22:04 +0200, Peter Seiderer spake thusly:
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > ---
> > 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..1b76b0164c 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))
> 
> The target variant has optional dependencies on zlib, xz, and lz4, which
> all have host variants.
> 
> So, if you don;t specify the dependency in the host-zstd, you get a
> host-zstd that may or may not have support for zlib, xz, or lz4,
> depending on hether another package a dependency on them.
> 
> We don't have spport for optional host dependencies (because there are
> not config options for those host packages), so I don't see a solution
> but to always depend on all three. So:
> 
>     HOST_ZSTD_DEPENDENCIES = host-lz4 host-xz host-zlib

Why? The build should still consistent for a given config. If you add/remove 
other packages you might get host-zstd build with different dependencies. This 
is normal. Target packages behave the same way.

baruch
Peter Seiderer April 12, 2018, 6:30 p.m. | #3
Hello Yann,

On Wed, 11 Apr 2018 23:19:07 +0200, "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> Peter, All,
> 
> On 2018-04-09 22:04 +0200, Peter Seiderer spake thusly:
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > ---
> > 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..1b76b0164c 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))  
> 
> The target variant has optional dependencies on zlib, xz, and lz4, which
> all have host variants.

The zlibx/xz/lz4 support options apply only to the cmdline tools, not
to the libzst libary (the only build target for the host variant),
see the (short) comment about the 'HAVE_...' options...
> 
> So, if you don;t specify the dependency in the host-zstd, you get a
> host-zstd that may or may not have support for zlib, xz, or lz4,
> depending on hether another package a dependency on them.
> 
> We don't have spport for optional host dependencies (because there are
> not config options for those host packages), so I don't see a solution
> but to always depend on all three. So:
> 
>     HOST_ZSTD_DEPENDENCIES = host-lz4 host-xz host-zlib

So no need for the host library build to depend on (unused) lz4/xz/zlib
host-builds....

Regards,
Peter

> 
> Regards,
> Yann E. MORIN.
>
Yann E. MORIN April 12, 2018, 6:47 p.m. | #4
Peter, All,

On 2018-04-12 20:30 +0200, Peter Seiderer spake thusly:
> On Wed, 11 Apr 2018 23:19:07 +0200, "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> > On 2018-04-09 22:04 +0200, Peter Seiderer spake thusly:
> > > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > > ---
> > > 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..1b76b0164c 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))  
> > 
> > The target variant has optional dependencies on zlib, xz, and lz4, which
> > all have host variants.
> 
> The zlibx/xz/lz4 support options apply only to the cmdline tools, not
> to the libzst libary (the only build target for the host variant),
> see the (short) comment about the 'HAVE_...' options...

OK, that was not clear to me. Say so in the commit log, then.

Regards,
Yann E. MORIN.

> > So, if you don;t specify the dependency in the host-zstd, you get a
> > host-zstd that may or may not have support for zlib, xz, or lz4,
> > depending on hether another package a dependency on them.
> > 
> > We don't have spport for optional host dependencies (because there are
> > not config options for those host packages), so I don't see a solution
> > but to always depend on all three. So:
> > 
> >     HOST_ZSTD_DEPENDENCIES = host-lz4 host-xz host-zlib
> 
> So no need for the host library build to depend on (unused) lz4/xz/zlib
> host-builds....
> 
> Regards,
> Peter
> 
> > 
> > Regards,
> > Yann E. MORIN.
> > 
>

Patch

diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk
index c0fa88026c..1b76b0164c 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))