configure.ac 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ## Process this file with autoconf to produce configure.
  2. ## In general, the safest way to proceed is to run ./autogen.sh
  3. AC_PREREQ(2.59)
  4. # Note: If you change the version, you must also update it in:
  5. # * java/pom.xml
  6. # * python/setup.py
  7. # * src/google/protobuf/stubs/common.h
  8. # * src/Makefile.am (Update -version-info for LDFLAGS if needed)
  9. #
  10. # In the SVN trunk, the version should always be the next anticipated release
  11. # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
  12. # the size of one file name in the dist tarfile over the 99-char limit.)
  13. AC_INIT([Protocol Buffers],[2.0.4-pre],[protobuf@googlegroups.com],[protobuf])
  14. AC_CONFIG_SRCDIR(src/google/protobuf/message.cc)
  15. AC_CONFIG_HEADERS([config.h])
  16. AC_CONFIG_MACRO_DIR([m4])
  17. AM_INIT_AUTOMAKE
  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. # Checks for programs.
  23. AC_PROG_CC
  24. AC_PROG_CXX
  25. AC_LANG([C++])
  26. ACX_USE_SYSTEM_EXTENSIONS
  27. AC_PROG_LIBTOOL
  28. AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
  29. AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
  30. AS_IF([test "$SUNCC" = "yes"],[
  31. CFLAGS="$CFLAGS -xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
  32. CXXFLAGS="$CXXFLAGS -xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4 -template=no%extdef"
  33. ])
  34. # Checks for header files.
  35. AC_HEADER_STDC
  36. AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h])
  37. # Checks for library functions.
  38. AC_FUNC_MEMCMP
  39. AC_FUNC_STRTOD
  40. AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol])
  41. HAVE_ZLIB=0
  42. AS_IF([test "$with_zlib" != no],
  43. [AC_SEARCH_LIBS([zlibVersion], [z],
  44. [AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.])
  45. HAVE_ZLIB=1],
  46. [if test "$with_zlib" != check; then
  47. AC_MSG_FAILURE([--with-zlib was given, but test for zlib failed])
  48. fi])])
  49. AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
  50. ACX_PTHREAD
  51. AC_CXX_STL_HASH
  52. AC_CONFIG_SUBDIRS([gtest])
  53. AC_CONFIG_FILES([Makefile src/Makefile ])
  54. AC_OUTPUT