cross-zlib: Update to 1.3

sync patches with the mingw zlib package
This commit is contained in:
Christoph Reiter 2023-11-11 20:59:00 +01:00
parent 85307d192e
commit c8aeaed5dd
5 changed files with 59 additions and 50 deletions

View File

@ -1,5 +1,5 @@
--- zlib-1.2.11/configure.orig 2016-12-31 21:06:40.000000000 +0300 --- a/configure
+++ zlib-1.2.11/configure 2017-01-17 08:32:52.101363500 +0300 +++ b/configure
@@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
# destination name for static library # destination name for static library
@ -17,32 +17,30 @@
includedir=${includedir-'${prefix}/include'} includedir=${includedir-'${prefix}/include'}
mandir=${mandir-'${prefix}/share/man'} mandir=${mandir-'${prefix}/share/man'}
shared_ext='.so' shared_ext='.so'
@@ -89,6 +90,7 @@ @@ -90,6 +91,7 @@
debug=0 sanitize=0
old_cc="$CC" old_cc="$CC"
old_cflags="$CFLAGS" old_cflags="$CFLAGS"
+old_ldflags="$LDFLAGS" +old_ldflags="$LDFLAGS"
OBJC='$(OBJZ) $(OBJG)' OBJC='$(OBJZ) $(OBJG)'
PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)' PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
@@ -213,14 +215,24 @@ @@ -224,12 +226,23 @@
LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"}
LDCONFIG="ldconfig -m" ;; LDCONFIG="ldconfig -m" ;;
CYGWIN* | Cygwin* | cygwin* | OS/2*) CYGWIN* | Cygwin* | cygwin* | *-cygwin* | OS/2*)
+ CFLAGS="${CFLAGS} -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64" + CFLAGS="${CFLAGS} -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64"
+ SFLAGS="${CFLAGS}" + SFLAGS="${CFLAGS}"
+ LDFLAGS="-L. ${old_ldflags}" + LDFLAGS="-L. ${old_ldflags}"
+ shared_ext=".dll" + shared_ext=".dll"
+ SHAREDLIB='cygz.dll' + SHAREDLIB='cygz.dll'
+ IMPORTLIB='libz.dll.a' + IMPORTLIB='libz.dll.a'
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-export-all -Wl,--enable-auto-image-base -Wl,--out-implib=${IMPORTLIB}"} + LDSHARED=${LDSHARED-"$cc -shared -Wl,--export-all-symbols -Wl,--enable-auto-image-base -Wl,--out-implib=${IMPORTLIB}"}
+ LDSHAREDLIBC='' + LDSHAREDLIBC=''
EXE='.exe' ;; EXE='.exe' ;;
MINGW* | mingw*) MINGW* | mingw* | *-mingw*)
# temporary bypass
- rm -f $test.[co] $test $test$shared_ext - rm -f $test.[co] $test $test$shared_ext
- echo "Please use win32/Makefile.gcc instead." | tee -a configure.log - echo "If this doesn't work for you, try win32/Makefile.gcc." | tee -a configure.log
- leave 1
- LDSHARED=${LDSHARED-"$cc -shared"} - LDSHARED=${LDSHARED-"$cc -shared"}
- LDSHAREDLIBC="" - LDSHAREDLIBC=""
+ SFLAGS="${CFLAGS}" + SFLAGS="${CFLAGS}"
@ -50,12 +48,12 @@
+ shared_ext=".dll" + shared_ext=".dll"
+ SHAREDLIB='zlib1.dll' + SHAREDLIB='zlib1.dll'
+ IMPORTLIB='libz.dll.a' + IMPORTLIB='libz.dll.a'
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-export-all -Wl,--enable-auto-image-base -Wl,--out-implib=${IMPORTLIB}"} + LDSHARED=${LDSHARED-"$cc -shared -Wl,--export-all-symbols -Wl,--enable-auto-image-base -Wl,--out-implib=${IMPORTLIB}"}
+ LDSHAREDLIBC='' + LDSHAREDLIBC=''
EXE='.exe' ;; EXE='.exe' ;;
QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
# (alain.bonnefoy@icbt.com) # (alain.bonnefoy@icbt.com)
@@ -344,11 +356,32 @@ @@ -355,11 +367,32 @@
esac esac
fi fi
@ -89,7 +87,7 @@
echo >> configure.log echo >> configure.log
# define functions for testing compiler and library characteristics and logging the results # define functions for testing compiler and library characteristics and logging the results
@@ -847,6 +880,9 @@ @@ -854,6 +887,9 @@
echo SHAREDLIBM = $SHAREDLIBM >> configure.log echo SHAREDLIBM = $SHAREDLIBM >> configure.log
echo SHAREDLIBV = $SHAREDLIBV >> configure.log echo SHAREDLIBV = $SHAREDLIBV >> configure.log
echo STATICLIB = $STATICLIB >> configure.log echo STATICLIB = $STATICLIB >> configure.log
@ -98,8 +96,8 @@
+echo SHAREDTARGET = $SHAREDTARGET >> configure.log +echo SHAREDTARGET = $SHAREDTARGET >> configure.log
echo TEST = $TEST >> configure.log echo TEST = $TEST >> configure.log
echo VER = $VER >> configure.log echo VER = $VER >> configure.log
echo Z_U4 = $Z_U4 >> configure.log echo SRCDIR = $SRCDIR >> configure.log
@@ -868,9 +904,12 @@ @@ -874,9 +910,12 @@
/^LDSHARED *=/s#=.*#=$LDSHARED# /^LDSHARED *=/s#=.*#=$LDSHARED#
/^CPP *=/s#=.*#=$CPP# /^CPP *=/s#=.*#=$CPP#
/^STATICLIB *=/s#=.*#=$STATICLIB# /^STATICLIB *=/s#=.*#=$STATICLIB#
@ -112,7 +110,7 @@
/^AR *=/s#=.*#=$AR# /^AR *=/s#=.*#=$AR#
/^ARFLAGS *=/s#=.*#=$ARFLAGS# /^ARFLAGS *=/s#=.*#=$ARFLAGS#
/^RANLIB *=/s#=.*#=$RANLIB# /^RANLIB *=/s#=.*#=$RANLIB#
@@ -899,9 +938,12 @@ @@ -905,9 +944,12 @@
/^CPP *=/s#=.*#=$CPP# /^CPP *=/s#=.*#=$CPP#
/^LDSHARED *=/s#=.*#=$LDSHARED# /^LDSHARED *=/s#=.*#=$LDSHARED#
/^STATICLIB *=/s#=.*#=$STATICLIB# /^STATICLIB *=/s#=.*#=$STATICLIB#
@ -125,11 +123,11 @@
/^AR *=/s#=.*#=$AR# /^AR *=/s#=.*#=$AR#
/^ARFLAGS *=/s#=.*#=$ARFLAGS# /^ARFLAGS *=/s#=.*#=$ARFLAGS#
/^RANLIB *=/s#=.*#=$RANLIB# /^RANLIB *=/s#=.*#=$RANLIB#
--- zlib-1.2.11/Makefile.in.orig 2017-01-15 20:29:40.000000000 +0300 --- a/Makefile.in
+++ zlib-1.2.11/Makefile.in 2017-01-17 08:53:10.064299400 +0300 +++ b/Makefile.in
@@ -34,6 +34,9 @@ @@ -34,6 +34,9 @@
SHAREDLIB=libz.so SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.11 SHAREDLIBV=libz.so.1.2.12
SHAREDLIBM=libz.so.1 SHAREDLIBM=libz.so.1
+IMPORTLIB= +IMPORTLIB=
+SHAREDLIBPOST='(rm -f $(SHAREDLIB) $(SHAREDLIBM); ln -s $@ $(SHAREDLIB) ; ln -s $@ $(SHAREDLIBM) )' +SHAREDLIBPOST='(rm -f $(SHAREDLIB) $(SHAREDLIBM); ln -s $@ $(SHAREDLIB) ; ln -s $@ $(SHAREDLIBM) )'
@ -169,19 +167,19 @@
-@rmdir objs -@rmdir objs
example$(EXE): example.o $(STATICLIB) example$(EXE): example.o $(STATICLIB)
@@ -292,11 +292,11 @@ @@ -291,11 +292,11 @@
minigzip$(EXE): minigzip.o $(STATICLIB) minigzip$(EXE): minigzip.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
-examplesh$(EXE): example.o $(SHAREDLIBV) -examplesh$(EXE): example.o $(SHAREDLIBV)
- $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV) - $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV)
+examplesh$(EXE): example.o $(SHAREDTARGET) +examplesh$(EXE): example.o $(SHAREDTARGET)
+ $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDTARGET) + $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(IMPORTLIB)
-minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) -minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
- $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV) - $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV)
+minigzipsh$(EXE): minigzip.o $(SHAREDTARGET) +minigzipsh$(EXE): minigzip.o $(SHAREDTARGET)
+ $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDTARGET) + $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(IMPORTLIB)
example64$(EXE): example64.o $(STATICLIB) example64$(EXE): example64.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)

View File

@ -1,11 +0,0 @@
--- a/zlib-1.2.7/contrib/minizip/Makefile.am.orig 2013-03-31 04:43:24 +0400
+++ b/zlib-1.2.7/contrib/minizip/Makefile.am 2013-03-31 04:45:10 +0400
@@ -8,7 +8,7 @@
zlib_top_builddir = $(top_builddir)/../..
AM_CPPFLAGS = -I$(zlib_top_srcdir)
-AM_LDFLAGS = -L$(zlib_top_builddir)
+AM_LDFLAGS = -L$(zlib_top_builddir) -no-undefined
if WIN32
iowin32_src = iowin32.c

View File

@ -1,5 +1,5 @@
--- a/zlib-1.2.7/zlib.pc.in.orig 2013-03-31 22:30:40 +0400 --- a/zlib.pc.in
+++ b/zlib-1.2.7/zlib.pc.in 2013-04-03 02:06:26 +0400 +++ b/zlib.pc.in
@@ -9,5 +9,5 @@ @@ -9,5 +9,5 @@
Version: @VERSION@ Version: @VERSION@

View File

@ -0,0 +1,22 @@
--- a/zconf.h.in
+++ b/zconf.h.in
@@ -504,7 +504,7 @@
# define z_off_t long
#endif
-#if !defined(_WIN32) && defined(Z_LARGE64)
+#if (defined(_WIN32) && defined(__GNUC__) && defined(_LARGEFILE64_SOURCE)) || defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
--- a/zconf.h.cmakein
+++ b/zconf.h.cmakein
@@ -506,7 +506,7 @@
# define z_off_t long
#endif
-#if !defined(_WIN32) && defined(Z_LARGE64)
+#if (defined(_WIN32) && defined(__GNUC__) && defined(_LARGEFILE64_SOURCE)) || defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)

View File

@ -4,8 +4,8 @@ _realname=zlib
_mingw_suff=mingw-w64-cross _mingw_suff=mingw-w64-cross
pkgname=("${_mingw_suff}-${_realname}") pkgname=("${_mingw_suff}-${_realname}")
pkgdesc="Compression library implementing the deflate compression method found in gzip and PKZIP" pkgdesc="Compression library implementing the deflate compression method found in gzip and PKZIP"
pkgver=1.2.11 pkgver=1.3
pkgrel=2 pkgrel=1
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://mingw-w64.sourceforge.io/" url="https://mingw-w64.sourceforge.io/"
license=('custom') license=('custom')
@ -15,12 +15,12 @@ makedepends=("${_mingw_suff}-gcc" 'autotools')
options=('!buildflags') options=('!buildflags')
source=("https://zlib.net/fossils/${_realname}-${pkgver}.tar.gz" source=("https://zlib.net/fossils/${_realname}-${pkgver}.tar.gz"
01-zlib-1.2.11-1-buildsys.mingw.patch 01-zlib-1.2.11-1-buildsys.mingw.patch
02-no-undefined.mingw.patch 03-dont-put-sodir-into-L.mingw.patch
03-dont-put-sodir-into-L.mingw.patch) 04-fix-largefile-support.patch)
sha256sums=('c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1' sha256sums=('ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e'
'ac91f905b695d71f6c9c471ac98c14a3ed989a1e2b2a3b1171b3f6dc6bfc31b4' '8175e70c980ffc48a2e90c6f0431ddb80ef6ff690f9e8906dd6a756238552fa5'
'44e23000cc4cb7502f303aa252be17ffee66384fe76a66607dc1f4df0a815030' '7287d12db57dcf0f66964c861100bf06ebe1ddcb243e7ee0773fcab1b2935596'
'3d039f42194aade91dadf4174f55fd6db349fd8044db93875bed1042dcfe1f31') '4d8ebda55b95d19cd7c467c486d4c42d2bad6db9ff5dca361f6d8c24120e5f30')
msys2_references=( msys2_references=(
'archlinux: zlib' 'archlinux: zlib'
) )
@ -32,8 +32,8 @@ prepare() {
grep -A 24 '^ Copyright' zlib.h > LICENSE grep -A 24 '^ Copyright' zlib.h > LICENSE
patch -p1 -i ${srcdir}/01-zlib-1.2.11-1-buildsys.mingw.patch patch -p1 -i ${srcdir}/01-zlib-1.2.11-1-buildsys.mingw.patch
patch -p2 -i ${srcdir}/02-no-undefined.mingw.patch patch -p1 -i ${srcdir}/03-dont-put-sodir-into-L.mingw.patch
patch -p2 -i ${srcdir}/03-dont-put-sodir-into-L.mingw.patch patch -p1 -i ${srcdir}/04-fix-largefile-support.patch
} }
build() { build() {