Fix zlib compilation for 64-bit
[msysgit.git] / src / mingw-w64 / release-zlib.sh
blob5cbb10aed9cfaaec4b32d22ef63c66132c3f6c0d
1 #!/bin/sh
3 cd "$(dirname "$0")"
4 srcdir=$(pwd)
6 mirror=http://www.zlib.net/
7 file=zlib-1.2.5.tar.gz
8 dir=${file%.tar.gz}
10 # download it
11 test -f $file || curl $mirror$file > $file || exit
13 # unpack it
14 test -d $dir || tar xzf $file || exit
16 # initialize Git repository
17 test -d $dir/.git ||
18 (cd $dir && git init && git add . && git commit -m initial) || exit
20 # patch it
21 if ! grep DISABLED_MINGW $dir/configure > /dev/null 2>&1
22 then
23 (cd $dir && git apply --verbose ../patch/zlib-config.patch) || exit
26 # compile it
27 sysroot="$(pwd)/sysroot/x86_64-w64-mingw32"
28 cross="$(pwd)/sysroot/bin/x86_64-w64-mingw32"
29 test -f $dir/example.exe || {
30 (cd $dir &&
31 CC="$cross-gcc.exe" AR="$cross-ar.exe" RANLIB="$cross-ranlib.exe" \
32 ./configure --static --prefix=$sysroot &&
33 make) || exit
36 # install it
37 test -f $sysroot/lib/libz.a ||
38 (cd $dir &&
39 make install)
41 for header in zlib.h zconf.h
43 test -f $sysroot/include/$header ||
44 cp $dir/$header $sysroot/include/
45 done