0

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

3

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

You must log in to answer this question.

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