[Buildroot] [PATCH 1/2] meson: add entry for libgcrypt-config in cross file

Jörg Krause joerg.krause at embedded.rocks
Tue Apr 30 11:04:04 UTC 2019


Hello Peter,

On Tue, 2019-04-30 at 10:27 +0200, Peter Seiderer wrote:
> Hello Jörg,
> 
> > Gesendet: Dienstag, 30. April 2019 um 10:11 Uhr
> > Von: "Jörg Krause" <joerg.krause at embedded.rocks>
> > An: "Peter Seiderer" <ps.report at gmx.net>, "Thomas Petazzoni" <thomas.petazzoni at bootlin.com>
> > Cc: buildroot at buildroot.org
> > Betreff: Re: [Buildroot] [PATCH 1/2] meson: add entry for libgcrypt-config in cross file
> > 
> > Hi Peter,
> > 
> > On Tue, 2019-04-23 at 23:29 +0200, Peter Seiderer wrote:
> > > Hello Jörg, Thomas,
> > > 
> > > On Sat, 13 Apr 2019 18:24:22 +0200, Thomas Petazzoni <thomas.petazzoni at bootlin.com> wrote:
> > > 
> > > > Hello Jörg,
> > > > 
> > > > +Peter Seiderer in Cc.
> > > > 
> > > > On Wed,  3 Apr 2019 20:32:01 +0200
> > > > Jörg Krause <joerg.krause at embedded.rocks> wrote:
> > > > 
> > > > > Since version 0.49.0 the Meson build system has native support for
> > > > > looking for `libgcrypt-config` if no pkg-config file is found. As the
> > > > > latest version 1.8.4 of libgcrypt does not provide a .pc file, using
> > > > > `libgcrypt-config` is the only way for detecting the required libraries
> > > > > when linking agains libgrypt.
> > > > > 
> > > > > The `libgcrypt-config` entry is necessary for updating package mpd,
> > > > > which switched from the Autotools to the Meson build system when bumping
> > > > > from version 0.20 to 0.21.
> > > > > 
> > > > > Signed-off-by: Jörg Krause <joerg.krause at embedded.rocks>  
> > > > 
> > > > As I said in my previous reply, I'm not too happy with this
> > > > libgcrypt-config variable creeping into the global cross-compilation
> > > > file. Can we instead look at extending what Peter Seiderer is doing in
> > > > http://patchwork.ozlabs.org/patch/1081486/ and allow some per-package
> > > > additions to the per-package cross-compilation file ? Peter's patch
> > > > does it for CFLAGS/CXXFLAGS/LDFLAGS, we could perhaps do the same with
> > > > arbitrary program paths ?
> > > 
> > > Something like the following (draft) should work:
> > > 
> > > diff --git a/package/meson/cross-compilation.conf.in b/package/meson/cross-compilation.conf.in
> > > index 4056c2b2f4..7cd372128e 100644
> > > --- a/package/meson/cross-compilation.conf.in
> > > +++ b/package/meson/cross-compilation.conf.in
> > > @@ -9,6 +9,7 @@ cpp = '@TARGET_CROSS at g++'
> > >  ar = '@TARGET_CROSS at ar'
> > >  strip = '@TARGET_CROSS at strip'
> > >  pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'
> > > + at PKG_TARGET_BINARIES@
> > >  
> > >  [properties]
> > >  needs_exe_wrapper = true
> > > diff --git a/package/meson/meson.mk b/package/meson/meson.mk
> > > index 70128f6bad..e550c80c9d 100644
> > > --- a/package/meson/meson.mk
> > > +++ b/package/meson/meson.mk
> > > @@ -60,6 +60,7 @@ define HOST_MESON_INSTALL_CROSS_CONF
> > >             -e "s%@TARGET_CFLAGS@%$(HOST_MESON_SED_CFLAGS)%g" \
> > >             -e "s%@TARGET_LDFLAGS@%$(HOST_MESON_SED_LDFLAGS)%g" \
> > >             -e "s%@TARGET_CXXFLAGS@%$(HOST_MESON_SED_CXXFLAGS)%g" \
> > > +           -e "s%@PKG_TARGET_BINARIES@%%g" \
> > >             -e "s%@PKG_TARGET_CFLAGS@%%g" \
> > >             -e "s%@PKG_TARGET_LDFLAGS@%%g" \
> > >             -e "s%@PKG_TARGET_CXXFLAGS@%%g" \
> > > diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
> > > index 9974b1e513..93df43fe3e 100644
> > > --- a/package/pkg-meson.mk
> > > +++ b/package/pkg-meson.mk
> > > @@ -74,6 +74,7 @@ define $(2)_CONFIGURE_CMDS
> > >             -e "s%@TARGET_CFLAGS@%$$(HOST_MESON_SED_CFLAGS)%g" \
> > >             -e "s%@TARGET_LDFLAGS@%$$(HOST_MESON_SED_LDFLAGS)%g" \
> > >             -e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \
> > > +           -e "s%@PKG_TARGET_BINARIES@%$$($$(PKG)_MESON_BINARIES)%g" \
> > >             -e "s%@PKG_TARGET_CFLAGS@%$$($$(PKG)_MESON_SED_CFLAGS)%g" \
> > >             -e "s%@PKG_TARGET_LDFLAGS@%$$($$(PKG)_MESON_SED_LDFLAGS)%g" \
> > >             -e "s%@PKG_TARGET_CXXFLAGS@%$$($$(PKG)_MESON_SED_CXXFLAGS)%g" \
> > > 
> > > 
> > > and with: 
> > > 
> > > MPD_MESON_BINARIES = libgcrypt-config = '$(STAGING_DIR)/usr/bin/libgcrypt-config'
> > 
> > I've just tested your draft. This still inserts libgcrypt-config in the
> > global cross-compilation.conf.
> 
> Are you sure? The
> 
> +           -e "s%@PKG_TARGET_BINARIES@%%g"
> 
> in package/meson/meson.mk should not add anything to the global file...

You're right! I missed that line, sorry.

> Would have expected the trick/non-trivial thing to add more than one
> binary entry (to get the newlines for the entries right)...

That's indeed a difficult case to solve. I didn't managed to get
multpile binary entries added to the [binaries] field, e.g.

PKG_TARGET_BINARIES = \
	libgcrypt-config = '...' \
	llvm-config = '...'

.. will not work.

I spent some time to find a magic rule which splits the Makefile
variable into a proper newline seperated string which can be used by
sed, but I failed.

Maybe you have an idea?

Best regards
Jörg Krause



More information about the buildroot mailing list