Compiling Perl 5.22.0

#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"
unset LIBS
export LDFLAGS="-L/ffp/lib"

ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*

#building perl
cd ~/compile
tar xvzf perl-5.22.0.tar.gz
cd ~/compile/$NEW_BUILD_NAME_AND_VER
nohup ~/ ffpg &

#build configuration
./Configure -Dprefix=/ffp -Dusethreads -Duseshrplib
Build a threading Perl? [n] y
What libraries to use? [-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat]
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
Shall I use /ffp/bin/nm to extract C symbols from the libraries? [y] n
List of earlier versions to include in @INC? [5.20.1 5.14.2] none
Do you want to install perl as /ffp/bin/perl? [n] y
Do you wish to use dynamic loading? [y]
Any special flags to pass to cc to create a dynamically loaded library? -shared $BUILD_FLAGS -L/ffp/lib
Your host name appears to be "nsa310". Right? [y] n
Please type the (one word) name of your host: adrhc
What is your domain name? [.localdomain]
What is your e-mail address? [] ***************
What shall I put after the #! to start up perl ("none" to not use #!)? [/ffp/bin/perl5.22.0] /ffp/bin/perl
Shall I ignore gethostname() from now on? [n] y
Run make depend now? [y] n

#Manually modify
ccdlflags='-Wl,-E -Wl,-rpath,/ffp/lib/perl5/5.22.0/armv5tel-linux-thread-multi/CORE'
ccflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -fno-stack-protector -pthread -O2 -Wall -Wno-error -I/ffp/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
glibpth='/ffp/lib /ffp/lib/386 /usr/shlib /lib /lib/386 /usr/ccs/lib /usr/ucblib /ffp/lib '

#run after is manually modified:
sh Configure -S

	"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

	POSIX.xs:992:18: error: 'FE_TOWARDZERO' undeclared (first use in this function)
	   case 0: return FE_TOWARDZERO;
	Comment three rows in ext/POSIX/POSIX.xs:
	/*#ifdef I_FENV
	#include <fenv.h>

make depend
nohup make -C . &
tail -f nohup.out
nohup /ffp/bin/make test -C . &
tail -f nohup.out

cp -v /tmp/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/
funpkg -q $NEW_BUILD_NAME
funpkg -i ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz

#Install CPAN minus module
tar xvzf App-cpanminus-1.7036.tar.gz
perl Makefile.PL
make test
make install

#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 (recommended way):
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 (recommended way):
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 (installed anyway when running "cpan install App::cpanoutdated").
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.