#!/bin/sh

AUTORECONF=${AUTORECONF:-autoreconf}
MAKE=${MAKE:-make}

if ! test -d ${WD}
then
    mkdir -p ${WD} && cd ${WD} \
        || exit $?
fi

# Create autoconf files
if ! test -x configure
then
    ${AUTORECONF} --verbose --install --symlink \
        || exit $?
fi

# Configure OpenPACE
if ! test -r Makefile
then
	./configure \
        || exit $?
fi

# Build OpenPACE
if ! test -x src/eactest
then
    ${MAKE} \
        || exit $?
fi

src/eactest \
    || exit $?
