#!/bin/sh
# Calls autotools to build configure script and Makefile.in.
# Generated automatically using bootstrapper 0.1Alpha
# http://bootstrapper.sourceforge.net/
#
# Copyright (C) 2002 Anthony Ventimiglia
#
# This bootstrap script is free software; you can redistribute 
# it and/or modify it under the terms of the GNU General Public 
# License as published by the Free Software Foundation; either 
# version 2 of the License, or (at your option) any later version.
#
#
# Calls proper programs to create configure script and Makefile.in files.
# if run with the --clean option, bootstrap removes files it generates. To
# clean all autogenerated files (eg: for cvs imports) first run 
# make distclean, then bootstrap --clean
# see bootstrapper(1) for more infor


if test x"$1" = x"--help"; then
	echo "$0: automatic bootstrapping utility for GNU Autotools"
	echo "		cleans up old autogenerated files and runs autoconf,"
	echo "		automake and aclocal on local directory"
	echo 
	echo "		--clean		clean up auto-generated files without"
	echo "					creating new scripts"
	echo 
	exit 0
fi


CONFIG_AUX_DIR="config"
CONFIG_FILES="stamp-h ltconfig" 
ALWAYS_CLEAN="config.cache config.log config.status libtool"
LIBTOOLIZE_FILES="config.guess config.sub ltmain.sh"
ACLOCAL_FILES="aclocal.m4"
AUTOHEADER_FILES="config.h.in"
AUTOMAKE_FILES="config.guess config.sub install-sh ltmain.sh missing mkinstalldirs stamp-h.in"
AUTOCONF_FILES="configure"
CONFIG_HEADER="config/config.h"
SUBDIRS=". src src/misc src/misc/cc++ src/misc/CNestedDataFile src/PoolFile src/backend src/backend/DSP src/backend/Edits src/backend/Effects src/backend/Filters src/backend/Looping src/backend/Remaster . src/frontend_fox "

LIBTOOLIZE="/usr/bin/libtoolize -f"
ACLOCAL="aclocal -I config/m4"
AUTOHEADER="autoheader -l config"
AUTOMAKE="automake --add-missing --foreign"
AUTOCONF="autoconf "


# These are files created by configure, so we'll always clean them
for i in $ALWAYS_CLEAN; do
	test -f $i && \
	rm -v $i
done

if test x"$1" = x"--clean"; then
	#
	#Clean Files left by previous bootstrap run
	#
	if test -n "$CONFIG_AUX_DIR"; 
		then CONFIG_AUX_DIR="$CONFIG_AUX_DIR/"
	fi
	# Clean Libtoolize generated files
	for cf in $LIBTOOLIZE_FILES; do
		cf="$CONFIG_AUX_DIR$cf"
		test -f $cf && \
		rm -v $cf
	done
	#aclocal.m4 created by aclocal
	test -f $ACLOCAL_FILES && rm -v $ACLOCAL_FILES
	#Clean Autoheader Generated files
	for cf in $AUTOHEADER_FILES; do
		cf=$CONFIG_AUX_DIR$cf
		test -f $cf && \
		rm -v $cf
	done
	# remove config header (Usaually config.h)
	test -n "$CONFIG_HEADER" && test -f $CONFIG_HEADER && rm -v $CONFIG_HEADER
	#Clean Automake generated files
	for cf in $AUTOMAKE_FILES; do
		cf=$CONFIG_AUX_DIR$cf
		test -f $cf && \
		rm -v $cf
	done
	for i in $SUBDIRS; do
		test -f $i/Makefile.in && \
		rm -v $i/Makefile.in
	done
	#Autoconf generated files
	for cf in $AUTOCONF_FILES; do
		test -f $cf && \
		rm -v $cf
	done
	for cf in $CONFIG_FILES; do
		cf="$CONFIG_AUX_DIR$cf"
		test -f $cf && \
		rm -v $cf
	done
	test -f rezound && rm -v rezound
else
	$LIBTOOLIZE
	$ACLOCAL
	$AUTOHEADER
	$AUTOMAKE
	$AUTOCONF
fi


