[Buildroot] [PATCH 1/2] meson: fix malformed cross-compilation.conf.in

Adam Duskett aduskett at gmail.com
Sat Dec 30 04:32:45 UTC 2017


Hello;

On Fri, Dec 29, 2017 at 5:22 PM, Thomas Petazzoni
<thomas.petazzoni at free-electrons.com> wrote:
> 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 at 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 ?
>
We could, but this works and is the only issue I could find with the
build system.
The end result would be exactly the same for a bunch of extra effort yes?

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

Thanks!

Adam



More information about the buildroot mailing list