Skip to content

Commit

Permalink
Fixed the zlib 64 bit release script.
Browse files Browse the repository at this point in the history
The patch is can be replaced by providing a command line option.
Improved the handling of errors in the script.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
  • Loading branch information
patthoyts committed Jun 20, 2012
1 parent 763d959 commit 41dd47d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
16 changes: 0 additions & 16 deletions src/mingw-w64/patch/zlib-config.patch

This file was deleted.

24 changes: 14 additions & 10 deletions src/mingw-w64/release-zlib.sh
Expand Up @@ -7,6 +7,11 @@ mirror=http://zlib.net/
file=zlib-1.2.7.tar.gz
dir=${file%.tar.gz}

die () {
echo "$*" >&2
exit 1
}

# download it
if ! (test -f $file || curl $mirror$file -o $file)
then
Expand All @@ -18,26 +23,25 @@ then
fi

# unpack it
test -d $dir || tar xzf $file || exit
test -d $dir || tar xzf $file || die "Failed to unpack archive"

# initialize Git repository
test -d $dir/.git ||
(cd $dir && git init && git add . && git commit -m initial) || exit

# patch it
if ! grep DISABLED_MINGW $dir/configure > /dev/null 2>&1
then
(cd $dir && git apply --verbose ../patch/zlib-config.patch) || exit
fi
(cd $dir &&
git init &&
git config core.autocrlf false &&
git add . &&
git commit -m "Import of $file"
) || die "Failed to create repository"

# compile it
sysroot="$(pwd)/sysroot/x86_64-w64-mingw32"
cross="$(pwd)/sysroot/bin/x86_64-w64-mingw32"
test -f $dir/example.exe || {
(cd $dir &&
CC="$cross-gcc.exe" AR="$cross-ar.exe" RANLIB="$cross-ranlib.exe" \
./configure --static --prefix=$sysroot &&
make) || exit
./configure --static --prefix=$sysroot --uname=CYGWIN &&
make) || die "Failed to compile"
}

# install it
Expand Down

0 comments on commit 41dd47d

Please sign in to comment.