zlib.h now contains stuff like: #ifdef _LARGEFILE64_SOURCE ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN off64_t ZEXPORT gzseek64 OF((gzFile, off64_t, int)); ZEXTERN off64_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN off64_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, off64_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, off64_t)); #endif afaik, off64_t is a glibc invention not to break the ABI for largefile support. We don't have it on FreeBSD and it breaks packages that try to #include it with lfs flags appended.
hmm, that's a pucker. the fix might be to have configure detect LFS+off64_t support at configure time and then augment that _LARGEFILE64_SOURCE check with a 0/1 ... could you try posting to the zlib list and see if they have a better idea ? http://zlib.net/mailman/listinfo/zlib-devel_madler.net i'm not sure of the off64_t origins, but it isnt specific to glibc. all linux C libraries operate this way i believe.
What about: #if defined(_LARGEFILE64_SOURCE) && !(_FILE_OFFSET_BITS == 64) ? Saw that on Solaris sources and looks like glibc itself also does that through features.h by setting __USE_LARGEFILE64 or __USE_FILE_OFFSET64. So, if _FILE_OFFSET_BITS is 64 (the default on all BSDs), the off64_t types don't show up anywhere, and if it's not 64, and _LARGEFILE64_SOURCE was requested, the off64_t types get defined.
Just for the record, http://lists.freebsd.org/pipermail/freebsd-arch/2010-March/010057.html FreeBSD discussion about the problem.
Looks like the proper approach is being taken by upstream, they're following the spec down to the fine print and also checking that _LFS64_LARGEFILE is provided when _LARGEFILE64_SOURCE is requested. See the new url.
Newest tarball: http://zlib.net/current/beta/zlib-1.2.4.2.tar.gz It still fails on some cases, it needs -#if _LARGEFILE64_SOURCES +#if defined(_LARGEFILE64_SOURCES) in 2 places.
http://zlib.net/current/beta/zlib-1.2.4.3.tar.gz This one is good.
1.2.5 (bug 316343)
zlib-1.2.5 now in the tree