tce-load -i compiletc apr-util-dev scons

https://archive.apache.org/dist/serf/serf-1.3.9.tar.bz2

cd serf-1.3.9

sed -i "/Append/s:RPATH=libdir,::"          SConstruct
sed -i "/Default/s:lib_static,::"           SConstruct
sed -i "/Alias/s:install_static,::"         SConstruct
sed -i "/  print/{s/print/print(/; s/$/)/}" SConstruct

find . -name SConstruct -type f -exec sed -i 's/-O2//g' {} \;
find . -name SConstruct -type f -exec sed -i 's/O2//g' {} \;
find . -name SConstruct -type f -exec sed -i 's/-g//g' {} \;
find . -name SConstruct -type f -exec sed -i 's/-g -O2//g' {} \;

scons PREFIX=/usr/local APR=/usr/local APU=/usr/local CC="gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe"
sudo scons PREFIX=/usr/local install
