pkg-config is looking into /usr/local/lib/pkgconfig even with PKG_CONFIG_PATH set to another location

StackOverflow https://stackoverflow.com/questions/13879871

  •  08-12-2021
  •  | 
  •  

سؤال

I'm using pkg-config to cross compile a project to MIPS platform. As usual, I'm setting the PKG_CONFIG_PATH var to the target's platform suitable directory (in this case something like /usr/local/mips_sdk/usr/local/lib/pkgconfig, but it doesn't matter).

Strange is that pkg-config is using .pc files from /usr/local/lib/pkgconfig when they are not found in the path pointed by PKG_CONFIG_PATH var. It is like /usr/local/lib/pkgconfig is hardcoded in the search path of pkg-config.

It feels a little strange because it will try to link system libraries (x86) to my mips compiled stuff.

Does anyone knows how to solve it?

Thanks very much.

هل كانت مفيدة؟

المحلول

Here is how I would approach debugging this problem: Run

strace -o makelog -f -ff -v -s 9000 make

This will create makelog.<pid> files for all processes run during compilation. With the options given they will contain a complete list of environment variables, so you should first of all be able to follow PKG_CONFIG_PATH and see if/where it changes. You can also find things like if /usr/local/lib/pkgconfig is read from some configuration file or not for instance.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top