<?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-system-perl" role="wrap">
  <?dbhtml filename="perl-64bit.html"?>

  <title>Perl-&perl-version; 64 Bit</title>

  <indexterm zone="ch-system-perl">
    <primary sortas="a-Perl">Perl</primary>
  </indexterm>

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

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

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

<screen os="s4"><userinput>sed -i -e '/^BUILD_ZLIB/s/True/False/' \
       -e '/^INCLUDE/s,\./zlib-src,/usr/include,' \
       -e '/^LIB/s,\./zlib-src,/usr/lib64,' \
       cpan/Compress-Raw-Zlib/config.in</userinput></screen>

    <para os="mp1">Perl does not, by default, know about library directories
    with names other than <filename class="directory">lib</filename>. The
    following patch will allow it to install to other directories:</para>

<screen os="mp2"><userinput>patch -Np1 -i ../&perl-multilib-patch;</userinput></screen>

    <para os="s1">There is a further (possibly cosmetic) anomaly - if we
    install Perl and then run <command>perl -V</command> it will claim that
    libc is in <filename class="directory">/lib</filename>.  The
    following sed fixes this, but only takes effect when
    <command>make install</command> is run:</para>

<screen os="s2"><userinput>sed -i "/libc/s@/lib@/lib64@" hints/linux.sh</userinput></screen>

    <para os="m2">We still need to tell Perl to actually use <filename class="directory">lib64</filename>:</para>

<screen os="m3"><userinput>echo 'installstyle="lib64/perl5"' >>hints/linux.sh</userinput></screen>

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

<screen os="b"><userinput>./configure.gnu --prefix=/usr \
   -Dvendorprefix=/usr \
   -Dman1dir=/usr/share/man/man1 \
   -Dman3dir=/usr/share/man/man3 \
   -Dpager="/bin/less -isR" \
   -Dlibpth="/usr/local/lib64 /lib64 /usr/lib64" \
   -Dcc="gcc ${BUILD64}" \
   -Dusethreads -Duseshrplib</userinput></screen>

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

      <varlistentry>
        <term><parameter>-Dlibpth="/usr/local/lib64 /lib64 /usr/lib64"</parameter></term>
        <listitem>
          <para>This tells Perl to link against the 64-bit libraries.</para>
        </listitem>
      </varlistentry>

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

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

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

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

    </variablelist>

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

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

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

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

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

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

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="perl.xml"
    xpointer="xpointer(//*[@os='l'])"/>

<screen os="m"><userinput>mv -v /usr/bin/perl{,-64}
mv -v /usr/bin/perl&perl-version;{,-64}</userinput></screen>

    <para os="n">Now we need to create a link to the multiarch wrapper that
    lets us choose which perl installation to use:</para>

<screen os="o"><userinput>ln -sv multiarch_wrapper /usr/bin/perl
ln -sv multiarch_wrapper /usr/bin/perl&perl-version;</userinput></screen>

    <para os="p">The value of the <envar>USE_ARCH</envar> environment variable
    will decide which perl binary to execute.
    <command>USE_ARCH=32 perl -V:cc</command> will give the value of CC used to
    build the 32bit perl. The multiarch_wrapper will help later with building
    perl extensions and bindings. Without the multiarch_wrapper it is very hard
    to setup a 32bit extension or binding.</para>

  </sect2>

  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
  href="../common/perl.xml"
  xpointer="xpointer(id('contents-perl'))"/>

</sect1>
