6 mirror
=http
://zlib.net
/
16 if ! (test -f $file || curl
$mirror$file -o $file)
18 echo "Could not download $file"
19 echo "If you do not have a direct network connection please download"
21 echo "place it in $srcdir and restart this script"
26 test -d $dir ||
tar xzf
$file || die
"Failed to unpack archive"
28 # initialize Git repository
32 git config core.autocrlf false
&&
34 git commit
-m "Import of $file"
35 ) || die
"Failed to create repository"
38 sysroot
="$(pwd)/sysroot/x86_64-w64-mingw32"
39 cross
="$(pwd)/sysroot/bin/x86_64-w64-mingw32"
40 test -f $dir/example.exe ||
{
42 CC
="$cross-gcc.exe" AR
="$cross-ar.exe" RANLIB
="$cross-ranlib.exe" \
43 .
/configure
--static --prefix=$sysroot --uname=CYGWIN
&&
44 make) || die
"Failed to compile"
48 test -f $sysroot/lib
/libz.a ||
52 for header
in zlib.h zconf.h
54 test -f $sysroot/include
/$header ||
55 cp $dir/$header $sysroot/include
/