I need to use latest version of pkg-config. So I build it from source with --with-internal-glib --disable-host-tool.

However, it cannot find any package without setting PKG_CONFIG_PATH. How can I make it behave like system installed one which contains all default paths?

1 Answer 1


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:

          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


$ /usr/bin/pkg-config --variable pc_path pkg-config

Then copy the result to the configure command, for example

make clean

./configure --with-internal-glib --disable-host-tool \


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .