I also stumbled over this issue. In my opinion setting PKG_CONFIG_PATH is wrong for two reasons:
* it overwrites the PKG_CONFIG_PATH from the environment
* it makes pkg-config still search the non-cross-compile default paths
So for example if I want to cross-compile for mingw-w64 and do not have a cross-compiled version of "libsndfile" but a native version, calling "x86_64-w64-mingw32-pkg-config sndfile ..." will return the info for the native library and compilation will fail at a later step.
I also stumbled over this issue. In my opinion setting PKG_CONFIG_PATH is wrong for two reasons:
* it overwrites the PKG_CONFIG_PATH from the environment
* it makes pkg-config still search the non-cross-compile default paths
So for example if I want to cross-compile for mingw-w64 and do not have a cross-compiled version of "libsndfile" but a native version, calling "x86_64- w64-mingw32- pkg-config sndfile ..." will return the info for the native library and compilation will fail at a later step.
My suggested fix would be to use PKG_CONFIG_LIBDIR instead, see attached file "pkg-config- crosswrapper. patch" and https:/ /bugs.freedeskt op.org/ show_bug. cgi?id= 3093