Compiling boost 1.49.0

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

NEW_BUILD_NAME=boost
NEW_BUILD_VER=1.49.0
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/boost/files/boost/1.49.0/boost_1_49_0.tar.gz/download
tar xvzf boost_1_49_0.tar.gz
cd ~/compile/boost_1_49_0
~/x.sh ffpg

#modify boostcpp.jam to this (removed /usr/local):
#install-requirements += <install-default-prefix> ;
#modify boost-build.jam, boostcpp.jam, bootstrap.sh:
#replace any /usr or /usr/local to /ffp
./bootstrap.sh
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
nohup ./b2 --prefix=$HOME/temp/$NEW_BUILD_NAME_AND_VER/ffp --without-mpi variant=release install &

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 ~/apache-htdocs/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz

Compiling anyterm-1.1.29

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

cd ~/compile
wget http://anyterm.org/download/anyterm-1.1.29.tbz2
tar jxf anyterm-1.1.29.tbz2
cd anyterm-1.1.29
~/x.sh ffpg

NEW_BUILD_NAME=anyterm
NEW_BUILD_VER=1.1.29
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

ERROR
	execinfo.h not found
SOLUTION
	sed -i s/"#include <execinfo"/"\/\/#include <execinfo"/ libpbe/src/segv_backtrace.cc
	sed -i s/"signal(SIGSEGV,SIG_DFL"/"\/*signal(SIGSEGV,SIG_DFL"/ libpbe/src/segv_backtrace.cc
	sed -i s/"raise(signum);"/"raise(signum);*\/"/ libpbe/src/segv_backtrace.cc

ERROR (UBUNTU too)
	../src/SmtpClient.cc: In member function 'void SmtpClient::wait_for_reply(int, int)':
	../src/SmtpClient.cc:82:35: error: 'sscanf' was not declared in this scope
		 int rc = sscanf(buf,"%d",&code);
SOLUTION
	#grep -r sscanf /usr/include/" finds /usr/include/stdio.h
	#<cstdio> must be included to anyterm-1.1.29/libpbe/src/SmtpClient.cc:
	sed -i s/"using namespace std"/"#include <cstdio>\nusing namespace std"/ libpbe/src/SmtpClient.cc

ERROR
	Terminal.o: In function `Terminal::~Terminal()':
	Terminal.cc:(.text+0x10): undefined reference to `libiconv_close'
	Terminal.o: In function `Terminal::write_normal_char(wchar_t)':
	Terminal.cc:(.text+0x1250): undefined reference to `libiconv'
	Terminal.o: In function `Terminal::Terminal(int, int, Screen&)':
	Terminal.cc:(.text+0x1e38): undefined reference to `libiconv_open'
SOLUTION
	common.mk must have iconv added to LINK_FLAGS:
	sed -i s/"lutil"/"lutil -liconv"/ common.mk

ERROR on UBUNTU
	In file included from ../src/URI.cc:21:0:
	/usr/include/boost/spirit.hpp:18:4: warning: #warning "This header is deprecated. Please use: boost/spirit/include/classic.hpp" [-Wcpp]
	 #  warning "This header is deprecated. Please use: boost/spirit/include/classic.hpp"
		^
	../src/URI.cc:22:50: fatal error: boost/spirit/actor/insert_at_actor.hpp: No such file or directory
	 #include 
	###############################################################
	# This means that won't find some hpp (as example error above).
SOLUTION
	# Commented replacement only solves a warning but imply the error: ‘rule’ does not name a type.
	#sed -i s"/boost\/spirit.hpp"/"boost\/spirit\/include\/classic.hpp"/ ./libpbe/src/URI.cc
	sed -i s"/actor\/insert_at_actor.hpp"/"home\/classic\/actor\/insert_at_actor.hpp"/ ./libpbe/src/URI.cc
	sed -i s"/dynamic\/if.hpp"/"home\/classic\/dynamic\/if.hpp"/ ./libpbe/src/URI.cc
	sed -i s"/utility\/loops.hpp"/"home\/classic\/utility\/loops.hpp"/ ./libpbe/src/URI.cc
	sed -i s"/iterator\/multi_pass.hpp"/"home\/classic\/iterator\/multi_pass.hpp"/ ./libpbe/src/URI.cc
	#sed -i s"/boost\/spirit.hpp"/"boost\/spirit\/include\/classic.hpp"/ ./libpbe/src/parse_http_request.cc
	sed -i s"/actor\/insert_at_actor.hpp"/"home\/classic\/actor\/insert_at_actor.hpp"/ ./libpbe/src/parse_http_request.cc
	sed -i s"/dynamic\/if.hpp"/"home\/classic\/dynamic\/if.hpp"/ ./libpbe/src/parse_http_request.cc
	sed -i s"/utility\/loops.hpp"/"home\/classic\/utility\/loops.hpp"/ ./libpbe/src/parse_http_request.cc
	sed -i s"/iterator\/multi_pass.hpp"/"home\/classic\/iterator\/multi_pass.hpp"/ ./libpbe/src/parse_http_request.cc

# On Ubuntu requires:
sudo apt-get install libboost-all-dev

#Modify cols & rows count in anyterm-1.1.29/src/Anyterm.cc
sed -i s/"int rows=25, int cols=80"/"int rows=500, int cols=155"/ src/Anyterm.cc
sed -i s/"rows\",25"/"rows\",500"/ src/Anyterm.cc
sed -i s/"cols\",80"/"cols\",155"/ src/Anyterm.cc
sed -i s/"pty_rows=25, int pty_cols=80"/"pty_rows=500, int pty_cols=155"/ src/SubProcess.hh
sed -i s/",25,80,"/",500,155,"/ browser/anyterm.html

# make using multiple cores: make -j 4
make -j 4
cp anytermd /ffp/bin
cp anytermd ~/ffp_0.7_armv5/packages/anytermd-500x155

nginx autoindex and apaxy

# I advise you to download apaxy + http://adrhc.go.ro/public/apaxy_for_nginx.js 
# then replace the urls below with the ones for your server.
# Possible values for:
# defaultSortProperty (string): "name", "parsedDate", "size"
# isDescSort (boolean): true/false
# apaxyIconsRoot (string): the root of apaxy icons dir (e.g. /apaxy/theme/icons/ -> ending slash matters!)
autoindex				on;
autoindex_exact_size	off;
add_before_body			http://adrhc.go.ro/apaxy-20150401/theme/header.html;
add_after_body			http://adrhc.go.ro/apaxy-20150401/theme/footer.html;
sub_filter				</body>	'<link href="http://adrhc.go.ro/apaxy-20150401/theme/style.css" rel="stylesheet"><script src="http://adrhc.go.ro/public/apaxy_for_nginx.js"></script><script>apaxyPatchForNginx.setDescSort(false);apaxyPatchForNginx.setDefaultSortProperty("name");apaxyPatchForNginx.setApaxyIconsRoot("http://adrhc.go.ro/apaxy-20150401/theme/icons/");apaxyPatchForNginx.doApaxy();</script></body>';
	sub_filter_last_modified	on;