cd src/

if [ -n "$MSYSTEM" ]; then
    for a in ../patches/mingw/*.patch; do
        patch -p1 < $a
    done
fi

# Issue #28890: zlib does not use a standard autoconf-generated configure
# script, so don't use the sdh_configure helper as it may have minor
# incompatibilities
./configure --shared --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" || sdh_die "Error configuring $PKG_NAME"

sdh_make -j1
sdh_make_install -j1

sdh_generate_windows_lib_files z
