Originally by Chris Green, ./configure and automake rework done by jh.
