#!/bin/sh
#
# The real work is done in the `src' directory.  This is just here to
# allow for the standard ./configure && make && make install sequence
# from the topdirectory

if [ -z "$BUILDARCH" ]; then
  BUILDARCH=src;
else
  if [ ! -d "$BUILDARCH" ]; then mkdir "$BUILDARCH"; fi
fi
if [ -z "$MAKE" ]; then MAKE=make; fi

sed -e "s/@BUILDARCH@/$BUILDARCH/" -e "s/@MAKE@/$MAKE/" Makefile.in > Makefile

cd $BUILDARCH
if [ ! -r config.status -o config.status -ot configure ]; then
  ../src/configure "$@"
  exit $?
fi
