Compiling Perl 5.20.1

#See for building environment, script and other things not defined here.
#Before starting do declare the environment variables specified to the link above.

#search for modules
#Installing Perl modules from CPAN (didn't work):

export CFLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -fno-stack-protector -pthread -O2 -Wall -Wno-error"
export BUILD_FLAGS="$CFLAGS -I/ffp/include"
export LIBS="-lintl"
export LDFLAGS="-L/ffp/lib $LIBS"

#building perl 5.20.1
~/ ffpg
sh Configure -Dprefix='/ffp' -Duseshrplib
Build a threading Perl? [n] y
What libraries to use? -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat -lintl
What optimizer/debugger flag should be used? [-O2] -O2 -march=armv5te
Any additional cc flags? -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe $BUILD_FLAGS
Any additional ld flags (NOT including libraries)? [ -L/usr/local/lib] -L/ffp/lib
Shall I use /ffp/bin/nm to extract C symbols from the libraries? [y] n
Do you wish to use dynamic loading? [y]
#Any special flags to pass to cc -c to compile shared library modules? $BUILD_FLAGS
Run make depend now? [y] n
lddlflags='-shared -O2 -march=armv5te -L/ffp/lib'
optimize='-O2 -march=armv5te'
#sh Configure -S -> to run after is manually modified
make depend
nohup /ffp/bin/make -C ~/compile/perl-5.20.1 &

	"can't get tcp protocol by name" for perl dist/Net-Ping/t/ tests
	#you must have already installed one of these (they are the same considering the functionality gain): -> this one has more comments (compared with stripped version)
	#then add to fun_plug.local the commands below
	cp /ffp/etc/protocols /etc/protocols
	cp /ffp/etc/services /etc/services

#make minitest
nohup /ffp/bin/make test -C ~/compile/perl-5.20.1 &
tail -f nohup.out

#Install CPAN minus module
#In order to work CPAN minus requires:
#ln -s /ffp/etc/protocols /etc/protocols
#CPAN minus might require Mozilla's CA Bundle certificate (search /ffp/bin/cpanm for cert.pem after installation).
#download the Mozilla's CA Bundle certificate:
#wget -nv -O /ffp/etc/ssl/cert.pem

#Install cpan-outdated module:
cpan install App::cpanoutdated
#or build yourself:
cd ~/compile
tar xvzf App-cpanoutdated-0.24.tar.gz
cd ~/compile/App-cpanoutdated-0.24
~/ ffpg
perl Makefile.PL
#installing cpanoutdated required modules
cpanm CPAN::DistnameInfo
cpanm LWP
cpanm Module::Metadata
cpanm local::lib
... and others if asked ...
make test
make install
#In order to learn about outdated modules run:

#Install cpanlistchanges with CPAN:
cpan install App::cpanlistchanges
#or with CPAN minus:
cpanm App::cpanlistchanges
#If you want to see what is changed (Change-log) for CPAN module than run:
cpan-listchanges CPAN

#Building & installing Module-Build module.
cd ~/compile
tar xvzf Module-Build-0.4210.tar.gz
cd Module-Build-0.4210
~/ ffpg
perl Build.PL
./Build test
./Build install

#Building & installing gettext module.
export LIBS="-lintl"
export LDFLAGS="-L/ffp/lib $LIBS"
cd ~/compile/
tar xvzf gettext-1.05.tar.gz
cd gettext-1.05
~/ ffpg
perl Makefile.PL
make test
make install

#When building help2man and perl has the module Locale::gettext I get the error:
#sh: error while loading shared libraries: cannot open shared object file: No such file or directory
#solved by (adding /ffp/lib to the end):
#export LD_LIBRARY_PATH=/usr/local/zy-pkgs/lib:/ffp/opt/serf-1.3.6/lib:/ffp/lib
#and also the error:
#help2man: can't get `--help' info from ./help2man
#Try `--no-discard-stderr' if option outputs to stderr
#solved by removing Locale::gettext perl module:
perl ~/tools/ Locale::gettext -> only shows what files should be removed
#then remove by hand the Locale::gettext specific files

#Listing PERL modules
#original article
instmodsh	-> also have capabilities to show module's files
perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'
#Perl Module Tools (
pmall - get all installed modules pmdesc descriptions
pminst - find what's installed
cpan -l

#using cpanm to install App::cpanlistchanges module
cpanm App::cpanlistchanges
#using cpanm to reinstall XML::Simple module
cpanm --reinstall XML::Simple
#Shows the primary maintainers for XML::Simple module
cpan -A XML::Simple
#Show the XML::Simple module details
cpan -D XML::Simple

#upgrade a module using CPAN
#enter CPAN shell using:
#press h then ENTER for CPAN shell help
#report updates for DB_File module:
r DB_File
#report updates for CGI::Fast module:
r CGI::Fast
#upgrade CGI::Fast module:
upgrade CGI::Fast

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.