if [ "$SAGE_DEBUG" == "yes" ] ; then
    # Note that -g3 allows you to use preprocessor macros in gdb which are widely used
    CFLAGS="$CFLAGS -O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS"
    #  -DDEBUG_HANDLER_REGISTRATION is broken
fi

source "$SAGE_LOCAL/gap/latest/sysinfo.gap"
echo "GAP was configured with $GAParch_system"

cd src

sdh_configure --disable-static \
              CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
              --with-gap_system_arch="$GAParch_system" \
              --with-sage="$SAGE_LOCAL" --with-gmp="$SAGE_LOCAL"
sdh_make
sdh_make_install
