[Buildroot] [PATCH 1/2] support/misc/toolchainfile.cmake.in: set PKG_CONFIG/CMAKE prefix paths

Yann E. MORIN yann.morin.1998 at free.fr
Wed Jan 11 18:36:08 UTC 2023


Nicolas, James, All,

On 2023-01-11 18:35 +0100, Nicolas Cavallari spake thusly:
> On 11/01/2023 17:44, Yann E. MORIN wrote:
> >On 2023-01-11 17:01 +0100, Nicolas Cavallari spake thusly:
> >>On 11/01/2023 16:19, Romain Naour wrote:
> >>>Le 28/07/2022 à 03:44, James Hilliard a écrit :
> >>>>These appear to not be getting set correctly and are needed when using
> >>>>meson's relocatable pkgconfig format.
> >>>How this cmake file (toolchainfile.cmake.in) is used by a meson package ?
> >>I understand it as "a cmake package needs this to use a pkgconfig file
> >>generated by a meson package when meson is configured to generate
> >>relocatable pkgconfig files".
> >
> >OK, but then I have a few questions:
> >
> >   - what are "relocatable pkgconfig files", and how do they fit in the
> >     pkgconfig spec? >
> >   - how do they differ from standard pkgconfig files? By "standard", I
> >     mean all the pkgconfig files we currently install and use from the
> >     hundreds, if not thousands, of packages that provided them.
> 
> Reading the meson's source, they are merely standard pkgconfig files that
> use the ${pcfiledir} variable to define paths instead of hardcoding a
> prefix. These are not specific to meson and are supported by pkg-config. (It
> happen that some of our private packages uses that trick too, and they are
> not meson packages)

That. It has nothing meson specific, in fact. It just happens that meson
is the only tool that generates .pc files with pcfiledir, and pcfiledir
is not widely used either (we've never had a related issue so far, have
we?) (and no, private tools and packages do not count! ;-] )

> >   - why is meson generating those pkgconfig files, rather than standard
> >     ones?
> Because patch 2/2 tells it to.

Ah, yes, I just replied to that second patch too, now. If a change is
needed in preparation of another one, then it should be mentioned (with
an abridged explanation of the problem that will be fixed in that later
change, if possible). And a cover letter that explains the whole picture
is more than welcome, too.

> >   - and finally, if the "relocatable pkgconfig files" generated by meson
> >     are incorrect wrt the pkgconfig spec, can we tell meson not to do
> >     that?
> They are not incorrect.  From experience, autotools and meson packages
> handles them fine. cmake however, according to the commit message, does not
> and needs some extra variables.

Yes, this makes so much more sense now: it is a cmake issue first and
foremost, that is exposed by .pc files generated by meson. Thanks for
the explanations!

James, can you respin this one patch with all this discussion nicely
aggregated and reformatted as a proper commit log, please?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list