Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in
Date: Fri, 29 Dec 2017 23:22:34 +0100	[thread overview]
Message-ID: <20171229232234.44b89144@windsurf.lan> (raw)
In-Reply-To: <20171229215243.6273-1-Adamduskett@outlook.com>

Hello,

On Fri, 29 Dec 2017 16:52:42 -0500, Adam Duskett wrote:
> Currently, meson will set the c_link_args and the cpp_link_args to the value
> of TARGET_LDFLAGS, even when it's not defined.
> 
> This creates a malformed array ["",] which will break any package building
> using meson/ninja.
> 
> Add a small regular expression at the end of the sed command to check for
> ["", ] and replace it with [] instead.
> 
> Credit goes to Yann for the regular expression.
> 
> Signed-off-by: Adam Duskett <Adamduskett@outlook.com>
> ---
>  package/meson/meson.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/meson/meson.mk b/package/meson/meson.mk
> index 55ce84da07..75b9a1666a 100644
> --- a/package/meson/meson.mk
> +++ b/package/meson/meson.mk
> @@ -26,6 +26,7 @@ define HOST_MESON_INSTALL_CROSS_CONF
>  	    -e "s%@TARGET_LDFLAGS@%`printf '"%s", ' $(TARGET_LDFLAGS)`%g" \
>  	    -e "s%@TARGET_CXXFLAGS@%`printf '"%s", ' $(TARGET_CXXFLAGS)`%g" \
>  	    -e "s%@HOST_DIR@%$(HOST_DIR)%g" \
> +	    -e 's/\["", \]/[]/' \
>  	    $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \
>  	    > $(HOST_DIR)/etc/meson/cross-compilation.conf  
>  endef

While this works, it feels a bit like a hack to me: we are just fixing
the mess we have created a few lines before. Can we instead do the
replacement only if it's needed ? Or calculate some intermediate
variable that is empty is TARGET_CFLAGS is empty, and equal to
'"$(TARGET_CFLAGS)", ' if not ?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  parent reply	other threads:[~2017-12-29 22:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-29 21:52 [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in Adam Duskett
2017-12-29 21:52 ` [Buildroot] [PATCH 2/2] systemd: bump to 236, convert to meson Adam Duskett
2017-12-29 22:57   ` Yann E. MORIN
2017-12-29 22:22 ` Thomas Petazzoni [this message]
2017-12-30  4:32   ` [Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in Adam Duskett

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=20171229232234.44b89144@windsurf.lan \
    --to=thomas.petazzoni@free-electrons.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox