Pkg-config does not respect PKG_CONFIG_PATH


(Marcin Skoczylas) #1

Hello,

I need working pkg-config with my own list of folders for ARM cross development. I installed it via HomeBrew, changed the PKG_CONFIG_PATH but it seems pkg-config does not use the PKG_CONFIG_PATH environment variable at all. Maybe I’m misunderstanding something, or doing something wrong? How I can make pkg-config look into my selected folders?

[mars@mbp]:~/develop/rp3> echo $PKG_CONFIG_PATH 
/Volumes/xtools/opt/lib/pkgconfig
[mars@mbp]:~/develop/rp3> pkg-config --variable pc_path pkg-config
/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.12

(Joshua McKinney) #2

Homebrew doesn’t modify the upstream source, which should respect the environment variable you mentioned. Looking into this, the command you’re running doesn’t seem to do what you think it does. It shows the builtin fallback paths not your environment overrides.

See https://github.com/Homebrew/homebrew-core/blob/master/Formula/pkg-config.rb and https://cgit.freedesktop.org/pkg-config/tree/main.c#n520