aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Burgess <matthew@linuxfromscratch.org>2005-08-18 20:40:46 +0000
committerMatthew Burgess <matthew@linuxfromscratch.org>2005-08-18 20:40:46 +0000
commitfa8664c1675f5397fc025690d4525e80b31fb7e2 (patch)
tree577a5491caa88e248ca43411cd16bd92a034e5da
parent940e0ab7ced18e75c229409c27c578db95f91fbd (diff)
Simplify finding where GCC's specs and private include dir live
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/gcc4/BOOK@6712 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
-rw-r--r--chapter01/changelog.xml4
-rw-r--r--chapter05/adjusting.xml7
-rw-r--r--chapter06/readjusting.xml4
3 files changed, 10 insertions, 5 deletions
diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml
index bd7ba7f2a..c2a5ba428 100644
--- a/chapter01/changelog.xml
+++ b/chapter01/changelog.xml
@@ -119,6 +119,10 @@ First a summary, then a detailed log.</para>
</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>
diff --git a/chapter05/adjusting.xml b/chapter05/adjusting.xml
index 9bb55031a..4f881a2b9 100644
--- a/chapter05/adjusting.xml
+++ b/chapter05/adjusting.xml
@@ -38,9 +38,10 @@ dynamic linker that GCC will use:</para>
<!-- Ampersands are needed to allow copy and paste -->
-<screen><userinput>SPECFILE=`gcc -print-search-dirs | head -n 1 | awk '{ print $2 "specs" }'` &amp;&amp;
+<screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs &amp;&amp;
gcc -dumpspecs > $SPECFILE &amp;&amp;
-sed -i -e 's@^/lib/ld-linux.so.2@/tools&amp;@g' $SPECFILE &amp;&amp;
+sed 's@^/lib/ld-linux.so.2@/tools&amp;@g' $SPECFILE &gt; tempspecfile &amp;&amp;
+mv -f tempspecfile $SPECFILE &amp;&amp;
unset SPECFILE</userinput></screen>
<para>It is recommended that the above
@@ -66,7 +67,7 @@ GCC's <quote>fixincludes</quote> process, which runs as part of the GCC build.
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" }'` &amp;&amp;
+<screen><userinput>GCC_INCLUDEDIR=`dirname $(gcc -print-libgcc-file-name)`/include &amp;&amp;
find ${GCC_INCLUDEDIR}/* -xtype d -exec rm -rf \{} \; &amp;&amp;
rm -f `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` &amp;&amp;
unset GCC_INCLUDEDIR</userinput></screen>
diff --git a/chapter06/readjusting.xml b/chapter06/readjusting.xml
index 73b07376b..7c11d9333 100644
--- a/chapter06/readjusting.xml
+++ b/chapter06/readjusting.xml
@@ -53,9 +53,9 @@ problem. The above command takes care of this issue.</para>
<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" }'` &amp;&amp;
+<screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs &amp;&amp;
gcc -dumpspecs > $SPECFILE &amp;&amp;
-sed -i -e 's@^/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' $SPECFILE &amp;&amp;
+sed -i 's@^/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' $SPECFILE &amp;&amp;
unset SPECFILE</userinput></screen>
<para>It is a good idea to visually inspect the specs file to verify the intended