cd src

if [ "$SAGE_DEBUG" = "yes" ]; then
    echo "Building a debug version of libatomic_ops."
    export CFLAGS="-O0 -g $CFLAGS"
else
    export CFLAGS="-O2 -g $CFLAGS"
fi

if [ "$SAGE64" = "yes" ]; then
    echo "Building a 64-bit version of libatomic_ops."
    export CFLAGS="-m64 $CFLAGS"
fi

if [ "$UNAME" = "CYGWIN" ]; then
    LIBATOMIC_OPS_CONFIGURE="$LIBATOMIC_OPS_CONFIGURE --enable-shared --disable-static"
fi

sdh_configure $LIBATOMIC_OPS_CONFIGURE
sdh_make
sdh_make_install
