From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 5/6] zstd: add libzstd support
Date: Mon, 23 Apr 2018 10:08:49 +0200 [thread overview]
Message-ID: <20180423080849.GM12688@scaer> (raw)
In-Reply-To: <20180416193953.19924-5-ps.report@gmx.net>
Peter, All,
On 2018-04-16 21:39 +0200, Peter Seiderer spake thusly:
> 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 <ps.report@gmx.net>
[--SNIP--]
> 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
[--SNIP--]
> @@ -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
I don't like much that we redefine the BUILD_CMDS, INSTALL_TARGET_CMDS,
and INSTALL_STAGING_CMDS multiple times under various conditions. When
we have that situation, we tend to define additional macros, like so:
ifeq ($(BR2_STATIC_LIBS),y)
ZSTD_BUILD_LIBS = libzstd.a
ZSTD_INSTALL_LIBS = install-static
else ifeq ($(BR2_SHARED_LIBS),y)
ZSTD_BUILD_LIBS = libzstd
ZSTD_INSTALL_LIBS = install-shared
else
ZSTD_BUILD_LIBS = libzstd.a libzstd
ZSTD_INSTALL_LIBS = install-static install-shared
endif
define ZSTD_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
-C $(@D)/lib $(ZSTD_BUILD_LIBS)
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
-C $(@D) zstd
endef
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-includes $(ZSTD_INSTALL_LIBS)
endef
define ZSTD_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \
DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/lib $(ZSTD_INSTALL_LIBS)
endef
Note: yes, the target install would also install the static libs, but
they will be removed in target-finalize anyway. So, given this matches
our usual practice, and that it makes the code smaller and easier to
read, I'd suggest we go this route.
Regards,
Yann E. MORIN.
> +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
> --
> 2.16.3
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2018-04-23 8:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 19:39 [Buildroot] [PATCH v3 1/6] squashfs: add license hash Peter Seiderer
2018-04-16 19:39 ` [Buildroot] [PATCH v3 2/6] zstd: add host libzstd support Peter Seiderer
2018-04-23 7:56 ` Yann E. MORIN
2018-04-25 21:37 ` Thomas Petazzoni
2018-04-16 19:39 ` [Buildroot] [PATCH v3 3/6] squashfs: add host zstd support Peter Seiderer
2018-04-23 7:57 ` Yann E. MORIN
2018-04-25 21:38 ` Thomas Petazzoni
2018-04-16 19:39 ` [Buildroot] [PATCH v3 4/6] fs/squashfs: add " Peter Seiderer
2018-04-25 21:40 ` Thomas Petazzoni
2018-04-16 19:39 ` [Buildroot] [PATCH v3 5/6] zstd: add libzstd support Peter Seiderer
2018-04-23 8:08 ` Yann E. MORIN [this message]
2018-04-25 21:48 ` Thomas Petazzoni
2018-04-30 18:48 ` Peter Seiderer
2018-04-16 19:39 ` [Buildroot] [PATCH v3 6/6] squashfs: add zstd support Peter Seiderer
2018-04-23 8:18 ` Yann E. MORIN
2018-04-25 21:49 ` Thomas Petazzoni
2018-04-25 21:34 ` [Buildroot] [PATCH v3 1/6] squashfs: add license hash Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180423080849.GM12688@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.