[Buildroot] [PATCH v5 1/2] package/zstd: rework build and install
Arnout Vandecappelle
arnout at mind.be
Thu Aug 5 20:20:18 UTC 2021
On 04/08/2021 23:56, Norbert Lange wrote:
> Move PREFIX=/usr to ZSTD_OPTS, even though it is only used by
> libzstd.pc for now it should be available in every step.
>
> Create libzstd.pc in the build step instead of triggering a
> lazy build during installation when it is missing.
>
> Attach '-release' to the targets, since the default is to
> build lib-release and zstd-release.
>
> Signed-off-by: Norbert Lange <nolange79 at gmail.com>
>
> ---
> v4->v5:
> * rebase, remove the parts that are already upstream
> * improve commit message
> * try to keep changes minimal
> v3->v4:
> * revert to previous scheme of BR2_TOOLCHAIN_HAS_THREADS
> fixing build options for both static and shared libs.
> v2->v3:
> * use normal = for assignment
> v1->v2:
> * rebased against upstream/master
>
> Signed-off-by: Norbert Lange <nolange79 at gmail.com>
> ---
> package/zstd/zstd.mk | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk
> index 5a96c11309..d7a0320df4 100644
> --- a/package/zstd/zstd.mk
> +++ b/package/zstd/zstd.mk
> @@ -12,6 +12,7 @@ ZSTD_LICENSE_FILES = LICENSE COPYING
> ZSTD_CPE_ID_VENDOR = facebook
> ZSTD_CPE_ID_PRODUCT = zstandard
>
> +ZSTD_OPTS += PREFIX=/usr
> ZSTD_OPTS += ZSTD_LEGACY_SUPPORT=0
> ifeq ($(BR2_PACKAGE_ZLIB),y)
> ZSTD_DEPENDENCIES += zlib
> @@ -60,12 +61,13 @@ else
> ZSTD_OPTS += HAVE_THREAD=0
> ZSTD_BUILD_LIBS := $(addsuffix -nomt,$(ZSTD_BUILD_LIBS))
> endif
> +ZSTD_BUILD_LIBS := $(addsuffix -release,$(ZSTD_BUILD_LIBS))
check-package complained about this override of the variable, so I added a
check-package disable comment above.
I also improved the commit message a little (though it was already good - I
just strive for perfection :-) and committed both to next, thanks! This series
can finally be put to rest :-)
Regards,
Arnout
>
> define ZSTD_BUILD_CMDS
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> - -C $(@D)/lib $(ZSTD_BUILD_LIBS)
> + -C $(@D)/lib $(ZSTD_BUILD_LIBS) libzstd.pc
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> - -C $(@D) zstd
> + -C $(@D) zstd-release
> endef
>
> define ZSTD_INSTALL_STAGING_CMDS
> @@ -76,9 +78,9 @@ endef
>
> define ZSTD_INSTALL_TARGET_CMDS
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> - DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install
> + DESTDIR=$(TARGET_DIR) -C $(@D)/programs install
> $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
> - DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/lib $(ZSTD_INSTALL_LIBS)
> + DESTDIR=$(TARGET_DIR) -C $(@D)/lib $(ZSTD_INSTALL_LIBS)
> endef
>
> HOST_ZSTD_OPTS += PREFIX=$(HOST_DIR)
>
More information about the buildroot
mailing list