~statik/ubuntu/maverick/protobuf/A

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2009-11-16 10:41:33 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091116104133-ykhy3deg5l4975tw
Tags: 2.1.0-1ubuntu1
* Merge from Debian testing.
* Remaining Ubuntu changes:
  - Disable the death tests on IA64, now as a quilt patch.
  - Don't use python2.4, also as a quilt patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
# * python/setup.py
9
9
# * src/google/protobuf/stubs/common.h
10
10
# * src/Makefile.am (Update -version-info for LDFLAGS if needed)
11
 
AC_INIT([protobuf],[2.0.3],[protobuf@googlegroups.com])
 
11
#
 
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.)
 
15
AC_INIT([Protocol Buffers],[2.1.0],[protobuf@googlegroups.com],[protobuf])
 
16
 
 
17
# Detect whether the user specified their own compilation flags.  If so then
 
18
# we want to respect their decision, otherwise we will twiddle them later.
 
19
AS_IF([test "$CXXFLAGS" = ""],[
 
20
  protobuf_default_cxxflags=yes
 
21
])
12
22
 
13
23
AC_CONFIG_SRCDIR(src/google/protobuf/message.cc)
14
24
AC_CONFIG_HEADERS([config.h])
15
25
AC_CONFIG_MACRO_DIR([m4])
16
26
AM_INIT_AUTOMAKE
17
27
 
 
28
AC_ARG_WITH([zlib],
 
29
  [AS_HELP_STRING([--with-zlib],
 
30
    [include classes for streaming compressed data in and out @<:@default=check@:>@])],
 
31
  [],[with_zlib=check])
 
32
 
 
33
AC_ARG_WITH([protoc],
 
34
  [AS_HELP_STRING([--with-protoc=COMMAND],
 
35
    [use the given protoc command instead of building a new one when building tests (useful for cross-compiling)])],
 
36
  [],[with_protoc=no])
 
37
 
18
38
# Checks for programs.
19
39
AC_PROG_CC
20
40
AC_PROG_CXX
 
41
AC_LANG([C++])
21
42
ACX_USE_SYSTEM_EXTENSIONS
22
43
AC_PROG_LIBTOOL
23
44
AM_CONDITIONAL(GCC, test "$GCC" = yes)   # let the Makefile know if we're gcc
24
 
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
25
 
 
26
 
AS_IF([test "$SUNCC" = "yes"],[
27
 
  CFLAGS="$CFLAGS -xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
28
 
  CXXFLAGS="$CXXFLAGS -xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4 -template=no%extdef"
 
45
 
 
46
# autoconf's default CXXFLAGS are usually "-g -O2".  These aren't necessarily
 
47
# the best choice for libprotobuf.
 
48
AC_MSG_CHECKING([C++ compiler flags...])
 
49
AS_IF([test "$protobuf_default_cxxflags" = "yes"],[
 
50
 
 
51
  # test_util.cc takes forever to compile with GCC and optimization turned on.
 
52
  # But we cannot override anything that is part of CXXFLAGS since it is the
 
53
  # last thing added to the command line.  The automake docs insist that you
 
54
  # should never want to override CXXFLAGS because they represent the intent of
 
55
  # the user, and the user knows best.  But if the user actually did not set
 
56
  # any CXXFLAGS, then AC_PROG_CXX sets them to a rather arbitrary default.
 
57
  # That's not user intent at all, but automake still treats it like it is.
 
58
  # Grr.  Anyway, getting back to the point, this hack here strips out the -O
 
59
  # flag from autoconf's defaults and puts it into another variable so that
 
60
  # we can override it.  BTW, m4 escaping sucks.
 
61
  PROTOBUF_OPT_FLAG=`echo "$CXXFLAGS" | grep -o '\-O@<:@0-9@:>@\?'`
 
62
  CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ \?-O@<:@0-9@:>@\?//g'`
 
63
 
 
64
  # Protocol Buffers contains several checks that are intended to be used only
 
65
  # for debugging and which might hurt performance.  Most users are probably
 
66
  # end users who don't want these checks, so add -DNDEBUG by default.
 
67
  CXXFLAGS="$CXXFLAGS -DNDEBUG"
 
68
 
 
69
  AC_MSG_RESULT([use default: $PROTOBUF_OPT_FLAG $CXXFLAGS])
 
70
],[
 
71
  PROTOBUF_OPT_FLAG=
 
72
  AC_MSG_RESULT([use user-supplied: $CXXFLAGS])
29
73
])
30
74
 
 
75
AC_SUBST(PROTOBUF_OPT_FLAG)
 
76
 
 
77
ACX_CHECK_SUNCC
31
78
 
32
79
# Checks for header files.
33
80
AC_HEADER_STDC
38
85
AC_FUNC_STRTOD
39
86
AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol])
40
87
 
 
88
HAVE_ZLIB=0
 
89
AS_IF([test "$with_zlib" != no],
 
90
  [AC_SEARCH_LIBS([zlibVersion], [z],
 
91
    [AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.])
 
92
     HAVE_ZLIB=1],
 
93
    [if test "$with_zlib" != check; then
 
94
      AC_MSG_FAILURE([--with-zlib was given, but test for zlib failed])
 
95
     fi])])
 
96
AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
 
97
 
 
98
AS_IF([test "$with_protoc" != "no"], [
 
99
  PROTOC=$with_protoc
 
100
  AS_IF([test "$with_protoc" == "yes"], [
 
101
    # No argument given.  Use system protoc.
 
102
    PROTOC=protoc
 
103
  ])
 
104
  AS_IF([echo "$PROTOC" | grep -q '^@<:@^/@:>@.*/'], [
 
105
    # Does not start with a slash, but contains a slash.  So, it's a relative
 
106
    # path (as opposed to an absolute path or an executable in $PATH).
 
107
    # Since it will actually be executed from the src directory, prefix with
 
108
    # the current directory.  We also insert $ac_top_build_prefix in case this
 
109
    # is a nested package and --with-protoc was actually given on the outer
 
110
    # package's configure script.
 
111
    PROTOC=`pwd`/${ac_top_build_prefix}$PROTOC
 
112
  ])
 
113
  AC_SUBST([PROTOC])
 
114
])
 
115
AM_CONDITIONAL([USE_EXTERNAL_PROTOC], [test "$with_protoc" != "no"])
 
116
 
41
117
ACX_PTHREAD
42
118
AC_CXX_STL_HASH
43
119
 
 
120
AC_CONFIG_SUBDIRS([gtest])
 
121
 
44
122
AC_CONFIG_FILES([Makefile src/Makefile ])
45
123
AC_OUTPUT