#! /bin/sh
cp version cfg/autoconf/VERSION
cd cfg/autoconf
autoconf
./configure "$@"
if [ "$1" = "--help" ]
then
    echo > /dev/null
else
    cp Makefile.cfg ../Makefile.cfg
    chmod a+rw ../Makefile.cfg
    rm Makefile.cfg
    cp config.h ../config.h
    chmod a+rw ../config.h
    rm config.h
    rm config.log
    rm config.status
fi
rm VERSION
rm configure
