<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE c:package [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>

<c:package xmlns:c="http://schema.cross-lfs.org/book"
           xmlns:xi="http://www.w3.org/2001/XInclude"
           id="ch-temp-system-bash" c:multibuild="false">

  <c:title>Bash</c:title>
  <c:version>&bash-version;</c:version>
  <c:variant>temporary system</c:variant>

  <xi:include href="../../final-system/common/bash.xml"
    xpointer="xmlns(co=http://schema.cross-lfs.org/book)
              xpointer(/co:package/co:description[1])" />

  <c:install>

    <xi:include href="../../final-system/common/bash.xml"
      xpointer="xmlns(co=http://schema.cross-lfs.org/book)
                xpointer(/co:package/co:install/*[@co:r='p-bu'])" />

    <c:para>When Bash is cross-compiled, it cannot test for the presence
    of named pipes, among other things. If you used <c:command>su</c:command> to
    become an unprivileged user, this combination will cause Bash to build
    without <c:emphasis>process substitution</c:emphasis>, which will break one
    of the C++ test scripts in <c:literal>eglibc</c:literal>. The following prevents
    future problems by skipping the check for named pipes, as well as other
    tests that can not run while cross-compiling or that do not run properly:</c:para>

<c:command>cat &gt; config.cache &lt;&lt; "EOF"
ac_cv_func_mmap_fixed_mapped=yes
ac_cv_func_strcoll_works=yes
ac_cv_func_working_mktime=yes
bash_cv_func_sigsetjmp=present
bash_cv_getcwd_malloc=yes
bash_cv_job_control_missing=present
bash_cv_printf_a_format=yes
bash_cv_sys_named_pipes=present
bash_cv_ulimit_maxfds=yes
bash_cv_under_sys_siglist=yes
bash_cv_unusable_rtsigs=no
gt_cv_int_divbyzero_sigfpe=yes
EOF</c:command>

    <c:para>Prepare Bash for compilation:</c:para>

<c:command c:arch="alpha,mips,ppc,sparc,x86">./configure -prefix=/tools \
    -build=${CLFS_HOST} -host=${CLFS_TARGET} \
    -without-bash-malloc -cache-file=config.cache</c:command>
<c:command c:arch="mips64-64,mips64,ppc64,sparc64-64,sparc64,x86_64-64,x86_64">CC="${CC} ${BUILD64}" CXX="${CXX} ${BUILD64}" \
   ./configure --prefix=/tools \
   --build=${CLFS_HOST} --host=${CLFS_TARGET} \
   --without-bash-malloc --cache-file=config.cache</c:command>

<!--
    <variablelist os="c">
      <title>The meaning of the new configure option:</title>

      <varlistentry>
        <term><parameter>-without-bash-malloc</parameter></term>
        <listitem>
          <para>This option turns off the use of Bash's memory allocation
          (malloc) function which is known to cause segmentation faults.
          By turning this option off, Bash will use the malloc functions
          from Glibc which are more stable.</para>
        </listitem>
      </varlistentry>

    </variablelist>
-->

    <c:para>Compile the package:</c:para>

<c:command>make</c:command>

    <c:para>Install the package:</c:para>

<c:command>make install</c:command>

  </c:install>

  <c:contents c:ref="ch-system-bash" />

</c:package>

