1
votes

I'm build an opensourced project configured by GNU autoconf. It depends on the glib2.36 and it reports the glib library's version is lower than that. But I don't want to replace my system's glib in the path of "/usr/lib". My idea is to download the glib2.36 and build from scratch and install it to "$HOME/local". Then I want to configure the project using --prefix=$HOME/local.

    $cd ~/tmp/glib-2.36.0$
    $./configure  --prefix=$HOME/local
    $make
    $make install

    $cd ~/tmp/project
    $./configure --prefix=$HOME/local

but it still reports "checking for GLIB - version >= 2.36.0... no" How can I resolve it?

2

2 Answers

1
votes

Assuming that your project uses pkg-config and the PKG_CHECK_MODULES macro, you can check where pkg-config looks for .pc files with: pkg-config --variable pc_path pkg-config

You can specify paths for pkg-config to search first by setting the PKG_CONFIG_PATH variable. So, you would invoke configure with something like:

env PKG_CONFIG_PATH="$HOME/local/pkgconfig" ./configure --prefix=$HOME/local

1
votes

--prefix does't specify where ./configure looks for library. It sets where to install files when you run make install. ./configure --help will show you more options.

If pkg-config is used you cant set GLIB_CFLAGS and GLIB_LIBS env variables to change path for specific package.

But you would check ./configure --help first.