8.4. Zlib-1.2.8

The Zlib package contains compression and decompression routines used by some programs.

8.4.1. Installation of Zlib

Prepare Zlib for compilation and set to optimize for size:

CFLAGS="-Os" ./configure --shared

The meaning of the configure options:


Tells Zlib to build its shared library.

Compile the package:


Install the package into the cross-tools:

make prefix=${CLFS}/cross-tools/${CLFS_TARGET} install

Copy only the shared library into the target file system and ensure that its symlink is present so the runtime loader can find it:

cp -v ${CLFS}/cross-tools/${CLFS_TARGET}/lib/libz.so.1.2.8 ${CLFS}/targetfs/lib/
ln -sv libz.so.1.2.8 ${CLFS}/targetfs/lib/libz.so.1

8.4.2. Contents of Zlib

Installed libraries: libz.[a,so]

Short Descriptions


Contains compression and decompression functions used by some programs