export CFLAGS="-march=i486 -mtune=i686 -pipe"
export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti"

load fontconfig-dev, graphics-libs-1-dev, gtk2-dev, cups-dev, libpthread-stubs

ghostscript-9.04
----------------

rm -rf expat freetype jasper lcms jpeg libpng tiff zlib

./configure --prefix=/usr/local --enable-dynamic --with-system-libtiff --with-fontpath=/usr/local/share/ghostscript/fonts --without-jasper --without-jbig2dec --with-install-cups --without-libpaper [--disable-compile-inits]

sed -i '/^EXTRALIBS/s# -ldl# -lfreetype -lz#;/=imdi/aSHARE_EXPAT=1' Makefile

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


time make
sudo make install


make so
sudo make soinstall
sudo install -m644 base/*.h /usr/local/include/ghostscript
sudo ln -s ghostscript /usr/local/include/ps
