Fixed the zlib 64 bit release script.
[msysgit.git] / src / mingw-w64 / release-zlib.sh
blobe0e009d0478245fec571b91932b30f8776edf38a
1 #!/bin/sh
3 cd "$(dirname "$0")"
4 srcdir=$(pwd)
6 mirror=http://zlib.net/
7 file=zlib-1.2.7.tar.gz
8 dir=${file%.tar.gz}
10 die () {
11 echo "$*" >&2
12 exit 1
15 # download it
16 if ! (test -f $file || curl $mirror$file -o $file)
17 then
18 echo "Could not download $file"
19 echo "If you do not have a direct network connection please download"
20 echo "$mirror$file"
21 echo "place it in $srcdir and restart this script"
22 exit 1
25 # unpack it
26 test -d $dir || tar xzf $file || die "Failed to unpack archive"
28 # initialize Git repository
29 test -d $dir/.git ||
30 (cd $dir &&
31 git init &&
32 git config core.autocrlf false &&
33 git add . &&
34 git commit -m "Import of $file"
35 ) || die "Failed to create repository"
37 # compile it
38 sysroot="$(pwd)/sysroot/x86_64-w64-mingw32"
39 cross="$(pwd)/sysroot/bin/x86_64-w64-mingw32"
40 test -f $dir/example.exe || {
41 (cd $dir &&
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"
47 # install it
48 test -f $sysroot/lib/libz.a ||
49 (cd $dir &&
50 make install)
52 for header in zlib.h zconf.h
54 test -f $sysroot/include/$header ||
55 cp $dir/$header $sysroot/include/
56 done