Permalink
Browse files

Fixed the zlib 64 bit release script.

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...
1 parent 763d959 commit 41dd47d6228205ff3738d7a6e115ccf6b1c24205 @patthoyts patthoyts committed Jun 20, 2012
Showing with 14 additions and 26 deletions.
  1. +0 −16 src/mingw-w64/patch/zlib-config.patch
  2. +14 −10 src/mingw-w64/release-zlib.sh
@@ -1,16 +0,0 @@
-diff --git a/configure b/configure
-index bd9edd2..23a9d60 100644
---- a/configure
-+++ b/configure
-@@ -177,9 +177,9 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) >> configure.log 2>&1; then
- *BSD | *bsd* | DragonFly)
- LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
- LDCONFIG="ldconfig -m" ;;
-- CYGWIN* | Cygwin* | cygwin* | OS/2*)
-+ CYGWIN* | Cygwin* | cygwin* | OS/2* | MINGW*)
- EXE='.exe' ;;
-- MINGW* | mingw*)
-+ DISABLED_MINGW* | mingw*)
- # temporary bypass
- rm -f $test.[co] $test $test$shared_ext
- echo "Please use win32/Makefile.gcc instead." | tee -a configure.log
@@ -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
@@ -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

0 comments on commit 41dd47d

Please sign in to comment.