#! /bin/sh

#C 2002, 2003 Carlo Contavalli
#M <ccontavalli at masobit.net>
#W mod-xslt
#F trash
#D Generates the configure script needed by mod-xslt
#R autoheader, aclocal, autoconf, rm

#
#   mod-xslt -- Copyright (C) 2002, 2003 
# 		 Carlo Contavalli 
# 		 <ccontavalli at masobit.net>
#
#  This program 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.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

test -f ./tools/include/config || {
  echo "must be run from mod-xslt top level directory" 1>&2 
  exit 1
}

rm ./.in &>/dev/null && \
  echo "- .in (yes, it sucks)" 
rm ./debug.out &>/dev/null && \
  echo "- debug.out"
rm ./configure &>/dev/null && \
  echo "- configure"
rm ./aclocal.m4 &>/dev/null && \
  echo "- aclocal.m4"

set -e 
echo "+ autoheader..."
autoheader &&  \
  echo "           done."

echo "+ aclocal..."
aclocal && \
  echo "        done."

echo "+ autoconf..."
autoconf $@ && \
  echo "         done."

set +e 
rm -r config.log &>/dev/null && \
  echo "- config.log"
  
rm -r autom4te.cache &>/dev/null && \
  echo "- autom4te.cache"

rm ./.in &>/dev/null && \
  echo "- .in (yes, it sucks)" 
