1#!/bin/bash
2
3# Download zlib into parent directory, and verify
4cd ..
5curl -Of http://zlib.net/zlib-1.2.11.tar.gz
6last_exit_code=$?
7if [ $last_exit_code -ne 0 ]; then
8    # There's a newer zlib, and we might want to update this script.  But
9    # download the hardcoded version for now to make the static build work...
10    curl -O http://zlib.net/fossils/zlib-1.2.11.tar.gz
11fi
12
13EXPECTEDCHECKSUM=e6d119755acdf9104d7ba236b1242696940ed6dd
14CHECKSUM=$(shasum zlib-1.2.11.tar.gz | cut -b-40)
15if [ "$EXPECTEDCHECKSUM" != "$CHECKSUM" ]; then
16    echo "Zlib checksum verification failure"
17    exit 1
18fi;
19
20# Unpack and compile zlib
21tar -xzvf zlib-1.2.11.tar.gz
22cd zlib-1.2.11
23./configure
24make
25
26# Compile
27cd ../1.9
28make -f Makefile.std plink
29