From patchwork Mon Apr 16 19:39:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 898897 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.net Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40PzHg5Pt6z9s1P for ; Tue, 17 Apr 2018 05:40:15 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E20D3881DC; Mon, 16 Apr 2018 19:40:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lwVfO2no1VtC; Mon, 16 Apr 2018 19:40:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 2301A8820A; Mon, 16 Apr 2018 19:40:07 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 0ECF51CF168 for ; Mon, 16 Apr 2018 19:40:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0C25A87F0B for ; Mon, 16 Apr 2018 19:40:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HySgXMsl+tXx for ; Mon, 16 Apr 2018 19:40:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by hemlock.osuosl.org (Postfix) with ESMTPS id B9D9887F0A for ; Mon, 16 Apr 2018 19:39:59 +0000 (UTC) Received: from localhost.localdomain ([94.216.63.103]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LpcBS-1eTr9W1WPG-00fSNy; Mon, 16 Apr 2018 21:39:56 +0200 From: Peter Seiderer To: buildroot@buildroot.org Date: Mon, 16 Apr 2018 21:39:52 +0200 Message-Id: <20180416193953.19924-5-ps.report@gmx.net> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180416193953.19924-1-ps.report@gmx.net> References: <20180416193953.19924-1-ps.report@gmx.net> X-Provags-ID: V03:K1:ksNFcBdqZe2Z47wsBGF6m6iTYpGQwFwAKPplkRM5kMw1O95DMRS Tk/BJtUHyWnbWgKa7AZhEot/auSBiopM89qoLqPxif9e7q/dkVMzLZcEWBxemGmUkYnjsBC I+KxeP9041eNbzlvCRYvQrIriDXbWegPJuziQWIZNc3y6+grVbO96CINzbVmECJUA8YenBN cOkeeUd0iYAVDbgr+1r7Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:vNyvfnNnfZA=:/TxVnh71Vj3utq+m2xnLuu JE+j/vyd6dA/XuqE69Hj7i0R2VYMPKguN0bYw5hO5iO3o9woDQWjwXf0ahO7z754Q6ToFOYSk 0CznJWTpcQivzjIQvpT7PQp4H3YpJhcWy1O5qb+BjxWoD/QrcnzuqyBAXWY5W7Wnni9FRJhO/ snWTzqJX/lpQlDYRT+m423PW2BdnamPGTjGP34HzCjBeWvD9uOI2JeydT3SA3Or1hV3+oEzLJ SE/qUk7i2uYI3TKgGjDb1OZaioMJgxPMOdmZw8Xss8IKf04V8DWkHb4JczhjOvXi6yKHcD2Ej OXFva/0rgGWRv1j+uFqAU+UA+rqTD+yNz6upgYuXHqR9u1AYUQ8UEQzkQLh5ZkA4b9rSJqqZA TCr/3OvFwBFzOptizzH6txPTnUMYp2eyurqIKzsZgEaENdfaO2xZB37j2Bs1i9hiU879oJYO7 RanPmulKG3vjuF6o9xRYAgsWnHIDTnlvFfbLzp5QkjJ0txzMn5/FZhaBRpW/x4C/PQDnDK5yG ZzLCkYIsBtrGjkVznfwd1rBUchPFoGKuz4PMAb9EhfhxOfeUYGWH0bBC4D9vbzfPjMGS5Zx/V utHwL9FZBtVdNyyB7mDwC5PMs8z4TlL40VAKgYmbl2XONThzLje0Cwgnsw5T9A97V/K+oMcYV Dd12eprmn41KZlEowFrT3PIbzfutSiaMYwCn5Ae7IZ/cNAUcJazHHtPn8jVE8hNK3E330lSg3 kvCGF/ibtYl6uWFV3/IZ0KqU+8juNEfm2+cqcNbVZmQy9I/t40TzQySxhXMkMreULjpOAuJ2d xNB/6Q/9bGXLGoxh88Unxqk40+HhA== Subject: [Buildroot] [PATCH v3 5/6] zstd: add libzstd support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , "Yann E . MORIN" , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "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 --- 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 +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 +--- + 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