We are living as nomad in Mexico !!

Install pkg-config

You can see the following
  • Want to install pkg-config

Table of contents


Install pkg-config

configure option

--prefix The installation path
--with-internal-glib Use internal glib

For CentOS / Ubuntu / MacOS

※ When installing version 0.29.2

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

Create Symbolic Link

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

※ When installing version 0.29.2

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

// /usr/local/share/aclocal
> sudo mkdir -p /usr/local/share/aclocal
> sudo ln -s /usr/local/pkg_config/0_29_2/share/aclocal/pkg.m4 /usr/local/share/aclocal/

Set 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.

> vim ~/.bash_profile

※ For CentOS / Ubuntu

export ACLOCAL_PATH=/usr/local/share/aclocal/:$ACLOCAL_PATH

🌟The author of this article is:🌟

Kakeru profile

Kakeru Sato

Software Developer

Full stack engineer