#! /bin/sh

cd "$(dirname "$0")"

: ${AUTORECONF="autoreconf${AC_VER}"}
: ${AUTOHEADER="autoheader${AC_VER}"}
: ${AUTOCONF="autoconf${AC_VER}"}
: ${ACLOCAL="aclocal${AM_VER}"}
: ${AUTOMAKE="automake${AM_VER}"}

export ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE

# Bootstrap the build system.

set -x

rm -rf autom4te.cache

# MacOS calls it "glibtoolize", everyone else "libtoolize"
# probe for that
LIBTOOLIZE=libtoolize
glibtoolize --version > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize
export LIBTOOLIZE

${AUTORECONF} -i "$@"
