I expanded on your patch a bit. Can you take a look? http://codereview.appspot.com/117047
On Fri, Aug 28, 2009 at 10:24 AM, Kenton Varda <ken...@google.com> wrote: > I'm planning to submit this when I get a free moment (it's been a very busy > week). In the meantime, have you signed the CLA? > http://code.google.com/legal/individual-cla-v1.0.html -- If you own > copyright on this patch. > <http://code.google.com/legal/individual-cla-v1.0.html> > http://code.google.com/legal/corporate-cla-v1.0.html -- If your employer > does. > > On Sat, Aug 22, 2009 at 6:46 PM, Oliver Jowett <oliver.jow...@gmail.com>wrote: > >> Kenton Varda wrote: >> > Run configure --without-zlib to disable zlib support. Alternatively, >> > fix it and send me a patch. :) >> >> I took a look at fixing it in gzip_stream.{cc,h} (conditionally removing >> GZIP format so you'd get compile errors if you tried to use that on a >> system with an old zlib), but it was going to be awkward without >> breaking backwards compatibility because the default format if not >> specified is GZIP. >> >> So here's a patch that just detects old zlib versions and disables zlib >> support entirely in that case. >> >> I have approximately zero experience in writing autoconf files, so this >> may be completely the wrong approach! I did test it on a couple of >> systems (one with zlib 1.2.3.3, one with zlib 1.1.4) and it appeared to >> do the right thing. >> >> -O >> >> Index: configure.ac >> =================================================================== >> --- configure.ac (revision 221) >> +++ configure.ac (working copy) >> @@ -82,14 +82,24 @@ >> AC_FUNC_STRTOD >> AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol]) >> >> +# Checks for a sufficiently recent zlib >> HAVE_ZLIB=0 >> AS_IF([test "$with_zlib" != no], >> [AC_SEARCH_LIBS([zlibVersion], [z], >> - [AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib >> compression.]) >> - HAVE_ZLIB=1], >> - [if test "$with_zlib" != check; then >> - AC_MSG_FAILURE([--with-zlib was given, but test for zlib failed]) >> - fi])]) >> + [AC_MSG_CHECKING([the zlib version]) >> + AC_COMPILE_IFELSE( >> + AC_LANG_PROGRAM([[ >> +#include <zlib.h> >> +#if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1204) >> +# error zlib version too old >> +#endif >> +]], []), >> + [AC_MSG_RESULT([ok (1.2.0.4 or later)]) >> + AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib >> compression.]) >> + HAVE_ZLIB=1], >> + [AC_MSG_RESULT([too old (1.2.0.3 or earlier)])])])]) >> +AS_IF([test "$with_zlib" != check && test "$HAVE_ZLIB" = 0], >> + [AC_MSG_FAILURE([--with-zlib was given, but test for zlib >> failed])]) >> AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1]) >> >> AS_IF([test "$with_protoc" != "no"], [ >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~----------~----~----~----~------~----~------~--~---