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

<sect1 id="ch-cross-tools-shadow">
  <?dbhtml filename="shadow.html"?>

  <title>Shadow-&shadow-version; - Native</title>

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

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

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

    <para>The following patch changes the hard-coded <filename>/etc</filename>
    in the sources to whatever was passed to configure. It also allows the
    utilities to run as a user other then root:</para>

<screen><userinput>patch -Np1 -i ../&shadow-sysroot_hacks-patch;</userinput></screen>

    <para>The following value is added to <filename>config.cache</filename> to
    make sure that the <filename>passwd</filename> program is found:</para>

<screen><userinput>echo "shadow_cv_passwd_dir=${CLFS}/bin" &gt; config.cache</userinput></screen>

    <para>The following value causes Shadow to use its internal lckpwdf
    instead of the one provided by Glibc. The one provided by Glibc will
    attempt to modify the host system:</para>

<screen><userinput>echo "ac_cv_func_lckpwdf=no" &gt;&gt; config.cache</userinput></screen>

    <para>Prepare Shadow for compilation:</para>

<screen><userinput>./configure --prefix=${CLFS}/cross-tools --sbindir=${CLFS}/cross-tools/bin \
    --sysconfdir=$CLFS/etc --disable-shared --without-libpam --without-audit \
    --without-selinux --program-prefix=${CLFS_TARGET}- --cache-file=config.cache</userinput></screen>

    <para>Add the proper prefix to the <filename>passwd</filename> program:</para>

<screen><userinput>cp config.h{,.orig}
sed "/PASSWD_PROGRAM/s/passwd/${CLFS_TARGET}-&amp;/" config.h.orig > config.h</userinput></screen>

    <para>Compile the package:</para>

<screen><userinput>make</userinput></screen>

    <para>Install the package:</para>

<screen><userinput>make install</userinput></screen>

    <note>
      <para>The tools built on this page will be used later in this book.</para>
    </note>

  </sect2>

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

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

  </sect2>

</sect1>
