variables.html

来自「CLFS(Cross-Compiled Linux From Scratch)的」· HTML 代码 · 共 178 行

HTML
178
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">  <head>    <meta http-equiv="Content-Type" content=    "application/xhtml+xml; charset=iso-8859-1" />    <title>      5.3.&nbsp;Build Variables    </title>    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />    <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" />    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=    "text/css" media="print" />  </head>  <body id="lfs" class="CLFS-SVN-20060417-x86">    <div class="navheader">      <div class="headertitles">        <h4>          Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-x86        </h4>        <h3>          Chapter&nbsp;5.&nbsp;Constructing Cross-Compile Tools        </h3>      </div>      <ul class="headerlinks">        <li class="prev">          <a accesskey="p" href="cflags.html" title="Build CFLAGS">Prev</a>          <p>            Build CFLAGS          </p>        </li>        <li class="next">          <a accesskey="n" href="linux-libc-headers.html" title=          "Linux-Libc-Headers-2.6.12.0">Next</a>          <p>            Linux-Libc-Headers-2.6.12.0          </p>        </li>        <li class="up">          <a accesskey="u" href="chapter.html" title=          "Chapter&nbsp;5.&nbsp;Constructing Cross-Compile Tools">Up</a>.        </li>        <li class="home">          <a accesskey="h" href="../index.html" title=          "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-x86">          Home</a>        </li>      </ul>    </div>    <div class="sect1" lang="en" xml:lang="en">      <div class="titlepage">        <h1 class="sect1">          5.3. Build Variables        </h1>      </div>      <h4>        <a id="id3637248" name="id3637248"></a>Setting Host and Target      </h4>      <p>        During the building of the cross-compile tools you will need to set a        few variables that will be dependent on your particular needs. The        first variable will be the triplet of the <tt class="envar">HOST</tt>        machine. You will need to set the <tt class="envar">CHOST</tt>        triplet to match your particular needs. To set this information you        can issue the following command:      </p>      <pre class="userinput"><kbd class="command">export LFS_HOST="`echo ${MACHTYPE} | sed -e 's/unknown/cross/g' -e 's/-pc-/-cross-/g'`"</kbd></pre>      <p>        Now you will need to set the target triplet for the target        architecture. You can do this by running the same command as above,        just running it on the target machine. If you can't run the command        on the target machine, you can use the table at the bottom of this        page. Set the command using the method listed below:      </p>      <pre class="userinput"><kbd class="command">export LFS_TARGET="{target triplet}"</kbd></pre>      <h4>        <a id="id3637417" name="id3637417"></a>Copy settings to Environment      </h4>      <p>        Now we will add these to <tt class="filename">~/.bashrc</tt>, just in        case you have to exit and restart building later:      </p>      <pre class="userinput"><kbd class="command">echo export LFS_HOST=\""${LFS_HOST}\"" &gt;&gt; ~/.bashrcecho export LFS_TARGET=\""${LFS_TARGET}\"" &gt;&gt; ~/.bashrc</kbd></pre>      <div class="table">        <a id="id3637328" name="id3637328"></a>        <p class="title">          <b>Table&nbsp;5.1.&nbsp;Processor Type and Target Triplets</b>        </p>        <table summary="Processor Type and Target Triplets" border="1">          <colgroup>            <col align="center" />            <col align="center" />          </colgroup>          <thead>            <tr>              <th align="center">                Processor              </th>              <th align="center">                Target Triplet              </th>            </tr>          </thead>          <tbody>            <tr>              <td align="center">                486 Compatibles              </td>              <td align="center">                i486-pc-linux-gnu              </td>            </tr>            <tr>              <td align="center">                Pentium, K6, 586 Compatibles              </td>              <td align="center">                i586-pc-linux-gnu              </td>            </tr>            <tr>              <td align="center">                Pentium II, Pentium III, Pentium 4              </td>              <td align="center">                i686-pc-linux-gnu              </td>            </tr>            <tr>              <td align="center">                Athlon, Duron              </td>              <td align="center">                i686-pc-linux-gnu              </td>            </tr>          </tbody>        </table>      </div>    </div>    <div class="navfooter">      <ul>        <li class="prev">          <a accesskey="p" href="cflags.html" title="Build CFLAGS">Prev</a>          <p>            Build CFLAGS          </p>        </li>        <li class="next">          <a accesskey="n" href="linux-libc-headers.html" title=          "Linux-Libc-Headers-2.6.12.0">Next</a>          <p>            Linux-Libc-Headers-2.6.12.0          </p>        </li>        <li class="up">          <a accesskey="u" href="chapter.html" title=          "Chapter&nbsp;5.&nbsp;Constructing Cross-Compile Tools">Up</a>.        </li>        <li class="home">          <a accesskey="h" href="../index.html" title=          "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-x86">          Home</a>.        </li>      </ul>    </div>  </body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?