#!/bin/sh



if [ "$UNAME" = "CYGWIN" ]; then
    which gnuplot
    if [ $? -ne 0 ]; then
        echo "ERROR: You must install the gnuplot clisp package"
        echo "using the gnuplot setup program.  It is in the"
        echo "Mathematics category."
        exit 1
    else
        exit 0
    fi 
else
    ./configure --prefix="$SAGE_LOCAL" --with-readline="$SAGE_LOCAL" --enable-history-file --without-tutorial
fi

if [ $? -ne 0 ]; then
    echo "Error configuring gnuplot"
    exit 1
fi 

make 

if [ $? -ne 0 ]; then
    echo "Error building gnuplot"
    exit 1
fi 

make install

if [ $? -ne 0 ]; then
    echo "Error installing gnuplot"
    exit 1
fi 
