6 mirror
=http
://www.zlib.net
/
11 test -f $file || curl
$mirror$file > $file ||
exit
14 test -d $dir ||
tar xzf
$file ||
exit
16 # initialize Git repository
18 (cd $dir && git init
&& git add .
&& git commit
-m initial
) ||
exit
21 if ! grep DISABLED_MINGW
$dir/configure
> /dev
/null
2>&1
23 (cd $dir && git apply
--verbose ..
/patch
/zlib-config.
patch) ||
exit
27 sysroot
="$(pwd)/sysroot/x86_64-w64-mingw32"
28 cross
="$(pwd)/sysroot/bin/x86_64-w64-mingw32"
29 test -f $dir/example.exe ||
{
31 CC
="$cross-gcc.exe" AR
="$cross-ar.exe" RANLIB
="$cross-ranlib.exe" \
32 .
/configure
--static --prefix=$sysroot &&
37 test -f $sysroot/lib
/libz.a ||
41 for header
in zlib.h zconf.h
43 test -f $sysroot/include
/$header ||
44 cp $dir/$header $sysroot/include
/