if [ -z "$SAGE_LOCAL" ] ; then
    echo >&2 "Error - SAGE_LOCAL undefined ... exiting"
    echo >&2 "Maybe run 'sage -sh'?"
    exit 1
fi
cd src

./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" \
	    --enable-utf --enable-unicode-properties --enable-jit
if [ $? -ne 0 ]; then
    echo >&2 "Error configuring pcre."
    exit 1
fi

$MAKE
if [ $? -ne 0 ]; then
    echo >&2 "Error building pcre."
    exit 1
fi

$MAKE install
if [ $? -ne 0 ]; then
    echo >&2 "Error installing pcre."
    exit 1
fi
