|
@@ -47,17 +47,12 @@
|
|
|
a specified <envar>CFLAGS</envar> variable, be sure to add the
|
|
|
<parameter>-fPIC</parameter> directive to the <envar>CFLAGS</envar>
|
|
|
variable for the duration of the configure command below, then
|
|
|
- remove it afterwards.</para>
|
|
|
+ remove it when building the static library.</para>
|
|
|
</note>
|
|
|
|
|
|
- <para>Modify the build scripts to ensure compilation with position independent
|
|
|
- code and allow building both static and dynamic libraries in one step:</para>
|
|
|
+ <para>Prepare Zlib for building the dynamic library:</para>
|
|
|
|
|
|
-<screen><userinput remap="configure">patch -Np1 -i ../&zlib-fpic-patch;</userinput></screen>
|
|
|
-
|
|
|
- <para>Prepare Zlib for compilation:</para>
|
|
|
-
|
|
|
-<screen><userinput remap="configure">./configure --prefix=/usr --shared</userinput></screen>
|
|
|
+<screen><userinput remap="configure">./configure --prefix=/usr --shared --libdir=/lib</userinput></screen>
|
|
|
|
|
|
<para>Compile the package:</para>
|
|
|
|
|
@@ -67,13 +62,35 @@
|
|
|
|
|
|
<screen><userinput remap="test">make check</userinput></screen>
|
|
|
|
|
|
- <para>Install the libraries:</para>
|
|
|
+ <para>Install the shared library:</para>
|
|
|
+
|
|
|
+<screen><userinput remap="install">make install</userinput></screen>
|
|
|
+
|
|
|
+ <para>The previous command installed a <filename
|
|
|
+ class="extension">.so</filename> file in <filename
|
|
|
+ class="directory">/lib</filename>. We will remove it and relink it into
|
|
|
+ <filename class="directory">/usr/lib</filename>:</para>
|
|
|
+
|
|
|
+<screen><userinput remap="install">rm -v /lib/libz.so
|
|
|
+ln -sfv ../../lib/libz.so.&zlib-version; /usr/lib/libz.so</userinput></screen>
|
|
|
+
|
|
|
+ <para>Build the static library:</para>
|
|
|
+
|
|
|
+<screen><userinput remap="make">make clean
|
|
|
+./configure --prefix=/usr
|
|
|
+make</userinput></screen>
|
|
|
+
|
|
|
+ <para>To test the results again, issue:</para>
|
|
|
+
|
|
|
+<screen><userinput remap="test">make check</userinput></screen>
|
|
|
+
|
|
|
+ <para>Install the static library:</para>
|
|
|
|
|
|
<screen><userinput remap="install">make install</userinput></screen>
|
|
|
|
|
|
- <para>Finally, fix permissions on the static library:</para>
|
|
|
+ <para>Fix the permissions on the static library:</para>
|
|
|
|
|
|
-<screen><userinput remap="install">chmod 0644 /usr/lib/libz.a</userinput></screen>
|
|
|
+<screen><userinput remap="install">chmod -v 644 /usr/lib/libz.a</userinput></screen>
|
|
|
|
|
|
</sect2>
|
|
|
|