# Perl-&perl-version; 64 Bit

## Installation of Perl

    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

Perl does not, by default, know about library directories with names other than lib, The following patch will allow it to install to other directories:

    patch -Np1 -i ../&perl-multilib-patch;

There is a further (possibly cosmetic) anomaly - if we install perl and then run `perl -V` it will claim that libc is in /lib. The following sed fixes this, but only takes effect when `make install` is run:

    sed -i "/libc/s@/lib@/lib64@" hints/linux.sh

We still need to tell perl to actually use lib64:

    echo 'installstyle="lib64/perl5"' >>hints/linux.sh

    ./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

## The meaning of the new configure option:

`-Dlibpth="/usr/local/lib64 /lib64 /usr/lib64"`

- This tells Perl to link against the 64-bit libraries.

    mv -v /usr/bin/perl{,-64}
    mv -v /usr/bin/perl&perl-version;{,-64}

Now we need to create a link to the multiarch wrapper that lets us choose which perl installation to use:

    ln -sv multiarch_wrapper /usr/bin/perl
    ln -sv multiarch_wrapper /usr/bin/perl&perl-version;

The value of the `USE_ARCH` environment variable will decide which perl binary to execute. `USE_ARCH=32 perl -V:cc` 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.