#! /bin/sh
CONFIG_FILES=""
for arg 
do
    if [ -s $arg.in ] ; then 
        # If relative local path, make it absolute
        hasslash=`echo $arg | sed -e 's%/.*/%%g'`
        if [ "$hasslash" = "$arg" ] ; then
	    arg="`pwd`/$arg"
        fi
        CONFIG_FILES="$CONFIG_FILES $arg" 
    elif [ -s /usr/ports/net/mpich/work/mpich-1.2.3/mpe/$arg.in ] ; then
        CONFIG_FILES="$CONFIG_FILES /usr/ports/net/mpich/work/mpich-1.2.3/mpe/$arg" 
    else
        echo "Cannot find file $arg"
	exit 1
    fi
done
export CONFIG_FILES
PREFIX="/usr/local/mpich"
# First, try the device/architecture specific config.status
# Our first try is for the mpireconfig.dat in the same directory as this script
# came from if it is specifically set.
mydir=`echo $0 | sed 's%/[^/][^/]*$%%'`
if [ -x $mydir/mpereconfig.dat ] ; then
    CONFIG_HEADERS=""
    export CONFIG_HEADERS
    $mydir/mpereconfig.dat 
elif [ -x /usr/local/mpich/bin/mpereconfig.dat ] ; then
    CONFIG_HEADERS=""
    export CONFIG_HEADERS
    /usr/local/mpich/bin/mpereconfig.dat 
elif [ -x /usr/local/mpich/bin/mpereconfig.dat ] ; then
    CONFIG_HEADERS=""
    export CONFIG_HEADERS
    /usr/local/mpich/bin/mpereconfig.dat 
elif [ -x /usr/ports/net/mpich/work/mpich-1.2.3/mpe/config.status ] ; then
    # Export the location of mpeconf.h.in
    #CONFIG_HEADERS="/usr/ports/net/mpich/work/mpich-1.2.3/mpe/mpeconf.h"
    CONFIG_HEADERS=""
    export CONFIG_HEADERS
    /usr/ports/net/mpich/work/mpich-1.2.3/mpe/config.status
else
    echo "A config.status file is needed to perform a reconfig of a file"
    exit 1
fi
