<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>

<sect1 id="ch-cross-tools-glibc" role="wrap">
  <?dbhtml filename="glibc.html"?>

  <title>Glibc-&glibc-version;</title>

  <indexterm zone="ch-cross-tools-glibc">
    <primary sortas="a-Glibc">Glibc</primary>
    <secondary>cross tools</secondary>
  </indexterm>

  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
  href="../../final-system/common/glibc.xml"
  xpointer="xpointer(//*[@role='package'])"/>

  <sect2 role="installation">
    <title>Installation of Glibc</title>

    <para os="da">It should be noted that compiling Glibc in any way other than
    the method suggested in this book puts the stability of the system at
    risk.</para>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/glibc.xml"
    xpointer="xpointer(//*[@os='e'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/glibc.xml"
    xpointer="xpointer(//*[@os='f'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../../final-system/common/glibc.xml"
    xpointer="xpointer(//*[@os='g'])"/>

<screen os="df"><userinput>BUILD_CC="gcc" CC="${CLFS_TARGET}-gcc" \
    AR="${CLFS_TARGET}-ar" RANLIB="${CLFS_TARGET}-ranlib" \
    ../glibc-&glibc-version;/configure --prefix=/tools \
    --host=${CLFS_TARGET} --build=${CLFS_HOST} \
    --disable-profile --enable-kernel=&glibc-kernel-version; \
    --with-binutils=/cross-tools/bin --with-headers=/tools/include \
    --enable-obsolete-rpc</userinput></screen>

    <variablelist os="dg">
      <title>The meaning of the new configure options:</title>

      <varlistentry os="dg1">
        <term><parameter>BUILD_CC="gcc"</parameter></term>
        <listitem>
          <para>This sets Glibc to use the current compiler on our system. This is
          used to create the tools Glibc uses during its build.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="dg2">
        <term><parameter>CC="${CLFS_TARGET}-gcc"</parameter></term>
        <listitem>
          <para>This forces Glibc to use the GCC compiler that we made for our target
          architecture.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="dg3">
        <term><parameter>AR="${CLFS_TARGET}-ar"</parameter></term>
        <listitem>
          <para>This forces Glibc to use the <command>ar</command> utility
          we made for our target architecture.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="dg4">
        <term><parameter>RANLIB="${CLFS_TARGET}-ranlib"</parameter></term>
        <listitem>
          <para>This forces Glibc to use the <command>ranlib</command> utility
          we made for our target architecture.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="dg5">
        <term><parameter>--disable-profile</parameter></term>
        <listitem>
          <para>This builds the libraries without profiling information.
          Omit this option if profiling on the temporary tools is necessary.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="dg6">
        <term><parameter>--enable-kernel=&glibc-kernel-version;</parameter></term>
        <listitem>
          <para>This tells Glibc to compile the library with support
          for &glibc-kernel-version; and later Linux kernels.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="dg7">
        <term><parameter>--with-binutils=/cross-tools/bin</parameter></term>
        <listitem>
          <para>This tells Glibc to use the Binutils that are specific to
          our target architecture.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="dg8">
        <term><parameter>--with-headers=/tools/include</parameter></term>
        <listitem>
          <para>This tells Glibc to compile itself against the headers
          recently installed to the <filename class="directory">/tools</filename>
          directory, so that it knows exactly what features the kernel has
          and can optimize itself accordingly.</para>
        </listitem>
      </varlistentry>

      <varlistentry os="dg9">
        <term><parameter>--enable-obsolete-rpc</parameter></term>
        <listitem>
          <para>This tells Glibc to install rpc headers that are not installed
          by default but may be needed by other packages.</para>
        </listitem>
      </varlistentry>

    </variablelist>

    <para os="dh">During this stage the following warning might appear:</para>

<blockquote os="di"><screen><computeroutput>configure: WARNING:
*** These auxiliary programs are missing or
*** incompatible versions: msgfmt
*** some features will be disabled.
*** Check the INSTALL file for required versions.</computeroutput></screen></blockquote>

    <para os="dj">The missing or incompatible <command>msgfmt</command> program is
    generally harmless. This <command>msgfmt</command> program is part of the
    Gettext package which the host distribution should provide. You might also
    see a similar (also harmless) message about missing
    <command>autoconf</command>.</para>

    <para os="dk">Compile the package:</para>

<screen os="dl"><userinput>make</userinput></screen>

    <para os="dm">Install the package:</para>

<screen os="dn"><userinput>make install</userinput></screen>

  </sect2>

  <sect2 role="content">
    <title/>

    <para>Details on this package are located in <xref
    linkend="contents-glibc" role="."/></para>

  </sect2>

</sect1>
