Browse Source

remove unneeded static libraries

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@12122 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Xi Ruoyao 4 years ago
parent
commit
cd152f2277

+ 5 - 1
chapter08/binutils.xml

@@ -163,6 +163,10 @@ cd       build</userinput></screen>
 
 
 <screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
 <screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
 
 
+    <para>Remove useless static libraries:</para>
+
+<screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a</userinput></screen>
+
   </sect2>
   </sect2>
 
 
   <sect2 id="contents-binutils" role="content">
   <sect2 id="contents-binutils" role="content">
@@ -176,7 +180,7 @@ cd       build</userinput></screen>
       <seglistitem>
       <seglistitem>
         <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, ld, ld.bfd, ld.gold, nm,
         <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, ld, ld.bfd, ld.gold, nm,
         objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
         objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
-        <seg>libbfd.{a,so}, libctf.{a,so}, libctf-nobfd.{a,so}, and libopcodes.{a,so}</seg>
+        <seg>libbfd.so, libctf.so, libctf-nobfd.so, and libopcodes.so</seg>
         <seg>/usr/lib/ldscripts</seg>
         <seg>/usr/lib/ldscripts</seg>
       </seglistitem>
       </seglistitem>
     </segmentedlist>
     </segmentedlist>

+ 5 - 1
chapter08/bzip2.xml

@@ -95,6 +95,10 @@ rm -v /usr/bin/{bunzip2,bzcat,bzip2}
 ln -sv bzip2 /bin/bunzip2
 ln -sv bzip2 /bin/bunzip2
 ln -sv bzip2 /bin/bzcat</userinput></screen>
 ln -sv bzip2 /bin/bzcat</userinput></screen>
 
 
+    <para>Remove an useless static library:</para>
+
+<screen><userinput remap="install">rm -fv /usr/lib/libz.a</userinput></screen>
+
   </sect2>
   </sect2>
 
 
   <sect2 id="contents-bzip2" role="content">
   <sect2 id="contents-bzip2" role="content">
@@ -109,7 +113,7 @@ ln -sv bzip2 /bin/bzcat</userinput></screen>
         <seg>bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp (link to
         <seg>bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp (link to
         bzdiff), bzdiff, bzegrep (link to bzgrep), bzfgrep (link to bzgrep),
         bzdiff), bzdiff, bzegrep (link to bzgrep), bzfgrep (link to bzgrep),
         bzgrep, bzip2, bzip2recover, bzless (link to bzmore), and bzmore</seg>
         bzgrep, bzip2, bzip2recover, bzless (link to bzmore), and bzmore</seg>
-        <seg>libbz2.{a,so}</seg>
+        <seg>libbz2.so</seg>
         <seg>/usr/share/doc/bzip2-&bzip2-version;</seg>
         <seg>/usr/share/doc/bzip2-&bzip2-version;</seg>
       </seglistitem>
       </seglistitem>
     </segmentedlist>
     </segmentedlist>

+ 2 - 3
chapter08/e2fsprogs.xml

@@ -122,10 +122,9 @@ cd       build</userinput></screen>
 
 
 <screen><userinput remap="install">make install</userinput></screen>
 <screen><userinput remap="install">make install</userinput></screen>
 
 
-    <para>Make the installed static libraries writable so debugging symbols can
-    be removed later:</para>
+    <para>Remove useless static libraries:</para>
 
 
-<screen><userinput remap="install">chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a</userinput></screen>
+<screen><userinput remap="install">rm -fv /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a</userinput></screen>
 
 
     <para>This package installs a gzipped
     <para>This package installs a gzipped
     <filename class="extension">.info</filename> file but doesn't update the
     <filename class="extension">.info</filename> file but doesn't update the

+ 3 - 2
chapter08/flex.xml

@@ -53,8 +53,9 @@
 
 
     <para>Prepare Flex for compilation:</para>
     <para>Prepare Flex for compilation:</para>
 
 
-<!-- <screen><userinput remap="configure">HELP2MAN=/tools/bin/true \ -->
-<screen><userinput remap="configure">./configure --prefix=/usr --docdir=/usr/share/doc/flex-&flex-version;</userinput></screen>
+<screen><userinput remap="configure">./configure --prefix=/usr \
+            --docdir=/usr/share/doc/flex-&flex-version; \
+            --disable-static</userinput></screen>
 
 
     <para>Compile the package:</para>
     <para>Compile the package:</para>
 
 

+ 7 - 0
chapter08/libtool.xml

@@ -68,6 +68,13 @@
 
 
 <screen><userinput remap="install">make install</userinput></screen>
 <screen><userinput remap="install">make install</userinput></screen>
 
 
+    <!-- dev: - -disable-static works but causes additional test failures
+              so we manually remove the static library -->
+
+    <para>Remove an useless static library:</para>
+
+<screen><userinput remap="install">rm -fv /usr/lib/libltdl.a</userinput></screen>
+
   </sect2>
   </sect2>
 
 
 
 

+ 4 - 5
chapter08/ncurses.xml

@@ -41,10 +41,6 @@
   <sect2 role="installation">
   <sect2 role="installation">
     <title>Installation of Ncurses</title>
     <title>Installation of Ncurses</title>
 
 
-    <para>Don't install a static library that is not handled by configure:</para>
-
-<screen><userinput remap="pre">sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in</userinput></screen>
-
     <para>Prepare Ncurses for compilation:</para>
     <para>Prepare Ncurses for compilation:</para>
 
 
 <screen><userinput remap="configure">./configure --prefix=/usr           \
 <screen><userinput remap="configure">./configure --prefix=/usr           \
@@ -133,6 +129,10 @@ done</userinput></screen>
 echo "INPUT(-lncursesw)" &gt; /usr/lib/libcursesw.so
 echo "INPUT(-lncursesw)" &gt; /usr/lib/libcursesw.so
 ln -sfv libncurses.so      /usr/lib/libcurses.so</userinput></screen>
 ln -sfv libncurses.so      /usr/lib/libcurses.so</userinput></screen>
 
 
+    <para>Remove a static library that is not handled by configure:</para>
+
+<screen><userinput remap="install">rm -fv /usr/lib/libncurses++w.a</userinput></screen>
+
     <para>If desired, install the Ncurses documentation:</para>
     <para>If desired, install the Ncurses documentation:</para>
 
 
 <screen><userinput remap="install">mkdir -v       /usr/share/doc/ncurses-&ncurses-version;
 <screen><userinput remap="install">mkdir -v       /usr/share/doc/ncurses-&ncurses-version;
@@ -188,7 +188,6 @@ cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
            libformw.so, 
            libformw.so, 
            libmenuw.so, 
            libmenuw.so, 
            libncursesw.so,
            libncursesw.so,
-           libncurses++w.a,
            libpanelw.so, and their non-wide-character counterparts without "w"
            libpanelw.so, and their non-wide-character counterparts without "w"
               in the library names.</seg>
               in the library names.</seg>
         <seg>
         <seg>

+ 0 - 13
chapter08/revisedchroot.xml

@@ -36,19 +36,6 @@ chroot "$LFS" /usr/bin/env -i          \
   linkend="ch-tools-bindmount"/> and <xref
   linkend="ch-tools-bindmount"/> and <xref
   linkend="ch-tools-kernfsmount"/>.</para>
   linkend="ch-tools-kernfsmount"/>.</para>
 
 
-  <para>There were several static libraries that were not suppressed earlier
-  in the chapter in order to satisfy the regression tests in several packages. These 
-  libraries are from binutils, bzip2, e2fsprogs, flex, libtool, and zlib.  If desired,
-  remove them now:</para>
-
-<screen><userinput>rm -f /usr/lib/lib{bfd,opcodes}.a
-rm -f /usr/lib/libctf{,-nobfd}.a
-rm -f /usr/lib/libbz2.a
-rm -f /usr/lib/lib{com_err,e2p,ext2fs,ss}.a
-rm -f /usr/lib/libltdl.a
-rm -f /usr/lib/libfl.a
-rm -f /usr/lib/libz.a</userinput></screen>
-
   <para>There are also several files installed in the /usr/lib and /usr/libexec
   <para>There are also several files installed in the /usr/lib and /usr/libexec
   directories with a file name extension of .la. These are "libtool archive"
   directories with a file name extension of .la. These are "libtool archive"
   files. As already said, they are only useful when linking with static
   files. As already said, they are only useful when linking with static

+ 5 - 1
chapter08/zlib.xml

@@ -65,6 +65,10 @@
 <screen><userinput remap="install">mv -v /usr/lib/libz.so.* /lib
 <screen><userinput remap="install">mv -v /usr/lib/libz.so.* /lib
 ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so</userinput></screen>
 ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so</userinput></screen>
 
 
+    <para>Remove an useless static library:</para>
+
+<screen><userinput remap="install">rm -fv /usr/lib/libz.a</userinput></screen>
+
   </sect2>
   </sect2>
 
 
   <sect2 id="contents-zlib" role="content">
   <sect2 id="contents-zlib" role="content">
@@ -74,7 +78,7 @@ ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so</userinput></scr
       <segtitle>Installed libraries</segtitle>
       <segtitle>Installed libraries</segtitle>
 
 
       <seglistitem>
       <seglistitem>
-        <seg>libz.{a,so}</seg>
+        <seg>libz.so</seg>
       </seglistitem>
       </seglistitem>
     </segmentedlist>
     </segmentedlist>