source: chapter06/zlib.xml@ c5538b3

Last change on this file since c5538b3 was a8f36125, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • (all) Removed all references to the DocBook DTD
  • (docbook.rng) Added the DocBook "Gin" schema
  • (Makefile) Updated with new validation command
  • (prologue/*) Validation fixes

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/LFS-RNG/BOOK@4329 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 3.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-zlib" xreflabel="Zlib" role="wrap">
7<title>Zlib-&zlib-version;</title>
8<?dbhtml filename="zlib.html"?>
9
10<indexterm zone="ch-system-zlib"><primary sortas="a-Zlib">Zlib</primary></indexterm>
11
12<sect2 role="package"><title/>
13<para>The Zlib package contains compression and un-compression routines used by
14some programs.</para>
15
16<segmentedlist>
17<segtitle>&buildtime;</segtitle>
18<segtitle>&diskspace;</segtitle>
19<seglistitem><seg>0.1 SBU</seg><seg>1.5 MB</seg></seglistitem>
20</segmentedlist>
21
22<segmentedlist>
23<segtitle>Zlib installation depends on</segtitle>
24<seglistitem><seg>Binutils, Coreutils, GCC, Glibc, Make, Sed</seg></seglistitem>
25</segmentedlist>
26</sect2>
27
28<sect2 role="installation">
29<title>Installation of Zlib</title>
30
31<note><para>Zlib is known to build its shared library incorrectly if CFLAGS is
32specified in the environment. If you are using your own CFLAGS variable, be
33sure to add the <parameter>-fPIC</parameter> directive to your CFLAGS for the
34duration of the below <command>configure</command> command, then remove it
35afterwards.</para></note>
36
37<para>Prepare Zlib for compilation:</para>
38
39<screen><userinput>./configure --prefix=/usr --shared</userinput></screen>
40
41<para>Compile the package:</para>
42
43<screen><userinput>make</userinput></screen>
44
45<para>To test the results, issue:
46<userinput>make check</userinput>.</para>
47
48<para>Install the shared library:</para>
49
50<screen><userinput>make install</userinput></screen>
51
52<para>Now also build the non-shared (static) library:</para>
53
54<screen><userinput>make clean
55./configure --prefix=/usr
56make</userinput></screen>
57
58<para>To again test the results, issue:
59<userinput>make check</userinput>.</para>
60
61<para>Install the static library:</para>
62
63<screen><userinput>make install</userinput></screen>
64
65<para>And fix the permissions on the static library:</para>
66
67<screen><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
68
69<para>It is good policy and common practice to place important libraries into
70the <filename class="directory">/lib</filename> directory. This matters most
71in scenarios where <filename class="directory">/usr</filename> is on a
72separate partition. Essentially, the run-time components of any libraries that
73are used by programs in <filename class="directory">/bin</filename> or
74<filename class="directory">/sbin</filename> should reside in
75<filename class="directory">/lib</filename> so that they are on the root
76partition and available in the event of
77<filename class="directory">/usr</filename> being inaccessible.</para>
78
79<para>For the above reason we move the run-time components of the shared Zlib
80into <filename class="directory">/lib</filename>:</para>
81
82<screen><userinput>mv /usr/lib/libz.so.* /lib</userinput></screen>
83
84<para>Now we need to fix the <filename class="symlink">/usr/lib/libz.so</filename> symlink
85because we just moved the file it points to:</para>
86
87<screen><userinput>ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
88
89</sect2>
90
91
92<sect2 id="contents-zlib" role="content"><title>Contents of Zlib</title>
93
94<segmentedlist>
95<segtitle>Installed libraries</segtitle>
96<seglistitem><seg>libz[a,so]</seg></seglistitem>
97</segmentedlist>
98
99<variablelist><title>Short description</title>
100
101<varlistentry id="libz">
102<term><filename class="libraryfile">libz*</filename></term>
103<listitem>
104<indexterm zone="ch-system-zlib libz"><primary sortas="c-libz*">libz*</primary></indexterm>
105<para>contains compression and un-compression
106functions used by some programs.</para>
107</listitem>
108</varlistentry>
109</variablelist>
110
111</sect2>
112
113</sect1>
Note: See TracBrowser for help on using the repository browser.