<?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-temp-system-coreutils" role="wrap">
  <?dbhtml filename="coreutils.html"?>

  <title>Coreutils-&coreutils-version;</title>

  <indexterm zone="ch-temp-system-coreutils">
    <primary sortas="a-Coreutils">Coreutils</primary>
    <secondary>temporary system</secondary>
  </indexterm>

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

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

    <para os="bs1">Coreutils attempts to use the <command>install</command>
    program it just built to perform the install. This will not work if the
    target architecture is incompatible with the host architecture. The
    following command causes the Makefile to use the host's
    <command>install</command> to perform the install:</para>

<screen os="bs2"><userinput>sed -i "/binPROGRAMS_INSTALL=/s:./ginstall:install:" src/Makefile.in</userinput></screen>

    <para os="ba">Configure can not properly determine how to get free space
    when cross-compiling - as a result, the <command>df</command> program will
    not be built. Add the following entry to <filename>config.cache</filename>
    to correct this:</para>

<screen os="bb"><userinput>echo "fu_cv_sys_stat_statfs2_bsize=yes" &gt; config.cache</userinput></screen>

    <para os="bd">Prepare Coreutils for compilation:</para>

<screen os="be"><userinput>./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --cache-file=config.cache</userinput></screen>

    <para os="m1">When we changed the futimens references, one of the files we
    updated was touch.c. That change means the
    <filename class="directory">man</filename> Makefile will try to
    regenerate the man page for touch, by executing the compiled
    <literal>touch</literal> program. If the target architecture cannot be
    executed by the host system, the build will fail. The following command
    fixes this by giving the man page a newer timestamp than its corresponding
    source file:</para>

<screen os="m2"><userinput>touch man/touch.1</userinput></screen>

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

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

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

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

  </sect2>

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

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

  </sect2>

</sect1>
