All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] lz4: bump to version 1.8.1.2
@ 2018-04-19  9:46 Baruch Siach
  2018-04-19  9:46 ` [Buildroot] [PATCH 2/2] lz4: improve static only build support Baruch Siach
  2018-04-19 20:49 ` [Buildroot] [PATCH 1/2] lz4: bump to version 1.8.1.2 Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Baruch Siach @ 2018-04-19  9:46 UTC (permalink / raw)
  To: buildroot

Use lib and lz4 make targets to avoid build of the manual generator, and
the examples. Both of them use the target compiler to build host tools.

Add license files hashes.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 package/lz4/lz4.hash | 4 +++-
 package/lz4/lz4.mk   | 6 +++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/package/lz4/lz4.hash b/package/lz4/lz4.hash
index 5048503f8063..bdc43d1e669b 100644
--- a/package/lz4/lz4.hash
+++ b/package/lz4/lz4.hash
@@ -1,2 +1,4 @@
 # sha256 locally computed
-sha256 0190cacd63022ccb86f44fa5041dc6c3804407ad61550ca21c382827319e7e7e  lz4-v1.7.5.tar.gz
+sha256 12f3a9e776a923275b2dc78ae138b4967ad6280863b77ff733028ce89b8123f9  lz4-v1.8.1.2.tar.gz
+sha256 d15d99c8dc6b0ec22174c0e563a95bc40f9363ca7f9d9d793bb5c5a8e8d0af71  lib/LICENSE
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  programs/COPYING
diff --git a/package/lz4/lz4.mk b/package/lz4/lz4.mk
index de8c311a3125..c88329f7979e 100644
--- a/package/lz4/lz4.mk
+++ b/package/lz4/lz4.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-LZ4_VERSION = v1.7.5
+LZ4_VERSION = v1.8.1.2
 LZ4_SITE = $(call github,lz4,lz4,$(LZ4_VERSION))
 LZ4_INSTALL_STAGING = YES
 LZ4_LICENSE = BSD-2-Clause (library), GPL-2.0+ (programs)
@@ -18,7 +18,7 @@ LZ4_POST_PATCH_HOOKS += LZ4_DISABLE_SHARED
 endif
 
 define HOST_LZ4_BUILD_CMDS
-	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) all
+	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) lib lz4
 endef
 
 define HOST_LZ4_INSTALL_CMDS
@@ -27,7 +27,7 @@ define HOST_LZ4_INSTALL_CMDS
 endef
 
 define LZ4_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) all
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) lib lz4
 endef
 
 define LZ4_INSTALL_STAGING_CMDS
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] lz4: improve static only build support
  2018-04-19  9:46 [Buildroot] [PATCH 1/2] lz4: bump to version 1.8.1.2 Baruch Siach
@ 2018-04-19  9:46 ` Baruch Siach
  2018-04-19 20:50   ` Thomas Petazzoni
  2018-04-19 20:49 ` [Buildroot] [PATCH 1/2] lz4: bump to version 1.8.1.2 Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Baruch Siach @ 2018-04-19  9:46 UTC (permalink / raw)
  To: buildroot

The current method of supporting static only build, removal of all lines
that match the SHARED regex from lib/Makefile, is crude and fragile.
Instead, patch lib/Makefile to allow disable of shared libraries.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 ...ib-allow-to-disable-shared-libraries.patch | 59 +++++++++++++++++++
 package/lz4/lz4.mk                            | 17 +++---
 2 files changed, 67 insertions(+), 9 deletions(-)
 create mode 100644 package/lz4/0001-lib-allow-to-disable-shared-libraries.patch

diff --git a/package/lz4/0001-lib-allow-to-disable-shared-libraries.patch b/package/lz4/0001-lib-allow-to-disable-shared-libraries.patch
new file mode 100644
index 000000000000..4f89e85577b3
--- /dev/null
+++ b/package/lz4/0001-lib-allow-to-disable-shared-libraries.patch
@@ -0,0 +1,59 @@
+From 95bde2a4ae4a92e984a5783ca1f09f44bf04fadb Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Thu, 19 Apr 2018 12:28:11 +0300
+Subject: [PATCH] lib: allow to disable shared libraries
+
+Just like BUILD_STATIC=no disables static libraries, BUILD_SHARED=no
+disabled shared libraries. This is useful to support toolchains that do
+not support shared libraries.
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+---
+Upstream status: https://github.com/lz4/lz4/pull/504
+
+ lib/Makefile | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index dd33f50351a8..976d57cd75ed 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -42,6 +42,7 @@ LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT))
+ LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT))
+ LIBVER  := $(shell echo $(LIBVER_SCRIPT))
+ 
++BUILD_SHARED:=yes
+ BUILD_STATIC:=yes
+ 
+ CPPFLAGS+= -DXXH_NAMESPACE=LZ4_
+@@ -92,6 +93,7 @@ ifeq ($(BUILD_STATIC),yes)  # can be disabled on command line
+ endif
+ 
+ $(LIBLZ4): $(SRCFILES)
++ifeq ($(BUILD_SHARED),yes)  # can be disabled on command line
+ 	@echo compiling dynamic library $(LIBVER)
+ ifneq (,$(filter Windows%,$(OS)))
+ 	@$(CC) $(FLAGS) -DLZ4_DLL_EXPORT=1 -shared $^ -o dll\$@.dll
+@@ -102,6 +104,7 @@ else
+ 	@ln -sf $@ liblz4.$(SHARED_EXT_MAJOR)
+ 	@ln -sf $@ liblz4.$(SHARED_EXT)
+ endif
++endif
+ 
+ liblz4: $(LIBLZ4)
+ 
+@@ -159,9 +162,11 @@ ifeq ($(BUILD_STATIC),yes)
+ 	@$(INSTALL_DATA) liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a
+ 	@$(INSTALL_DATA) lz4frame_static.h $(DESTDIR)$(INCLUDEDIR)/lz4frame_static.h
+ endif
++ifeq ($(BUILD_SHARED),yes)
+ 	@$(INSTALL_PROGRAM) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)
+ 	@ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR)
+ 	@ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT)
++endif
+ 	@echo Installing headers in $(INCLUDEDIR)
+ 	@$(INSTALL_DATA) lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h
+ 	@$(INSTALL_DATA) lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h
+-- 
+2.17.0
+
diff --git a/package/lz4/lz4.mk b/package/lz4/lz4.mk
index c88329f7979e..d98dac00eab6 100644
--- a/package/lz4/lz4.mk
+++ b/package/lz4/lz4.mk
@@ -9,12 +9,10 @@ LZ4_SITE = $(call github,lz4,lz4,$(LZ4_VERSION))
 LZ4_INSTALL_STAGING = YES
 LZ4_LICENSE = BSD-2-Clause (library), GPL-2.0+ (programs)
 LZ4_LICENSE_FILES = lib/LICENSE programs/COPYING
+LZ4_MAKE_OPTS = DESTDIR=$(STAGING_DIR) PREFIX=/usr
 
 ifeq ($(BR2_STATIC_LIBS),y)
-define LZ4_DISABLE_SHARED
-	$(SED) '/SHARED/d' $(@D)/lib/Makefile
-endef
-LZ4_POST_PATCH_HOOKS += LZ4_DISABLE_SHARED
+LZ4_MAKE_OPTS += BUILD_SHARED=no
 endif
 
 define HOST_LZ4_BUILD_CMDS
@@ -27,17 +25,18 @@ define HOST_LZ4_INSTALL_CMDS
 endef
 
 define LZ4_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) lib lz4
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(LZ4_MAKE_OPTS) \
+		-C $(@D) lib lz4
 endef
 
 define LZ4_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(STAGING_DIR) \
-		PREFIX=/usr install -C $(@D)
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(LZ4_MAKE_OPTS) \
+		install -C $(@D)
 endef
 
 define LZ4_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(TARGET_DIR) \
-		PREFIX=/usr install -C $(@D)
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(LZ4_MAKE_OPTS) \
+		install -C $(@D)
 endef
 
 $(eval $(generic-package))
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] lz4: bump to version 1.8.1.2
  2018-04-19  9:46 [Buildroot] [PATCH 1/2] lz4: bump to version 1.8.1.2 Baruch Siach
  2018-04-19  9:46 ` [Buildroot] [PATCH 2/2] lz4: improve static only build support Baruch Siach
@ 2018-04-19 20:49 ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2018-04-19 20:49 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 19 Apr 2018 12:46:35 +0300, Baruch Siach wrote:
> Use lib and lz4 make targets to avoid build of the manual generator, and
> the examples. Both of them use the target compiler to build host tools.
> 
> Add license files hashes.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  package/lz4/lz4.hash | 4 +++-
>  package/lz4/lz4.mk   | 6 +++---
>  2 files changed, 6 insertions(+), 4 deletions(-)

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] 5+ messages in thread

* [Buildroot] [PATCH 2/2] lz4: improve static only build support
  2018-04-19  9:46 ` [Buildroot] [PATCH 2/2] lz4: improve static only build support Baruch Siach
@ 2018-04-19 20:50   ` Thomas Petazzoni
  2018-04-20  4:31     ` Baruch Siach
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2018-04-19 20:50 UTC (permalink / raw)
  To: buildroot

Hello Baruch,

On Thu, 19 Apr 2018 12:46:36 +0300, Baruch Siach wrote:
> The current method of supporting static only build, removal of all lines
> that match the SHARED regex from lib/Makefile, is crude and fragile.
> Instead, patch lib/Makefile to allow disable of shared libraries.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Thanks for cleaning this up, looks like a good idea. However...

> +LZ4_MAKE_OPTS = DESTDIR=$(STAGING_DIR) PREFIX=/usr

This looks weird. Why is DESTDIR needed at build time ? And how a
DESTDIR=$(STAGING_DIR) in the INSTALL_TARGET_CMDS be the correct thing ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] lz4: improve static only build support
  2018-04-19 20:50   ` Thomas Petazzoni
@ 2018-04-20  4:31     ` Baruch Siach
  0 siblings, 0 replies; 5+ messages in thread
From: Baruch Siach @ 2018-04-20  4:31 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Thu, Apr 19, 2018 at 10:50:17PM +0200, Thomas Petazzoni wrote:
> On Thu, 19 Apr 2018 12:46:36 +0300, Baruch Siach wrote:
> > The current method of supporting static only build, removal of all lines
> > that match the SHARED regex from lib/Makefile, is crude and fragile.
> > Instead, patch lib/Makefile to allow disable of shared libraries.
> > 
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> 
> Thanks for cleaning this up, looks like a good idea. However...
> 
> > +LZ4_MAKE_OPTS = DESTDIR=$(STAGING_DIR) PREFIX=/usr
> 
> This looks weird. Why is DESTDIR needed at build time ? And how a
> DESTDIR=$(STAGING_DIR) in the INSTALL_TARGET_CMDS be the correct thing ?

It is not. Thanks for spotting. I'll fix and resend.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-20  4:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19  9:46 [Buildroot] [PATCH 1/2] lz4: bump to version 1.8.1.2 Baruch Siach
2018-04-19  9:46 ` [Buildroot] [PATCH 2/2] lz4: improve static only build support Baruch Siach
2018-04-19 20:50   ` Thomas Petazzoni
2018-04-20  4:31     ` Baruch Siach
2018-04-19 20:49 ` [Buildroot] [PATCH 1/2] lz4: bump to version 1.8.1.2 Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.