Assuming that you built from source using autoconf
then according to ./configure --help
, there's a configuration variable for that:
--with-pc-path default search path for .pc files
You can find the search path for your system-installed version as mentioned in the man page:
pc_path
The default search path used by pkg-config when searching for
.pc files. This can be used in a query for the pkg-config module
itself itself:
$ pkg-config --variable pc_path pkg-config
ex.
$ /usr/bin/pkg-config --variable pc_path pkg-config
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
Then copy the result to the configure command, for example
make clean
./configure --with-internal-glib --disable-host-tool \
--with-pc-path=/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
make