6 mirror
=http
://zlib.net
/
11 if ! (test -f $file || curl
$mirror$file -o $file)
13 echo "Could not download $file"
14 echo "If you do not have a direct network connection please download"
16 echo "place it in $srcdir and restart this script"
21 test -d $dir ||
tar xzf
$file ||
exit
23 # initialize Git repository
25 (cd $dir && git init
&& git add .
&& git commit
-m initial
) ||
exit
28 if ! grep DISABLED_MINGW
$dir/configure
> /dev
/null
2>&1
30 (cd $dir && git apply
--verbose ..
/patch
/zlib-config.
patch) ||
exit
34 sysroot
="$(pwd)/sysroot/x86_64-w64-mingw32"
35 cross
="$(pwd)/sysroot/bin/x86_64-w64-mingw32"
36 test -f $dir/example.exe ||
{
38 CC
="$cross-gcc.exe" AR
="$cross-ar.exe" RANLIB
="$cross-ranlib.exe" \
39 .
/configure
--static --prefix=$sysroot &&
44 test -f $sysroot/lib
/libz.a ||
48 for header
in zlib.h zconf.h
50 test -f $sysroot/include
/$header ||
51 cp $dir/$header $sysroot/include
/