Prev Up

libpng


Library for reading and writing PNGs (image format)

Compilation

Needs zlib, whose header and library file location has to be specified.
Download libpng-x.y.zz (the lpng- version has those nasty CR line endings). Unpack the sources, e.g.:
   gunzip -c /d/bio/biodev/libpng-1.2.18.tar.gz | tar -xvf -
   cd libpng-1.2.18

V1.2.xx

Example:
            # AIX 5.3/6.1/7.1 C 8.0/9.0/12.1 
   ./configure --prefix=/tmp/libpng-1.2.50 CC=cc CFLAGS="-O2 -D_THREAD_SAFE -D_LARGE_FILES -I/nfs/bio/local.AIX/53/zlib-1.2.5/include" LDFLAGS="-L/nfs/bio/local.AIX/53/zlib-1.2.5/lib" --enable-static --disable-shared
   make
   make install

V1.4.x

            # AIX 5.3/6.1/7.1, C 8.0/9.0/12.1
   ./configure --prefix=/tmp/libpng-1.4.12 CC=cc CPPFLAGS="-D_LARGE_FILES -D_THREAD_SAFE -I/nfs/local/71/include" CFLAGS="-O2 -D_LARGE_FILES -D_THREAD_SAFE -I/nfs/local/71/include" LDFLAGS="-L/nfs/local/71/lib" --disable-shared

   make clean
   make 
   make install
Note that at least V1.4.7 seems to have some unfortunate name clash jmpbuf:
   "pngread.c", line 1148.33: 1506-022 (S) "__jmpbuf" is not a member of "struct png_struct_def".
   "pngread.c", line 1168.24: 1506-022 (S) "__jmpbuf" is not a member of "struct png_struct_def".
Workaround for now: include <stdlib.h> first in pngread.c, pngwrite.c, pngerror.c.
It looks like V1.4.12 does not have this defect.

V1.5.xx

            # AIX 5.3; 6.1 C 9.0; 7.1 12.1
   ./configure --prefix=/tmp/libpng-1.5.14 CC=cc CFLAGS="-O2 -D_LARGE_FILES -I/nfs/bio/local.AIX/53/zlib-1.2.5/include" LDFLAGS="-L/nfs/bio/local.AIX/53/zlib-1.2.5/lib" --disable-shared
            # other example 
   ./configure --prefix=/tmp/libpng-1.5.14 CC=cc CFLAGS="-O2 -D_LARGE_FILES -I/nfs/local/71/include" LDFLAGS="-L/nfs/local/71/lib" --disable-shared
   make clean
   make 
   make install

Installation/Configuration

libpng and dependent software builds are rather sensitive on the correct configuration. Thus adapt files bin/libpng-config, lib/libpng.la and lib/pkgconfig/* to reflect the current installation.
Moreover, since libpng is known to break compatibility between versions, it may be appropriate to keep different versions to allow older programs relying on libpng still to be build without major modifications.
Last updated: Sat, Jun 29, 2013 10:56:50 PM , M.Kraemer