#!/bin/sh
# configure script for IO package, Max Neunhoeffer
# usage: ./configure GAPPATH
if [ x"$1" = "x" ]; then 
    GAPPATH=../.. 
    echo "Using ../.. as default GAP path"
else 
    GAPPATH=$1 
fi
if [ ! -e $GAPPATH/sysinfo.gap ]; then
    echo
    echo "Usage: ./configure GAPPATH"
    echo "       where GAPPATH is a path to your GAP installation"
    echo
    echo Either your GAPPATH is incorrect or the GAP it is pointing to
    echo is not properly compiled. Do '\"./configure ; make\"' there first.
    echo
    echo Aborting... No Makefile is generated.
    echo
    exit 1
fi
PKGIOPATH=`pwd`
. $GAPPATH/sysinfo.gap
GAPARCH=$GAParch
export GAPPATH
export PKGIOPATH
export GAPARCH
if test ! -d bin; then mkdir bin; fi
if test ! -d bin/$GAParch; then 
    mkdir -p bin/$GAParch;
fi
cp cnf/configure bin/$GAParch
cp cnf/ioconfig.hin bin/$GAParch
cp Makefile.in bin/$GAParch
cp cnf/config.sub bin/$GAParch
cp cnf/config.guess bin/$GAParch
cp cnf/install-sh bin/$GAParch
cd bin/$GAPARCH
./configure --config-cache
cd $PKGIOPATH
cp bin/$GAParch/Makefile .

