Compiling Perl 5.20.1

#See https://adrhc.go.ro/wordpress/common-commands-when-building/ for building environment, x.sh script and other things not defined here.
#Before starting do declare the environment variables specified to the link above.

#search http://search.cpan.org/ for modules
#see http://www.thegeekstuff.com/2008/09/how-to-install-perl-modules-manually-and-using-cpan-command/
#Installing Perl modules from CPAN (didn't work): http://perl.about.com/od/packagesmodules/qt/perlcpan.htm

#environment
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"
export CPPFLAGS="$BUILD_FLAGS"
export CXXFLAGS="$BUILD_FLAGS"

#building perl 5.20.1
~/x.sh 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
cccdlflags='-fPIC'
lddlflags='-shared -O2 -march=armv5te -L/ffp/lib'
ldflags='-L/ffp/lib'
optimize='-O2 -march=armv5te'
#sh Configure -S -> to run after config.sh is manually modified
make depend
nohup /ffp/bin/make -C ~/compile/perl-5.20.1 &

ERROR
	"can't get tcp protocol by name" for perl dist/Net-Ping/t/ tests
SOLUTION
	#see http://forum.nas-central.org/viewtopic.php?f=249&t=16561&hilit=iana
	#see http://www.iana.org/assignments/port-numbers
	#see http://sethwklein.net/iana-etc
	#you must have already installed one of these (they are the same considering the functionality gain): 
	https://adrhc.go.ro/ffp_0.7_armv5/packages/iana-etc-2.30-arm-0.txz -> this one has more comments (compared with stripped version)
	https://adrhc.go.ro/ffp_0.7_armv5/packages/iana-etc-2.30-arm-0-stripped.txz
	http://www.inreto.de/ffp/0.7/arm/packages/iana-etc-2.30-arm-1.txz
	#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
wget http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7023.tar.gz
#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 http://curl.haxx.se/ca/cacert.pem -O /ffp/etc/ssl/cert.pem

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

#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
wget http://www.cpan.org/authors/id/L/LE/LEONT/Module-Build-0.4210.tar.gz
tar xvzf Module-Build-0.4210.tar.gz
cd Module-Build-0.4210
~/x.sh ffpg
perl Build.PL
./Build
./Build test
./Build install

#Building & installing gettext module.
#needs:
export LIBS="-lintl"
export LDFLAGS="-L/ffp/lib $LIBS"
cd ~/compile/
wget http://search.cpan.org/CPAN/authors/id/P/PV/PVANDRY/gettext-1.05.tar.gz
tar xvzf gettext-1.05.tar.gz
cd gettext-1.05
~/x.sh ffpg
perl Makefile.PL
make
make test
make install

#When building help2man and perl has the module Locale::gettext I get the error:
#sh: error while loading shared libraries: libintl.so.8: 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/uninstall_perl_module.pl Locale::gettext -> only shows what files should be removed
#then remove by hand the Locale::gettext specific files

#Listing PERL modules
#original article http://www.linuxquestions.org/questions/linux-general-1/how-to-list-all-installed-perl-modules-216603/
instmodsh	-> also have capabilities to show module's files
#or
perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'
#or
#Perl Module Tools (https://metacpan.org/release/pmtools)
pmall - get all installed modules pmdesc descriptions
pminst - find what's installed
#or
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:
cpan
#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

Compiling texinfo

NEW_BUILD_NAME=texinfo
NEW_BUILD_VER=5.2
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
cd ~/compile
wget https://ftp.gnu.org/gnu/texinfo/texinfo-5.2.tar.xz
tar xpvf $NEW_BUILD_NAME_AND_VER.tar.xz
cd ~/compile/$NEW_BUILD_NAME_AND_VER/
find . -type f \( -exec sed -i s/"\/usr\/bin\/perl"/"\/ffp\/bin\/perl"/ {} \; , -exec sed -i s/"\/usr\/bin\/python"/"\/ffp\/bin\/python"/ {} \; , -exec sed -i s/"\/usr\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/usr\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/ffp\/ffp\/"/"\/ffp\/"/ {} \; \)
export BUILD_FLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -pthread -O2 -lintl -Wall -I/ffp/include"
export LDFLAGS="-L/ffp/lib -lintl"
export CPPFLAGS="$BUILD_FLAGS"
export CXXFLAGS="$BUILD_FLAGS"
export CFLAGS="$BUILD_FLAGS"
export LC_ALL=POSIX
./configure --help > configure.help.txt
#Modify configure.ac to your version of automake:
#AM_INIT_AUTOMAKE([1.14.1 dist-xz
./configure --prefix=/ffp --enable-dependency-tracking --enable-threads=posix --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp
make
#nohup /ffp/bin/make -C ~/compile/$NEW_BUILD_NAME_AND_VER &
#tail -f nohup.out
#new package creation & installation
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
cp -v /tmp/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/
funpkg -i ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz
funpkg -q $NEW_BUILD_NAME

Compiling nettle

#search for 2.7-fixes at https://www.mail-archive.com/nettle-bugs@lists.lysator.liu.se/msg00683.html
NEW_BUILD_NAME=nettle
NEW_BUILD_VER=2.7-fixes
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
cd ~/compile
wget -O nettle-2.7-fixes.zip https://git.lysator.liu.se/nettle/nettle/repository/archive.zip?ref=nettle-2.7-fixes
unzip $NEW_BUILD_NAME_AND_VER.zip
cd ~/compile/$NEW_BUILD_NAME_AND_VER/
find . -type f \( -exec sed -i s/"\/usr\/bin\/perl"/"\/ffp\/bin\/perl"/ {} \; , -exec sed -i s/"\/usr\/bin\/python"/"\/ffp\/bin\/python"/ {} \; , -exec sed -i s/"\/usr\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/usr\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/ffp\/ffp\/"/"\/ffp\/"/ {} \; \)
export BUILD_FLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -pthread -O2 -lintl -Wall -I/ffp/include"
export LDFLAGS="-L/ffp/lib -lintl"
export CPPFLAGS="$BUILD_FLAGS"
export CXXFLAGS="$BUILD_FLAGS"
export CFLAGS="$BUILD_FLAGS"
export LC_ALL=POSIX
aclocal -I .
autoconf
autoheader
#automake --add-missing
#Comment/modify these lines in Makefile.in:
#DOCTARGETS = @IF_DOCUMENTATION@ nettle.html
##DOCTARGETS = @IF_DOCUMENTATION@ nettle.info nettle.html nettle.pdf
#
##.texinfo.dvi:
##	cd $(srcdir) && texi2dvi -b `basename "$<"`
#
##.dvi.ps:
##	cd $(srcdir) && dvips -Ppdf -G0 -o `basename "$<" .dvi`.ps `basename "$<"`
#
#	nettle.html sha-example.c
##	nettle.texinfo nettle.info nettle.html nettle.pdf sha-example.c
./configure --help > configure.help.txt
./configure --prefix=/ffp --enable-gcov
make
#nohup /ffp/bin/make -C ~/compile/$NEW_BUILD_NAME_AND_VER &
#tail -f nohup.out
#new package creation & installation
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
cp -v /tmp/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/
funpkg -i ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz
funpkg -q $NEW_BUILD_NAME

NSA310, FFP, lddd (missing libraries)

#see http://forum.nas-central.org/viewtopic.php?f=249&t=14699&hilit=lddd&start=0#p82527
wget http://downloads.zyxel.nas-central.org/Users/barmalej2/ffp/0.7/arm/scripts/lddd -O /ffp/sbin/lddd
chmod 755 /ffp/sbin/lddd
lddd

#Do NOT solve like below the missing libraries reported by lddd:
ln -s /lib/libc.so.6 /ffp/lib/
ln -s /usr/lib/libdb-5.2.so /ffp/lib/
ln -s /usr/lib/libffi.so.5 /ffp/lib/
ln -s /lib/ld-linux.so.3 /ffp/lib/

Building wget

NEW_BUILD_NAME=wget
NEW_BUILD_VER=1.16
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
cd ~/compile
wget http://ftp.gnu.org/gnu/wget/wget-1.16.tar.xz
tar xpvf $NEW_BUILD_NAME_AND_VER.tar.xz
cd ~/compile/$NEW_BUILD_NAME_AND_VER/
find . -type f \( -exec sed -i s/"\/usr\/bin\/perl"/"\/ffp\/bin\/perl"/ {} \; , -exec sed -i s/"\/usr\/bin\/python"/"\/ffp\/bin\/python"/ {} \; , -exec sed -i s/"\/usr\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/usr\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/ffp\/ffp\/"/"\/ffp\/"/ {} \; \)
export BUILD_FLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -pthread -O2 -lintl -Wall -I/ffp/include"
export LDFLAGS="-L/ffp/lib -lintl"
export CPPFLAGS="$BUILD_FLAGS"
export CXXFLAGS="$BUILD_FLAGS"
export CFLAGS="$BUILD_FLAGS"
export LC_ALL=POSIX
./configure --help > configure.help.txt 
aclocal -I m4
autoconf
autoheader
automake --add-missing
./configure --prefix=/ffp --with-ssl=openssl --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp --with-openssl --with-libpth-prefix=/ffp --with-libssl-prefix=/ffp
make
#nohup /ffp/bin/make -C ~/compile/$NEW_BUILD_NAME_AND_VER &
#tail -f nohup.out
#new package creation & installation
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
cp -v /tmp/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/
funpkg -i ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz
funpkg -q $NEW_BUILD_NAME

Building CUnit

NEW_BUILD_NAME=CUnit
NEW_BUILD_VER=2.1-3
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
cd ~/compile
wget http://sourceforge.net/projects/cunit/files/CUnit/2.1-3/CUnit-2.1-3.tar.bz2/download
tar jxf $NEW_BUILD_NAME_AND_VER.tar.bz2
cd ~/compile/$NEW_BUILD_NAME_AND_VER/
find . -type f \( -exec sed -i s/"\/usr\/bin\/perl"/"\/ffp\/bin\/perl"/ {} \; , -exec sed -i s/"\/usr\/bin\/python"/"\/ffp\/bin\/python"/ {} \; , -exec sed -i s/"\/usr\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/usr\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/ffp\/ffp\/"/"\/ffp\/"/ {} \; \)
export BUILD_FLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -pthread -O2 -lintl -Wall -I/ffp/include"
export LDFLAGS="-L/ffp/lib -lintl"
export CPPFLAGS="$BUILD_FLAGS"
export CXXFLAGS="$BUILD_FLAGS"
export CFLAGS="$BUILD_FLAGS"
export LC_ALL=POSIX
#./bootstrap --prefix=/ffp -> cause:
#configure: error: expected an absolute directory name for --prefix: --prefix=/ffp
./bootstrap
./configure --help > configure.help.txt 
./configure --prefix=/ffp
make -> here it fails
#nohup /ffp/bin/make -C ~/compile/$NEW_BUILD_NAME_AND_VER &
#tail -f nohup.out
#new package creation & installation
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
cp -v /tmp/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/
funpkg -i ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz
funpkg -q $NEW_BUILD_NAME

Building Aria2

NEW_BUILD_NAME=aria2
NEW_BUILD_VER=1.18.8
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
cd ~/compile
wget http://sourceforge.net/projects/aria2/files/stable/aria2-1.18.8/aria2-1.18.8.tar.gz/download
tar xvzf $NEW_BUILD_NAME_AND_VER.tar.gz
cd ~/compile/$NEW_BUILD_NAME_AND_VER/
find . -type f \( -exec sed -i s/"\/usr\/bin\/perl"/"\/ffp\/bin\/perl"/ {} \; , -exec sed -i s/"\/usr\/bin\/python"/"\/ffp\/bin\/python"/ {} \; , -exec sed -i s/"\/usr\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/usr\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/ffp\/ffp\/"/"\/ffp\/"/ {} \; \)
export BUILD_FLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -pthread -O2 -lintl -Wall -I/ffp/include"
export LDFLAGS="-L/ffp/lib -lintl"
export CPPFLAGS="$BUILD_FLAGS"
export CXXFLAGS="$BUILD_FLAGS"
export CFLAGS="$BUILD_FLAGS"
export LC_ALL=POSIX
./configure --help > configure.help.txt 
./configure --prefix=/ffp --enable-libaria2 --with-xml-prefix=/ffp --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp
make
#nohup /ffp/bin/make -C ~/compile/$NEW_BUILD_NAME_AND_VER &
#tail -f nohup.out
#new package creation & installation
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
cp -v /tmp/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/
funpkg -i ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz
funpkg -q $NEW_BUILD_NAME

Building automake

NEW_BUILD_NAME=automake
NEW_BUILD_VER=1.14.1
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
cd ~/compile
wget http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.xz
tar -xf $NEW_BUILD_NAME_AND_VER.tar.xz
cd ~/compile/$NEW_BUILD_NAME_AND_VER/
find . -type f \( -exec sed -i s/"\/usr\/bin\/perl"/"\/ffp\/bin\/perl"/ {} \; , -exec sed -i s/"\/usr\/bin\/python"/"\/ffp\/bin\/python"/ {} \; , -exec sed -i s/"\/usr\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/usr\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/ffp\/ffp\/"/"\/ffp\/"/ {} \; \)
export BUILD_FLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -pthread -O2 -lintl -Wall -I/ffp/include"
export LDFLAGS="-L/ffp/lib -lintl"
export CPPFLAGS="$BUILD_FLAGS"
export CXXFLAGS="$BUILD_FLAGS"
export CFLAGS="$BUILD_FLAGS"
export LC_ALL=POSIX
./configure --help > configure.help.txt 
./bootstrap.sh --prefix=/ffp
CONFIG_SHELL=/ffp/bin/bash ./configure CONFIG_SHELL=/ffp/bin/bash --prefix=/ffp
make
#new package creation & installation
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
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

Building autoconf

NEW_BUILD_NAME=autoconf
NEW_BUILD_VER=2.69
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
cd ~/compile
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz
tar -xf $NEW_BUILD_NAME_AND_VER.tar.xz
cd ~/compile/$NEW_BUILD_NAME_AND_VER/
find . -type f \( -exec sed -i s/"\/usr\/bin\/perl"/"\/ffp\/bin\/perl"/ {} \; , -exec sed -i s/"\/usr\/bin\/python"/"\/ffp\/bin\/python"/ {} \; , -exec sed -i s/"\/usr\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/usr\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \; , -exec sed -i s/"\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \; , -exec sed -i s/"\/bin\/env"/"\/ffp\/bin\/env"/ {} \; , -exec sed -i s/"\/ffp\/ffp\/"/"\/ffp\/"/ {} \; \)
export BUILD_FLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -pthread -O2 -lintl -Wall -I/ffp/include"
export LDFLAGS="-L/ffp/lib -lintl"
export CPPFLAGS="$BUILD_FLAGS"
export CXXFLAGS="$BUILD_FLAGS"
export CFLAGS="$BUILD_FLAGS"
export LC_ALL=POSIX
./configure --help > configure.help.txt 
./configure --prefix=/ffp
#Replace in doc/autoconf.texi any this kind of sequence:
#@
#  @
#with only @
make
#nohup /ffp/bin/make -C ~/compile/$NEW_BUILD_NAME_AND_VER &
#tail -f nohup.out
#new package creation & installation
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
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

Multilayered architecture

Why use a multilayered architecture ?
Flexibility It's easier to understand, create, correct, upgrade a very specialized software component instead of a many-specialized one.
Crosscutting Concerns
http://msdn.microsoft.com/en-us/library/ee658105.aspx
Authentication
Authorization
Caching
Communication
Configuration Management
Exception Management
Logging and Instrumentation
State Management
Validation
Rich Domain vs Anaemic Domain
http://martinfowler.com/bliki/AnemicDomainModel.html
http://www.sapiensworks.com/blog/post/2014/03/26/Rich-Domain-Is-SOLID-Anaemic-Domain-Is-An-Anti-Pattern.aspx
Domain Objects vs Persistence Model (ORM Entities)
http://www.sapiensworks.com/blog/post/2012/04/20/Dont-Use-ORM-Entities-To-Model-The-Domain.aspx
http://www.sapiensworks.com/blog/post/2012/04/07/Just-Stop-It!-The-Domain-Model-Is-Not-The-Persistence-Model.aspx

Practical examples
ORM ids might differ the DO's identifier (if any).
In many-to-many relationships you might have methods to add an element to a collection and also to set the element's parent this object. This kind of ORM method might not exists/be necessary to DO (domain object).
ORM might need Formula properties but DO not.
ORM might need usage of @EntityListeners but DO not.