pkg-config and share/

From: Andrea Pappacoda <andrea_at_pappacoda.it>
Date: Sun, 24 Jul 2022 12:36:14 UTC
Hi everyone! First time on the FreeBSD mailing lists, I hope this is not in the wrong section :)

I'd like to ask/discuss about FreeBSD's pkg-config behaviour. [As far as I understand][1], on FreeBSD pkgconf looks for .pc files in the /usr/lib and /usr/libdata directories, but completely ignores /usr/share. Why is that? Where should arch-independent packages install their .pc files?

I came here after a short discussion on a [GitHub issue][2], and I recommend looking at that thread too because it gives a lot of information about what the issue with not looking in share/ is, but in short it creates interoperability problems with OSs wanting to use that directory for cross-build purposes.

Could somebody please help me understand why things work this way here, and if this unusual pkg-config behaviour could be improved?

Thanks!

[1]: https://cgit.freebsd.org/ports/tree/devel/pkgconf/Makefile#n23

[2]: https://github.com/marzer/tomlplusplus/pull/165