We are living as nomad in Georgia !!

Install pkg-config From Source

Contents

Download

pkg-config Official Site

https://www.freedesktop.org/wiki/Software/pkg-config/

Install pkg-config

For CentOS / Ubuntu / MacOS

※ When installing version 0.29.2

Terminal

# wget https://pkg-config.freedesktop.org/releases/pkg-config-0.29.2.tar.gz
# tar xvfz pkg-config-0.29.2.tar.gz
# cd pkg-config-0.29.2
# ./configure --prefix=/usr/local/pkg_config/0_29_2 --with-internal-glib
# make
# make install

Configure Options

--prefix

the installation path

--with-internal-glib

use the internal glib

Create Symbolic Link

Create installed libraries to under "/usr/local" by symbolic link.

Terminal

// /usr/local/bin
# ln -s /usr/local/pkg_config/0_29_2/bin/pkg-config /usr/local/bin/

// /usr/local/share/aclocal
# ln -s /usr/local/pkg_config/0_29_2/share/aclocal/pkg.m4 /usr/local/share/aclocal/

Setting Environment Variable

Setting LD_LIBRARY_PATH and PKG_CONFIG_PATH variables is useful when building or executing other sources.

When copying or creating a symbolic link the library installed under /usr/local, it is recommended to set it.

Terminal

$ vim ~/.bash_profile

.bash_profile

...
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export ACLOCAL_PATH=/usr/local/share/aclocal:$ACLOCAL_PATH
...

Related articles