Ignore:
Timestamp:
Feb 21, 2006, 2:06:53 AM (19 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
bcbd90b
Parents:
f013de9
Message:

r1041@server (orig r1039): jim | 2006-01-11 17:12:52 -0800

r1346@server: jim | 2006-01-11 17:10:51 -0800
Updated zlib to build shared and static at the same time. Recommendation by Tushar Teredesai


File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOOK/final-system/common/zlib.xml

    rf013de9 r27178ae  
    3434    <title>Installation of Zlib</title>
    3535
    36     <note os="a">
    37       <para>Zlib is known to build its shared library incorrectly if
    38       <envar>CFLAGS</envar> is specified in the environment. If using a
    39       specified <envar>CFLAGS</envar> variable, be sure to add the
    40       <option>-fPIC</option> directive to the <envar>CFLAGS</envar>
    41       variable for the duration of the configure command below, then
    42       remove it afterwards.</para>
    43     </note>
     36    <para os="p1">This patch will add -fPIC to our build and allow us to build
     37    a static and shared library at the same time:</para>
    4438
    45     <para os="b">Prepare Zlib for compilation:</para>
     39<screen os="p2"><userinput>patch -Np1 -i ../&zlib-fpic-patch;</userinput></screen>
    4640
    47 <screen os="c"><userinput>./configure --prefix=/usr --shared --libdir=/lib</userinput></screen>
     41    <para os="a">Prepare Zlib for compilation:</para>
    4842
    49     <para os="d">Compile the package:</para>
     43<screen os="b"><userinput>./configure --prefix=/usr --shared</userinput></screen>
    5044
    51 <screen os="e"><userinput>make</userinput></screen>
     45    <para os="c">Compile the package:</para>
    5246
    53     <para os="f">To test the results, issue:
     47<screen os="d"><userinput>make</userinput></screen>
     48
     49    <para os="e">To test the results, issue:
    5450    <userinput>make check</userinput>.</para>
    5551
    56     <para os="g">Install the shared library:</para>
     52    <para os="f">Installation:</para>
    5753
    58 <screen os="h"><userinput>make install</userinput></screen>
     54<screen os="g"><userinput>make install</userinput></screen>
    5955
    60     <para os="i">The previous command installed a <filename
     56    <para os="h">The previous command installed a <filename
    6157    class="extension">.so</filename> file in <filename
    62     class="directory">/lib</filename>. We will remove it and relink it into
    63     <filename class="directory">/usr/lib</filename>:</para>
     58    class="directory">/usr/lib</filename>. We will remove itinto
     59    <filename class="directory">/lib</filename> and then relink it
     60    to <filename class="directory">/usr/lib</filename>:</para>
    6461
    65 <screen os="j"><userinput>rm /lib/libz.so
    66 ln -sf ../../lib/libz.so.&zlib-version; /usr/lib/libz.so</userinput></screen>
     62<screen os="i"><userinput>mv /usr/lib/libz.so.*
     63ln -sf ../../lib/libz.so.1 /usr/lib/libz.so</userinput></screen>
    6764
    68     <para os="k">Build the static library:</para>
     65    <para os="j">Now we fix the permissions on the static library:</para>
    6966
    70 <screen os="l"><userinput>make clean
    71 ./configure --prefix=/usr
    72 make</userinput></screen>
    73 
    74     <para os="m">To test the results again, issue:
    75     <userinput>make check</userinput>.</para>
    76 
    77     <para os="n">Install the static library:</para>
    78 
    79 <screen os="o"><userinput>make install</userinput></screen>
    80 
    81     <para os="p">Fix the permissions on the static library:</para>
    82 
    83 <screen os="q"><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
     67<screen os="k"><userinput>chmod 644 /usr/lib/libz.a</userinput></screen>
    8468
    8569  </sect2>
Note: See TracChangeset for help on using the changeset viewer.