temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1 | ## Process this file with autoconf to produce configure. |
| 2 | ## In general, the safest way to proceed is to run ./autogen.sh |
| 3 | |
| 4 | AC_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.com | a001ed0 | 2008-12-01 23:47:49 +0000 | [diff] [blame] | 10 | # * src/Makefile.am (Update -version-info for LDFLAGS if needed) |
kenton@google.com | d415782 | 2008-12-05 22:04:06 +0000 | [diff] [blame] | 11 | AC_INIT([protobuf],[2.0.4-SNAPSHOT],[protobuf@googlegroups.com]) |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 12 | |
| 13 | AC_CONFIG_SRCDIR(src/google/protobuf/message.cc) |
kenton@google.com | c76caac | 2008-09-30 22:11:21 +0000 | [diff] [blame] | 14 | AC_CONFIG_HEADERS([config.h]) |
kenton@google.com | 25bc5cd | 2008-12-04 20:34:50 +0000 | [diff] [blame] | 15 | AC_CONFIG_MACRO_DIR([m4]) |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 16 | AM_INIT_AUTOMAKE |
| 17 | |
kenton@google.com | e59427a | 2009-04-16 22:30:56 +0000 | [diff] [blame] | 18 | AC_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 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 23 | # Checks for programs. |
| 24 | AC_PROG_CC |
| 25 | AC_PROG_CXX |
kenton@google.com | 25bc5cd | 2008-12-04 20:34:50 +0000 | [diff] [blame] | 26 | ACX_USE_SYSTEM_EXTENSIONS |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 27 | AC_PROG_LIBTOOL |
| 28 | AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc |
kenton@google.com | 25bc5cd | 2008-12-04 20:34:50 +0000 | [diff] [blame] | 29 | AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) |
| 30 | |
| 31 | AS_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 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 36 | |
| 37 | # Checks for header files. |
| 38 | AC_HEADER_STDC |
| 39 | AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h]) |
| 40 | |
| 41 | # Checks for library functions. |
| 42 | AC_FUNC_MEMCMP |
| 43 | AC_FUNC_STRTOD |
| 44 | AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol]) |
| 45 | |
kenton@google.com | e59427a | 2009-04-16 22:30:56 +0000 | [diff] [blame] | 46 | HAVE_ZLIB=0 |
| 47 | AS_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])]) |
| 54 | AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1]) |
| 55 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 56 | ACX_PTHREAD |
| 57 | AC_CXX_STL_HASH |
| 58 | |
kenton@google.com | c76caac | 2008-09-30 22:11:21 +0000 | [diff] [blame] | 59 | AC_CONFIG_FILES([Makefile src/Makefile ]) |
| 60 | AC_OUTPUT |