Before starting: Make sure you have the necessary folders and permissions — get more information.

Links: Homepage
Dependencies: None
Version: 1.6.32

LibPNG is the official PNG reference library.

Get the Code

Switch to /usr/local/src and download the source package.

cd /usr/local/src
curl --remote-name --location

Extract the archive and move into the folder.

tar -xzvf libpng-VERSION.tar.gz
cd libpng-VERSION

Compile and Install

Configure, compile and install into /usr/local/mac-dev-env/libpng-VERSION.

./configure --prefix=/usr/local/mac-dev-env/libpng-VERSION
make install

Create a symbolic link to /usr/local/libpng.

ln -s mac-dev-env/libpng-VERSION /usr/local/libpng