Building zlib 1.2.3
Building a Web Server, for Linux
Requirements
None
Download
- Package(linux source): zlib-1.2.3.tar.bz2
- Unpack with command...
tar -xjf zlib-1.2.3.tar.bz2
Our Configuration
- Install to : /usr/local
- Module types : dynamically and staticly loaded modules, *.so and *.a
Configuration Options
Displays a list of configuration options...
.../zlib-1.2.3]# ./configure -h
Build Instructions
Note that zlib library files are placed into /usr/local/lib and zlib header files are placed into /usr/local/include, by default.
Build Shared (and static) Libraries
.../zlib-1.2.3]# make clean.../zlib-1.2.3]# ./configure --shared.../zlib-1.2.3]# make test.../zlib-1.2.3]# make install
Extra Files
.../zlib-1.2.3]# cp zutil.h /usr/local/include.../zlib-1.2.3]# cp zutil.c /usr/local/include
[sanity check] Libs and Headers
/usr/local/lib should now contain...
- libz.a
- libz.so -> libz.so.1.2.3
- libz.so.1 -> libz.so.1.2.3
- libz.so.1.2.3
/usr/local/include should now contain...
- zconf.h
- zlib.h
- zutil.h
[Optional] Instructions for non-standard placement of zlib
Create the directory that will contain zlib...
.../zlib-1.2.3]# mkdir /usr/local/zlib
Follow the given procedure above, except...
.../zlib-1.2.3]# ./configure --prefix=/usr/local/zlib
Update the Run-Time Linker
/etc/ld.so.cache will need to be updated with the new zlib shared lib: libz.so.1.2.3
For standard zlib installation...
- Add
/usr/local/libto /etc/ld.so.conf, if specified path is not present /etc]# ldconfig
If zlib was installed with a prefix...
- Add
/usr/local/zlib/libto /etc/ld.so.conf /etc]# ldconfig

