From 41dd47d6228205ff3738d7a6e115ccf6b1c24205 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Wed, 20 Jun 2012 11:53:56 +0100 Subject: [PATCH] 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 --- src/mingw-w64/patch/zlib-config.patch | 16 ---------------- src/mingw-w64/release-zlib.sh | 24 ++++++++++++++---------- 2 files changed, 14 insertions(+), 26 deletions(-) delete mode 100644 src/mingw-w64/patch/zlib-config.patch diff --git a/src/mingw-w64/patch/zlib-config.patch b/src/mingw-w64/patch/zlib-config.patch deleted file mode 100644 index 9056017e3d..0000000000 --- a/src/mingw-w64/patch/zlib-config.patch +++ /dev/null @@ -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 diff --git a/src/mingw-w64/release-zlib.sh b/src/mingw-w64/release-zlib.sh index 3ff9a0995d..e0e009d047 100644 --- a/src/mingw-w64/release-zlib.sh +++ b/src/mingw-w64/release-zlib.sh @@ -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,17 +23,16 @@ 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" @@ -36,8 +40,8 @@ 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