cd src || exit

INCLUDES="-I$SAGE_LOCAL/include/"

CXXFLAGS="$CXXFLAGS -fPIC $INCLUDES -L$SAGE_LOCAL/lib"
CPPFLAGS="$INCLUDES"
CONFIGUREFLAGS="--prefix=$SAGE_LOCAL --libdir=$SAGE_LOCAL/lib"

if [ "x$SAGE_DEBUG" = "xyes" ]; then
   CONFIGUREFLAGS="$CONFIGUREFLAGS --enable-debug"
fi

if [ -x "$SAGE_LOCAL"/bin/gcc ]; then
    # Issue #31624: Avoid C++ ABI issues
    CONFIGUREFLAGS="$CONFIGUREFLAGS --without-qd"
fi

export CXXFLAGS="$CXXFLAGS"
export CPPFLAGS="$CPPFLAGS"
export CXX="$CXX"

sdh_configure $CONFIGUREFLAGS
sdh_make
sdh_make_install
