The Zlib package contains compression and decompression routines used by some programs.
First, fix a typo in the package header file:
sed -i 's/ifdef _LARGEFILE64_SOURCE/ifndef _LARGEFILE64_SOURCE/' zlib.h
Prepare Zlib for compilation:
CFLAGS='-mstackrealign -fPIC -O3' ./configure --prefix=/usr
The meaning of the new configure environment variable:
CFLAGS='-mstackrealign -fPIC -O3'
Setting CFLAGS overrides the default optimization in the package to prevent some run time errors. Note that the -mstackrealign may cause build failures in non-Intel architecture systems.
Compile the package:
To test the results, issue:
Install the package:
The shared library needs to be moved to
/lib, and as a result the
.so file in
/usr/lib will need to be recreated:
mv -v /usr/lib/libz.so.* /lib ln -sfv ../../lib/libz.so.1.2.5 /usr/lib/libz.so