blob: 2824960bf3d372fab48d7c0051c77ca51663b832 [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.comd4157822008-12-05 22:04:06 +000011AC_INIT([protobuf],[2.0.4-SNAPSHOT],[protobuf@googlegroups.com])
temporal40ee5512008-07-10 02:12:20 +000012
13AC_CONFIG_SRCDIR(src/google/protobuf/message.cc)
kenton@google.comc76caac2008-09-30 22:11:21 +000014AC_CONFIG_HEADERS([config.h])
kenton@google.com25bc5cd2008-12-04 20:34:50 +000015AC_CONFIG_MACRO_DIR([m4])
temporal40ee5512008-07-10 02:12:20 +000016AM_INIT_AUTOMAKE
17
kenton@google.come59427a2009-04-16 22:30:56 +000018AC_ARG_WITH([zlib],
19 [AS_HELP_STRING([--with-zlib],
20 [include classes for streaming compressed data in and out @<:@default=check@:>@])],
21 [],[with_zlib=check])
22
temporal40ee5512008-07-10 02:12:20 +000023# Checks for programs.
24AC_PROG_CC
25AC_PROG_CXX
kenton@google.com25bc5cd2008-12-04 20:34:50 +000026ACX_USE_SYSTEM_EXTENSIONS
temporal40ee5512008-07-10 02:12:20 +000027AC_PROG_LIBTOOL
28AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
kenton@google.com25bc5cd2008-12-04 20:34:50 +000029AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
30
31AS_IF([test "$SUNCC" = "yes"],[
32 CFLAGS="$CFLAGS -xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
33 CXXFLAGS="$CXXFLAGS -xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4 -template=no%extdef"
34])
35
temporal40ee5512008-07-10 02:12:20 +000036
37# Checks for header files.
38AC_HEADER_STDC
39AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h])
40
41# Checks for library functions.
42AC_FUNC_MEMCMP
43AC_FUNC_STRTOD
44AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol])
45
kenton@google.come59427a2009-04-16 22:30:56 +000046HAVE_ZLIB=0
47AS_IF([test "$with_zlib" != no],
48 [AC_SEARCH_LIBS([zlibVersion], [z],
49 [AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.])
50 HAVE_ZLIB=1],
51 [if test "$with_zlib" != check; then
52 AC_MSG_FAILURE([--with-zlib was given, but test for zlib failed])
53 fi])])
54AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
55
temporal40ee5512008-07-10 02:12:20 +000056ACX_PTHREAD
57AC_CXX_STL_HASH
58
kenton@google.comc76caac2008-09-30 22:11:21 +000059AC_CONFIG_FILES([Makefile src/Makefile ])
60AC_OUTPUT