#!/bin/sh
# Generates ./configure, Makefile.in's and tools

# Copyright (C) 2007, 2008, 2010, 2014, 2015  Sylvain Beucler

# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.

set -e

if [ "x$1" = xclean ]; then
    test ! -f Makefile || make maintainer-clean || true

    # Generated by aclocal.
    rm -f aclocal.m4
    # Generated by autoheader.
    rm -f config.h.in
    # Generated by autoconf.
    rm -f configure
    rm -rf autom4te.cache/
    # Generated or brought in by automake.
    rm -f INSTALL
    find -name "Makefile.in" | xargs -r rm
    rm -rf autotools/
    exit
fi

echo "Generating build information using aclocal, autoheader, automake and autoconf"
echo "This may take a while ..."

# Regenerate configuration files
autoreconf --install --force $*

# Run configure for this platform
#./configure $*
echo "Now you are ready to run ./configure"
