Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Herve Codina <herve.codina@bootlin.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2 2/5] package/ulog: new package
Date: Sat, 1 Jan 2022 17:05:33 +0100	[thread overview]
Message-ID: <20220101160533.GE2777@scaer> (raw)
In-Reply-To: <20211112131258.2671293-3-herve.codina@bootlin.com>

Hervé, All,

On 2021-11-12 14:12 +0100, Herve Codina spake thusly:
> The ulog library is a minimalistic logging library derived from
> Android logger.
> 
> https://github.com/Parrot-Developers/ulog
> 
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
[--SNIP--]
> diff --git a/package/ulog/ulog.mk b/package/ulog/ulog.mk
> new file mode 100644
> index 0000000000..fab16e80d8
> --- /dev/null
> +++ b/package/ulog/ulog.mk
> @@ -0,0 +1,44 @@
> +################################################################################
> +#
> +# ulog
> +#
> +################################################################################
> +
> +ULOG_VERSION = 0389d243352255f6182326dccdae3d56dadc078f
> +ULOG_SITE = $(call github,Parrot-Developers,ulog,$(ULOG_VERSION))
> +ULOG_LICENSE = Apache-2.0
> +ULOG_LICENSE_FILES = COPYING
> +ULOG_DEPENDENCIES = host-alchemy
> +ULOG_INSTALL_STAGING = YES
> +
> +define ULOG_BUILD_CMDS
> +	$(ALCHEMY_TARGET_ENV) \
> +		$(ALCHEMY_MAKE) libulog
> +endef
> +
> +define ULOG_INSTALL_STATIC_LIBS
> +	$(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libulog.a $(1)/usr/lib/
> +endef

So, it looks like you are always going to install the static library,
but the package does not have:  depends on !BR2_STATIC_LIBS

> +
> +define ULOG_INSTALL_HEADERS
> +	cp -Raf $(@D)/libulog/include/* $(1)/usr/include/
> +endef
> +
> +ifeq ($(BR2_STATIC_LIBS),)
> +define ULOG_INSTALL_SHARED_LIBS
> +	$(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/lib/libulog.so* $(1)/usr/lib/

Although it is very improbable that the destination directory does not
already exist, that is still a possibility, especially in target/. And
for consistency with all the other packages, you must create the
destination directory first before you start copying multiple files in
there.

Also for consistency, use either 'cp' or '$(INSTALL)', not both , in the
same .mk (you used 'cp' for headers, and '$(INSTALL)' for libs, although
I don't see a reason not to use them consistently).

Oh, and shared libraries do not need to be +x, so -m 644 is enough.

> +endef
> +endif
> +
> +define ULOG_INSTALL_TARGET_CMDS
> +	$(call ULOG_INSTALL_SHARED_LIBS, $(TARGET_DIR))
> +endef
> +
> +define ULOG_INSTALL_STAGING_CMDS
> +	$(call ULOG_INSTALL_STATIC_LIBS, $(STAGING_DIR))
> +	$(call ULOG_INSTALL_SHARED_LIBS, $(STAGING_DIR))
> +	$(call ULOG_INSTALL_HEADERS, $(STAGING_DIR))
> +	$(call ALCHEMY_INSTALL_LIB_SDK_FILE, ulog, libulog, libulog.so)

So, what happens with BR2_STATIC_LIBS=y? The .so would not exist in that
case, would it? But then, this is what would be registered in the
atom.mk...

And with BR2_STATIC_LIBS not set, then the .a should not be built (or at
least not installed!), yet the installation of the static lib is
unconditional (and see the first comment too).

It is difficult to understand if all of the static-shared combinations
are supported, so could you please check/clarify this?

If the three combinations are indeed supported, then both the shared and
the staic install macros should be conditional. Otherwise, proper guards
should be added in the Config.in.

Those comments apply to all the pakcages in this series.

Regards,
Yann E. MORIN.

> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.31.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-01-01 16:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 13:12 [Buildroot] [PATCH v2 0/5] Add Alchemy build system and some related libs Herve Codina
2021-11-12 13:12 ` [Buildroot] [PATCH v2 1/5] package/alchemy: new host package Herve Codina
2022-01-01 15:50   ` Yann E. MORIN
2022-01-09 15:17     ` Herve Codina
2021-11-12 13:12 ` [Buildroot] [PATCH v2 2/5] package/ulog: new package Herve Codina
2022-01-01 16:05   ` Yann E. MORIN [this message]
2022-01-10  9:02     ` Herve Codina
2021-11-12 13:12 ` [Buildroot] [PATCH v2 3/5] package/libfutils: " Herve Codina
2021-11-12 13:12 ` [Buildroot] [PATCH v2 4/5] package/libshdata: " Herve Codina
2021-11-12 13:12 ` [Buildroot] [PATCH v2 5/5] support/testing/tests/package/test_libshdata: new test Herve Codina

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=20220101160533.GE2777@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=herve.codina@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox