#!/bin/sh

prefix=/Users/mkoeppe/w/4ti2/build-with-system-libs/dest
PKGLIBDIR=${exec_prefix}/lib/4ti2

# We locate where this script is so we can call the executable zsolve which
# should be in the same directory as this script.
SCRIPT=`which "$0"`
SCRIPTDIR=`dirname "$SCRIPT"`
EXECUTABLE=zsolve

for DIR in "$SCRIPTDIR" "$PKGLIBDIR/bin"; do
	if [ -x "$DIR/$EXECUTABLE" ]; then break; fi
done

# Check if zsolve executable exists.
if [ ! -f "$DIR/$EXECUTABLE" ]
then
    echo "Error: Unable to find the executable \`$EXECUTABLE'."
    echo "Error: It should have been in the directory \`$DIR'."
    exit 1
fi

"$DIR"/$EXECUTABLE -H $@
