On Tue, 6 Jun 2017, Michael Müller wrote:
Setting PKG_CONFIG_PATH doesn't seem like a good option for me. You would need to implement the path for every possible distribution and platform to not cause any regressions.
You may be thinking of PKG_CONFIG_LIBDIR which overrides the system defaults. PKG_CONFIG_PATH only prepends to the system defaults so that if the .pc files are not found there they are still looked up in all the standard places.
On Arch Linux it is for example /usr/lib32/pkgconfig. On FreeBSD it is /usr/libdata/pkgconfig/.
Maybe a few more paths will need to be added but their absence will not make things worse.
Not to speak of cross compilation cases in which users might have a special build of pkgconfig where overriding PKG_CONFIG_PATH doesn't make any sense.
That's why PKG_CONFIG_PATH is only set if $cross_compiling is false in the 32 bit case. The 64 bit case does not seem to have any qualms forcing CC="$CC -m64" regardless of $cross_compiling so I'm aligning myself with that until I know why it should be different.