some changes to make it autoreconf 2.68 compatible.