On 06.06.2017 17:52, Francois Gouget wrote:
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.
The 32-bit case shouldn't cause any problems and looks fine to me, but the 64-bit case would break our cross compilation for macOS. Adding "-m64" doesn't matter, however setting PKG_CONFIG_PATH means that host pkgconfig information is used instead of the correct one. Of course it can be worked around with a cross compilation check, but I'm wondering if it wouldn't be better to omit this hack for 64-bit and only focus on the 32-bit case.
Best regards, Sebastian