#!/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 you want to build for multiple architectures, do:
# 
#	% mkdir myarch
#	% cd myarch
#	% ../src/configure [options]
#	% make
#	% make install

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 && ../src/configure "$@"
