#!/usr/bin/env bash
unset RM
if [ "$SAGE_LOCAL" = "" ]; then
echo "SAGE_LOCAL undefined ... exiting"
echo "Maybe run 'sage -sh'?"
exit 1
fi
if [ "$SAGE64" = "yes" ]; then
CFLAGS="$CFLAGS -m64";
CXXFLAGS="$CXXFLAGS -m64";
# FIXME: Do we need LDFLAGS here, too?
# But looks as if all linking is performed by libtool/
# gcc, so we do not really need it here.
# In general, "-m64" should be added to CPPFLAGS and
# CXXFLAGS as well. (There are no C++ sources though.)
fi
INCLUDES="-I$SAGE_LOCAL/include"
LIBDIRS="-L$SAGE_LOCAL/lib"
CFLAGS="$CFLAGS $INCLUDES $LIBDIRS -g"
CXXFLAGS="$CXXFLAGS $INCLUDES $LIBDIRS -g"
export CFLAGS
export CXXFLAGS
cd src
echo "Testing the M4RI library"
$MAKE check
if [ $? -ne 0 ]; then
echo "Error testing M4RI"
exit 1
fi