From patchwork Tue May 25 17:26:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Norbert Lange X-Patchwork-Id: 1483670 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=WaSzoCnJ; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FqLdB6pF2z9sPf for ; Wed, 26 May 2021 03:27:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5ECBC40495; Tue, 25 May 2021 17:27:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u0X__7-3mPZc; Tue, 25 May 2021 17:27:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 9EBC540487; Tue, 25 May 2021 17:27:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id E478B1BF57B for ; Tue, 25 May 2021 17:27:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E0CF04045B for ; Tue, 25 May 2021 17:27:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HzEP2mN_rIpK for ; Tue, 25 May 2021 17:27:07 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by smtp2.osuosl.org (Postfix) with ESMTPS id E94EB401F4 for ; Tue, 25 May 2021 17:27:06 +0000 (UTC) Received: by mail-ed1-x52e.google.com with SMTP id j10so19635527edw.8 for ; Tue, 25 May 2021 10:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dGXhF/12aKvCp0I/jabKcIXDOGizeuIU4sPYuDWdrFU=; b=WaSzoCnJ0s26ZFnDvRkYsv+J4DluoFuL9FjvY+LaIVW9jR3ndc+NMUbTNplnPKkoK/ p+V5jGgYR8Ho2I860xhUELVSX21gtBCptTvbkdg6pUNYg7BQ7hoK7C2s5wer1JMi4J7X JdgZ4Ivb/YADJZHVjBtc2xQ9A7TGoKRfvUL94kdzmDm1FomXr6R/VeHS/Ctes68GGrf6 9cQg+9iHGURAuC/piaDez9wfiOveRvVbe1lFAVrKKFGuJko7E0PXWfJUFlDLfX92QQnu jFI7bCRilfYLaKHdd6hRdfSyH3Z2/MoZgat5+ViWc3tGN9RhO3MxQlZ9geESPu+E5zWq d0sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dGXhF/12aKvCp0I/jabKcIXDOGizeuIU4sPYuDWdrFU=; b=Ss+mEOS8un/I4m7xSqhbwxQNfuGnvEM7AyxG5wQ/Ac1tLwTdQyqD8KzXR2+cV1zSh0 c3L1AhOrvztesb9F+L/R96chfTC9yAbYx6z5alHzRMi1X+QuFQf5zb032cDqISPFnDfy AsyfK7hx/ntEmObJHP4OhIjBqPDQnf3IEp9TYwZ1xwGtOJRmjHuOL61mgoKWc2CAQTsk 5TraEJdqi0869y2/IoJVzVKuCo7z6K4HVjla1DMpDAnfl2qgYiKsQs1bV+XOihbMevgY 9tq51afMjtyABgNqRnzPp1ExlkUGsQnNjw9wfMG29YGDd9KIjKWZ0VKg2OQQ0L7x07e4 5vPg== X-Gm-Message-State: AOAM533wXnQzE2Z+1KPcXPCwY6v/iNtsN+XXyrjUR/Dsq0/K8YZJI83x 0YQF6IOBvcIa9+KX2/oagOtThZXMYGeDUg== X-Google-Smtp-Source: ABdhPJxZJ3oHxTvMvMid0dPJUx8wGYHPnM3RL6OHP6+jZK/JCBznZge7wVEzY1fGFBFa6d60VdDm3w== X-Received: by 2002:a05:6402:430b:: with SMTP id m11mr15183569edc.31.1621963625197; Tue, 25 May 2021 10:27:05 -0700 (PDT) Received: from debian-noppl.. (84-114-45-16.cable.dynamic.surfer.at. [84.114.45.16]) by smtp.gmail.com with ESMTPSA id w10sm9333204ejq.48.2021.05.25.10.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 10:27:04 -0700 (PDT) From: Norbert Lange To: buildroot@buildroot.org Date: Tue, 25 May 2021 19:26:51 +0200 Message-Id: <20210525172652.821351-5-nolange79@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210525172652.821351-1-nolange79@gmail.com> References: <20210525172652.821351-1-nolange79@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 5/5] package/zstd: Add option for cli binary X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , Norbert Lange Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" There are a couple of targets to build the cli tool with less features (no legacy-support, benchmarking), or dynamically linked to the library. Add an option to choose the variant. To allow the installation step to pick the variant, it has to be copied to the normal location. Signed-off-by: Norbert Lange --- package/zstd/Config.in | 21 +++++++++++++++++++++ package/zstd/zstd.mk | 9 ++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/package/zstd/Config.in b/package/zstd/Config.in index 9fa70c65cc..0d2ab84771 100644 --- a/package/zstd/Config.in +++ b/package/zstd/Config.in @@ -10,3 +10,24 @@ config BR2_PACKAGE_ZSTD compression formats https://facebook.github.io/zstd + +if BR2_PACKAGE_ZSTD + +choice + prompt "Executable flavor" + help + Pick between variants of the zstd tool. + +config BR2_PACKAGE_ZSTD_PROG_DEFAULT + bool "Default build (static, full-featured)" + +config BR2_PACKAGE_ZSTD_PROG_DYNAMIC + bool "Dynamic build (needs library with identical version)" + depends on !BR2_STATIC_LIBS + +config BR2_PACKAGE_ZSTD_PROG_SMALL + bool "Small build (static, less features)" + +endchoice + +endif diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk index a9499df4d0..ecad26e0df 100644 --- a/package/zstd/zstd.mk +++ b/package/zstd/zstd.mk @@ -48,6 +48,11 @@ endif ZSTD_OPTS += "MOREFLAGS=$(ZSTD_OPTS_MOREFLAGS)" ZSTD_BUILD_PROG_TARGET := zstd-release +ifeq ($(BR2_PACKAGE_ZSTD_PROG_DYNAMIC),y) +ZSTD_BUILD_PROG_TARGET := zstd-dll +else ifeq ($(BR2_PACKAGE_ZSTD_PROG_SMALL),y) +ZSTD_BUILD_PROG_TARGET := zstd-small +endif # Since v1.5.0 the dynamic library is built for # multithreading, while the static library is not. @@ -78,7 +83,9 @@ define ZSTD_BUILD_CMDS $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ -C $(@D)/lib $(addsuffix -release,$(ZSTD_BUILD_LIBS) libzstd.pc) $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - -C $(@D)/programs $(ZSTD_BUILD_PROG_TARGET) + -C $(@D)/programs $(ZSTD_BUILD_PROG_TARGET) && \ + { [ ! -e $(@D)/programs/$(ZSTD_BUILD_PROG_TARGET) ] || \ + ln -f $(@D)/programs/$(ZSTD_BUILD_PROG_TARGET) $(@D)/programs/zstd; } endef define ZSTD_INSTALL_STAGING_CMDS