blob: fe46c35272be763ee27d4ab0fc541a444b317f1c [file] [log] [blame]
temporal40ee5512008-07-10 02:12:20 +00001## Process this file with autoconf to produce configure.
2## In general, the safest way to proceed is to run ./autogen.sh
3
4AC_PREREQ(2.59)
5
6# Note: If you change the version, you must also update it in:
7# * java/pom.xml
8# * python/setup.py
9# * src/google/protobuf/stubs/common.h
kenton@google.coma001ed02008-12-01 23:47:49 +000010# * src/Makefile.am (Update -version-info for LDFLAGS if needed)
kenton@google.com37ad00d2009-04-21 21:00:39 +000011#
12# In the SVN trunk, the version should always be the next anticipated release
13# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
14# the size of one file name in the dist tarfile over the 99-char limit.)
15AC_INIT([Protocol Buffers],[2.0.4-pre],[protobuf@googlegroups.com],[protobuf])
temporal40ee5512008-07-10 02:12:20 +000016
17AC_CONFIG_SRCDIR(src/google/protobuf/message.cc)
kenton@google.comc76caac2008-09-30 22:11:21 +000018AC_CONFIG_HEADERS([config.h])
kenton@google.com25bc5cd2008-12-04 20:34:50 +000019AC_CONFIG_MACRO_DIR([m4])
temporal40ee5512008-07-10 02:12:20 +000020AM_INIT_AUTOMAKE
21
kenton@google.come59427a2009-04-16 22:30:56 +000022AC_ARG_WITH([zlib],
23 [AS_HELP_STRING([--with-zlib],
24 [include classes for streaming compressed data in and out @<:@default=check@:>@])],
25 [],[with_zlib=check])
26
temporal40ee5512008-07-10 02:12:20 +000027# Checks for programs.
28AC_PROG_CC
29AC_PROG_CXX
kenton@google.com37ad00d2009-04-21 21:00:39 +000030AC_LANG([C++])
kenton@google.com25bc5cd2008-12-04 20:34:50 +000031ACX_USE_SYSTEM_EXTENSIONS
temporal40ee5512008-07-10 02:12:20 +000032AC_PROG_LIBTOOL
33AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
kenton@google.com25bc5cd2008-12-04 20:34:50 +000034AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
35
36AS_IF([test "$SUNCC" = "yes"],[
37 CFLAGS="$CFLAGS -xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
38 CXXFLAGS="$CXXFLAGS -xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4 -template=no%extdef"
39])
40
temporal40ee5512008-07-10 02:12:20 +000041
42# Checks for header files.
43AC_HEADER_STDC
44AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h])
45
46# Checks for library functions.
47AC_FUNC_MEMCMP
48AC_FUNC_STRTOD
49AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol])
50
kenton@google.come59427a2009-04-16 22:30:56 +000051HAVE_ZLIB=0
52AS_IF([test "$with_zlib" != no],
53 [AC_SEARCH_LIBS([zlibVersion], [z],
54 [AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.])
55 HAVE_ZLIB=1],
56 [if test "$with_zlib" != check; then
57 AC_MSG_FAILURE([--with-zlib was given, but test for zlib failed])
58 fi])])
59AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
60
temporal40ee5512008-07-10 02:12:20 +000061ACX_PTHREAD
62AC_CXX_STL_HASH
63
kenton@google.com37ad00d2009-04-21 21:00:39 +000064AC_CONFIG_SUBDIRS([gtest])
65
kenton@google.comc76caac2008-09-30 22:11:21 +000066AC_CONFIG_FILES([Makefile src/Makefile ])
67AC_OUTPUT