#!/bin/sh

# NOTE: Any extra m4 macro's should be in the m4 directory.

echo "Running aclocal..."
aclocal -I m4

echo "Running autoheader..."
autoheader

echo "Fixing config.h.in..."
if [ ! -e /tmp/cblm.build.$$ -a -e config.h.in ]; then
	sed -e 's:#undef PACKAGE_BUGREPORT:/* & */:' -e 's:#undef PACKAGE_NAME:/* & */:' -e 's:#undef PACKAGE_STRING:/* & */:' -e 's:#undef PACKAGE_TARNAME:/* & */:' -e 's:#undef PACKAGE_VERSION:/* & */:' config.h.in > /tmp/cblm.build.$$
	mv -f /tmp/cblm.build.$$ config.h.in
fi

echo "Running autoconf..."
autoconf

echo "Running automake..."
automake -a

echo "Run ./configure and make to build."
