aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2010-05-29 13:00:38 -0700
committerWink Saville <wink@google.com>2010-05-29 13:00:38 -0700
commitd0332953cda33fb4f8e24ebff9c49159b69c43d6 (patch)
tree81612e8b12f590310aeb0ebf1da37b304eb7baa6 /configure.ac
parentede38fe9b9f93888e6e41afc7abb09525f44da95 (diff)
downloadexternal_protobuf-d0332953cda33fb4f8e24ebff9c49159b69c43d6.zip
external_protobuf-d0332953cda33fb4f8e24ebff9c49159b69c43d6.tar.gz
external_protobuf-d0332953cda33fb4f8e24ebff9c49159b69c43d6.tar.bz2
Add protobuf 2.3.0 sources
This is the contents of protobuf-2.3.0.tar.bz2 from http://code.google.com/p/protobuf/downloads/list. Change-Id: Idfde09ce7ef5ac027b07ee83f2674fbbed5c30b2
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac46
1 files changed, 36 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 11ff427..63322b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@ AC_PREREQ(2.59)
# In the SVN trunk, the version should always be the next anticipated release
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
# the size of one file name in the dist tarfile over the 99-char limit.)
-AC_INIT([Protocol Buffers],[2.2.0a],[protobuf@googlegroups.com],[protobuf])
+AC_INIT([Protocol Buffers],[2.3.0],[protobuf@googlegroups.com],[protobuf])
AC_CONFIG_SRCDIR(src/google/protobuf/message.cc)
@@ -82,14 +82,38 @@ AC_FUNC_MEMCMP
AC_FUNC_STRTOD
AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol])
+# Check for 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])])
+AS_IF([test "$with_zlib" != no], [
+ AC_MSG_CHECKING([zlib version])
+
+ # First check the zlib header 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)])
+
+ # Also need to add -lz to the linker flags and make sure this succeeds.
+ AC_SEARCH_LIBS([zlibVersion], [z], [
+ AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.])
+ HAVE_ZLIB=1
+ ], [
+ AS_IF([test "$with_zlib" != check], [
+ AC_MSG_FAILURE([--with-zlib was given, but no working zlib library was found])
+ ])
+ ])
+ ], [
+ AS_IF([test "$with_zlib" = check], [
+ AC_MSG_RESULT([headers missing or too old (requires 1.2.0.4)])
+ ], [
+ AC_MSG_FAILURE([--with-zlib was given, but zlib headers were not present or were too old (requires 1.2.0.4)])
+ ])
+ ])
+])
AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
AS_IF([test "$with_protoc" != "no"], [
@@ -114,8 +138,10 @@ AM_CONDITIONAL([USE_EXTERNAL_PROTOC], [test "$with_protoc" != "no"])
ACX_PTHREAD
AC_CXX_STL_HASH
-# HACK: Make gtest's configure script pick up our copy of CXXFLAGS, since the
-# flags added by ACX_CHECK_SUNCC must be used when compiling gtest too.
+# HACK: Make gtest's configure script pick up our copy of CFLAGS and CXXFLAGS,
+# since the flags added by ACX_CHECK_SUNCC must be used when compiling gtest
+# too.
+export CFLAGS
export CXXFLAGS
AC_CONFIG_SUBDIRS([gtest])