r6712 - in branches/gcc4/BOOK: chapter01 chapter05 chapter06

matthew at linuxfromscratch.org matthew at linuxfromscratch.org
Thu Aug 18 13:40:47 PDT 2005


Author: matthew
Date: 2005-08-18 14:40:46 -0600 (Thu, 18 Aug 2005)
New Revision: 6712

Modified:
   branches/gcc4/BOOK/chapter01/changelog.xml
   branches/gcc4/BOOK/chapter05/adjusting.xml
   branches/gcc4/BOOK/chapter06/readjusting.xml
Log:
Simplify finding where GCC's specs and private include dir live

Modified: branches/gcc4/BOOK/chapter01/changelog.xml
===================================================================
--- branches/gcc4/BOOK/chapter01/changelog.xml	2005-08-18 20:18:30 UTC (rev 6711)
+++ branches/gcc4/BOOK/chapter01/changelog.xml	2005-08-18 20:40:46 UTC (rev 6712)
@@ -119,6 +119,10 @@
 </itemizedlist>
 </listitem>
 
+<listitem><para>August 18th, 2005 [matt]: Simplify the method for finding where
+GCC's default specs file and private include directory live.  Additionally,
+don't assume the host's sed supports the -i switch.</para></listitem>
+
 <listitem><para>August 18th, 2005 [ken]: Add a patch to sanitise bzgrep's
 handling of filenames.</para></listitem>
 

Modified: branches/gcc4/BOOK/chapter05/adjusting.xml
===================================================================
--- branches/gcc4/BOOK/chapter05/adjusting.xml	2005-08-18 20:18:30 UTC (rev 6711)
+++ branches/gcc4/BOOK/chapter05/adjusting.xml	2005-08-18 20:40:46 UTC (rev 6712)
@@ -38,9 +38,10 @@
 
 <!-- Ampersands are needed to allow copy and paste -->
 
-<screen><userinput>SPECFILE=`gcc -print-search-dirs | head -n 1 | awk '{ print $2 "specs" }'` &&
+<screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs &&
 gcc -dumpspecs > $SPECFILE &&
-sed -i -e 's@^/lib/ld-linux.so.2@/tools&@g' $SPECFILE &&
+sed 's@^/lib/ld-linux.so.2@/tools&@g' $SPECFILE > tempspecfile &&
+mv -f tempspecfile $SPECFILE &&
 unset SPECFILE</userinput></screen>
 
 <para>It is recommended that the above
@@ -66,7 +67,7 @@
 This is explained in more detail later in this chapter. Run the following commands to remove those header files (you may find it easier to copy and paste these commands, rather than typing them by hand, due to their length):</para>
 
 <!-- && used to ease copy and pasting -->
-<screen><userinput>GCC_INCLUDEDIR=`gcc -print-search-dirs | head -n 1 | awk '{ print $2 "include" }'` &&
+<screen><userinput>GCC_INCLUDEDIR=`dirname $(gcc -print-libgcc-file-name)`/include &&
 find ${GCC_INCLUDEDIR}/* -xtype d -exec rm -rf \{} \; &&
 rm -f `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` &&
 unset GCC_INCLUDEDIR</userinput></screen>

Modified: branches/gcc4/BOOK/chapter06/readjusting.xml
===================================================================
--- branches/gcc4/BOOK/chapter06/readjusting.xml	2005-08-18 20:18:30 UTC (rev 6711)
+++ branches/gcc4/BOOK/chapter06/readjusting.xml	2005-08-18 20:40:46 UTC (rev 6712)
@@ -53,9 +53,9 @@
 <para>Next, amend the GCC specs file so that it points to the new
 dynamic linker. A <command>sed</command> command accomplishes this:</para>
 
-<screen><userinput>SPECFILE=`gcc -print-search-dirs | head -n 1 | awk '{ print $2 "specs" }'` &&
+<screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs &&
 gcc -dumpspecs > $SPECFILE &&
-sed -i -e 's@^/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2 at g' $SPECFILE &&
+sed -i 's@^/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2 at g' $SPECFILE &&
 unset SPECFILE</userinput></screen>
 
 <para>It is a good idea to visually inspect the specs file to verify the intended 




More information about the lfs-book mailing list