#! /bin/sh
#
# $Id: bootstrap,v 1.4 2005/05/17 21:26:17 cjohns Exp $
#
# ------------------------------------------------------------------------
#
# My Right Boot, a boot ROM for embedded hardware.
#
# ------------------------------------------------------------------------
#
# Copyright (c) 2002, Cybertec Pty Ltd.
# All rights reserved.
#
#                      LICENSE INFORMATION
#
# My Right Boot is free software; you can redistribute it and/or modify it 
# under terms of the GNU General Public License as published by the Free 
# Software Foundation; either version 2, or (at your option) any later
# version.  
# 
# My Right Boot 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 My Right Boot; see file COPYING. If not, write
# to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
# As a special exception, including a My Right Boot header files in a file,
# instantiating My Right Boot generics or templates, or linking other files
# with My Right Boot objects to produce an executable application, does not
# by itself cause the resulting executable application to be covered by the
# GNU General Public License. This exception does not however invalidate any
# other reasons why the executable file might be covered by the GNU Public
# License.
#
# The Cybertec copyright and license notice must remain in this file and any
# derived file.
#
# ------------------------------------------------------------------------
#
# Bootstrap the auto* stuff.
#

configure_list=`find . -name configure.in | sed -e "s/^\.\///g"`

for c in $configure_list 
do
  echo "Processing $c"

  config=`echo $c | sed -e "s/[^\/]*\//..\//g" -e "s/configure.in/config/g"`

  pushd `dirname $c` > /dev/null

  aclocal -I ${config}
  grep -q "AC_CONFIG_HEADERS" configure.in && autoheader
  grep -q "AM_CONFIG_HEADER" configure.in && autoheader
  automake --foreign --add-missing --copy
  autoconf

  popd > /dev/null
done
