David Reiss | feab773 | 2009-03-30 22:52:44 +0000 | [diff] [blame] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
Bryan Duxbury | 5d74262 | 2010-08-19 21:02:19 +0000 | [diff] [blame] | 20 | AC_PREREQ(2.65) |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 21 | |
Bryan Duxbury | e1ae6b4 | 2010-09-28 17:44:45 +0000 | [diff] [blame] | 22 | AC_INIT([thrift], [0.6.0-dev]) |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 23 | |
| 24 | AC_CONFIG_AUX_DIR([.]) |
| 25 | |
| 26 | AM_INIT_AUTOMAKE |
| 27 | |
David Reiss | d683219 | 2007-09-05 00:47:32 +0000 | [diff] [blame] | 28 | AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules. |
| 29 | (Normal --prefix is ignored for Python because |
| 30 | Python has different conventions.) |
| 31 | Default = "/usr"]) |
David Reiss | cdd6f3c | 2008-03-04 21:10:29 +0000 | [diff] [blame] | 32 | AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"]) |
David Reiss | d683219 | 2007-09-05 00:47:32 +0000 | [diff] [blame] | 33 | |
David Reiss | f0c21a7 | 2008-07-11 01:26:16 +0000 | [diff] [blame] | 34 | AC_ARG_VAR([JAVA_PREFIX], [Prefix for installing the Java lib jar. |
| 35 | (Normal --prefix is ignored for Java because |
| 36 | Java has different conevntions.) |
| 37 | Default = "/usr/local/lib"]) |
| 38 | AS_IF([test "x$JAVA_PREFIX" = x], [JAVA_PREFIX="/usr/local/lib"]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 39 | |
Bryan Duxbury | 3f0b526 | 2010-05-12 21:31:58 +0000 | [diff] [blame] | 40 | AC_ARG_VAR([RUBY_PREFIX], [Prefix for installing Ruby modules. |
| 41 | (Normal --prefix is ignored for Ruby because |
| 42 | Ruby has different conventions.) |
| 43 | Default = none, let ruby setup decide]) |
| 44 | |
Bryan Duxbury | 6a68187 | 2010-05-02 22:39:31 +0000 | [diff] [blame] | 45 | AC_ARG_VAR([PHP_PREFIX], [Prefix for installing PHP modules. |
| 46 | (Normal --prefix is ignored for PHP because |
| 47 | PHP has different conventions.) |
| 48 | Default = "/usr/lib/php"]) |
| 49 | AS_IF([test "x$PHP_PREFIX" = x], [PHP_PREFIX="/usr/lib/php"]) |
| 50 | |
Bryan Duxbury | 89200e1 | 2010-08-25 17:09:02 +0000 | [diff] [blame] | 51 | AC_ARG_VAR([PHP_CONFIG_PREFIX], |
| 52 | [Prefix for installing PHP extension module .ini file. |
| 53 | (Normal --prefix is ignored for PHP because PHP has |
| 54 | different conventions.) |
| 55 | Default = "/etc/php.d"]) |
| 56 | AS_IF([test "x$PHP_CONFIG_PREFIX" = x], [PHP_CONFIG_PREFIX="/etc/php.d"]) |
| 57 | |
David Reiss | c07057e | 2010-06-11 17:57:32 +0000 | [diff] [blame] | 58 | AC_ARG_VAR([PERL_PREFIX], [Prefix for installing Perl modules. |
| 59 | (Normal --prefix is ignored for Perl because |
| 60 | Perl has different conventions.) |
| 61 | Default = "/usr/local/lib"]) |
| 62 | AS_IF([test "x$PERL_PREFIX" = x], [PERL_PREFIX="/usr/local"]) |
| 63 | |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 64 | AC_ARG_VAR([CABAL_CONFIGURE_FLAGS], |
| 65 | [Extra flags to pass to cabal: "cabal Setup.lhs configure $CABAL_CONFIGURE_FLAGS". |
| 66 | (Typically used to set --user or force --global.)]) |
| 67 | |
| 68 | AC_SUBST(CABAL_CONFIGURE_FLAGS) |
| 69 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 70 | AC_PROG_CC |
| 71 | AC_PROG_CPP |
| 72 | AC_PROG_CXX |
| 73 | AC_PROG_INSTALL |
| 74 | AC_PROG_LIBTOOL |
| 75 | AC_PROG_MAKE_SET |
| 76 | AC_PROG_YACC |
| 77 | AC_PROG_LEX |
| 78 | AM_PROG_LEX |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 79 | AC_PROG_LN_S |
| 80 | AC_PROG_MKDIR_P |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 81 | |
| 82 | AC_LANG([C++]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 83 | |
David Reiss | ea4c981 | 2010-08-31 16:51:21 +0000 | [diff] [blame] | 84 | AX_THRIFT_LIB(cpp, [C++], yes) |
| 85 | have_cpp=no |
| 86 | if test "$with_cpp" = "yes"; then |
David Reiss | ef5e81b | 2010-08-31 16:51:28 +0000 | [diff] [blame] | 87 | AX_BOOST_BASE([1.33.1]) |
| 88 | if test "x$succeeded" == "xyes" ; then |
| 89 | have_cpp="yes" |
| 90 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 91 | |
David Reiss | ea4c981 | 2010-08-31 16:51:21 +0000 | [diff] [blame] | 92 | AX_LIB_EVENT([1.0]) |
| 93 | have_libevent=$success |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 94 | |
David Reiss | ea4c981 | 2010-08-31 16:51:21 +0000 | [diff] [blame] | 95 | AX_LIB_ZLIB([1.2.3]) |
| 96 | have_zlib=$success |
| 97 | fi |
| 98 | AM_CONDITIONAL([WITH_CPP], [test "$have_cpp" = "yes"]) |
| 99 | AM_CONDITIONAL([AMX_HAVE_LIBEVENT], [test "$have_libevent" = "yes"]) |
| 100 | AM_CONDITIONAL([AMX_HAVE_ZLIB], [test "$have_zlib" = "yes"]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 101 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame^] | 102 | AX_THRIFT_LIB(c_glib, [C (GLib)], no) |
| 103 | if test "$with_c_glib" = "yes"; then |
| 104 | PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.0], have_glib2=yes, have_glib2=no) |
| 105 | PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.0], have_gobject2=yes, have_gobject2=no) |
| 106 | if test "$have_glib2" = "yes" -a "$have_gobject2" = "yes" ; then |
| 107 | have_c_glib="yes" |
| 108 | fi |
| 109 | fi |
| 110 | AM_CONDITIONAL(WITH_C_GLIB, [test "$have_glib2" = "yes" -a "$have_gobject2" = "yes"]) |
| 111 | |
David Reiss | 520b5ee | 2008-03-02 07:00:26 +0000 | [diff] [blame] | 112 | AX_THRIFT_LIB(csharp, [C#], yes) |
| 113 | if test "$with_csharp" = "yes"; then |
David Reiss | d831a21 | 2009-02-13 03:09:52 +0000 | [diff] [blame] | 114 | PKG_CHECK_MODULES(MONO, mono >= 2.0.0, net_3_5=yes, net_3_5=no) |
| 115 | PKG_CHECK_MODULES(MONO, mono >= 1.2.4, have_mono=yes, have_mono=no) |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 116 | if test "$have_mono" = "yes" ; then |
| 117 | have_csharp="yes" |
| 118 | fi |
David Reiss | 520b5ee | 2008-03-02 07:00:26 +0000 | [diff] [blame] | 119 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 120 | AM_CONDITIONAL(WITH_MONO, [test "$have_csharp" = "yes"]) |
David Reiss | d831a21 | 2009-02-13 03:09:52 +0000 | [diff] [blame] | 121 | AM_CONDITIONAL(NET_2_0, [test "$net_3_5" = "no"]) |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 122 | |
David Reiss | 62d3981 | 2008-03-02 07:00:22 +0000 | [diff] [blame] | 123 | AX_THRIFT_LIB(java, [Java], yes) |
| 124 | if test "$with_java" = "yes"; then |
David Reiss | d9cdf42 | 2009-03-13 21:25:29 +0000 | [diff] [blame] | 125 | AX_JAVAC_AND_JAVA |
Bryan Duxbury | 38bab12 | 2010-08-12 00:27:14 +0000 | [diff] [blame] | 126 | AC_PATH_PROG([ANT], [ant]) |
Bryan Duxbury | c27cda5 | 2009-08-14 20:04:15 +0000 | [diff] [blame] | 127 | AX_CHECK_JAVA_CLASS(org.slf4j.Logger) |
| 128 | have_slf4j="$success" |
| 129 | AX_CHECK_JAVA_CLASS(org.slf4j.impl.SimpleLogger) |
| 130 | have_slf4j_simple="$success" |
David Reiss | fdfcebd | 2009-05-22 19:50:29 +0000 | [diff] [blame] | 131 | AX_CHECK_JAVA_CLASS(org.apache.commons.lang.builder.HashCodeBuilder) |
| 132 | have_hashcode="$success" |
Bryan Duxbury | c27cda5 | 2009-08-14 20:04:15 +0000 | [diff] [blame] | 133 | if test "x$have_slf4j_simple" = "xyes" && test "x$have_slf4j" = "xyes" && test "x$have_hashcode" = "xyes" ; then |
David Reiss | 4ca0c8e | 2009-05-12 23:16:55 +0000 | [diff] [blame] | 134 | ANT_FLAGS="$ANT_FLAGS -Dnoivy=" |
| 135 | fi |
David Reiss | fff84d1 | 2009-05-22 19:50:33 +0000 | [diff] [blame] | 136 | AC_SUBST(CLASSPATH) |
David Reiss | 4ca0c8e | 2009-05-12 23:16:55 +0000 | [diff] [blame] | 137 | AC_SUBST(ANT_FLAGS) |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 138 | if test "x$JAVAC" != "x" && test "x$JAVAC" != "x" && test "x$ANT" != "x" ; then |
| 139 | have_java="yes" |
| 140 | fi |
David Reiss | 62d3981 | 2008-03-02 07:00:22 +0000 | [diff] [blame] | 141 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 142 | AM_CONDITIONAL([WITH_JAVA], [test "$have_java" = "yes"]) |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 143 | |
Christopher Piro | b6f18c2 | 2008-03-04 07:09:12 +0000 | [diff] [blame] | 144 | AX_THRIFT_LIB(erlang, [Erlang], yes) |
| 145 | if test "$with_erlang" = "yes"; then |
David Reiss | 9e2fd79 | 2010-05-18 16:52:48 +0000 | [diff] [blame] | 146 | AC_ERLANG_PATH_ERL |
| 147 | AC_ERLANG_PATH_ERLC |
David Reiss | 31e1b6e | 2010-08-24 20:45:24 +0000 | [diff] [blame] | 148 | if test -n "$ERLC" ; then |
| 149 | AC_ERLANG_SUBST_LIB_DIR |
| 150 | # Install into the detected Erlang directory instead of $libdir/erlang/lib |
| 151 | ERLANG_INSTALL_LIB_DIR="$ERLANG_LIB_DIR" |
| 152 | AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
| 153 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 154 | if test -n "$ERL" -a -n "$ERLC" ; then |
| 155 | have_erlang="yes" |
| 156 | fi |
Christopher Piro | b6f18c2 | 2008-03-04 07:09:12 +0000 | [diff] [blame] | 157 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 158 | AM_CONDITIONAL(WITH_ERLANG, [test "$have_erlang" = "yes"]) |
Christopher Piro | b6f18c2 | 2008-03-04 07:09:12 +0000 | [diff] [blame] | 159 | |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 160 | AX_THRIFT_LIB(python, [Python], yes) |
| 161 | if test "$with_python" = "yes"; then |
David Reiss | 1a14091 | 2008-06-11 01:16:37 +0000 | [diff] [blame] | 162 | AM_PATH_PYTHON(2.4,, :) |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 163 | if test "x$PYTHON" != "x" && test "x$PYTHON" != "x:" ; then |
| 164 | have_python="yes" |
| 165 | fi |
David Reiss | 1a14091 | 2008-06-11 01:16:37 +0000 | [diff] [blame] | 166 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 167 | AM_CONDITIONAL(WITH_PYTHON, [test "$have_python" = "yes"]) |
David Reiss | 1a14091 | 2008-06-11 01:16:37 +0000 | [diff] [blame] | 168 | |
Roger Meier | 50e4349 | 2010-10-08 17:46:06 +0000 | [diff] [blame] | 169 | AC_PATH_PROG([TRIAL], [trial]) |
| 170 | |
T Jake Luciani | 1952e54 | 2009-02-01 04:47:30 +0000 | [diff] [blame] | 171 | AX_THRIFT_LIB(perl, [Perl], yes) |
| 172 | if test "$with_perl" = "yes"; then |
| 173 | AC_PATH_PROG([PERL], [perl]) |
David Reiss | dcc7e9b | 2010-08-31 16:51:22 +0000 | [diff] [blame] | 174 | if test -n "$PERL" ; then |
| 175 | AC_PROG_PERL_MODULES([Bit::Vector], success="yes", success="no") |
| 176 | have_perl_bit_vector="$success" |
Bryan Duxbury | 1237369 | 2010-08-19 05:23:59 +0000 | [diff] [blame] | 177 | fi |
David Reiss | dcc7e9b | 2010-08-31 16:51:22 +0000 | [diff] [blame] | 178 | if test -n "$PERL" -a "$have_perl_bit_vector" = "yes" ; then |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 179 | have_perl="yes" |
| 180 | fi |
T Jake Luciani | 1952e54 | 2009-02-01 04:47:30 +0000 | [diff] [blame] | 181 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 182 | AM_CONDITIONAL(WITH_PERL, [test "$have_perl" = "yes"]) |
T Jake Luciani | 1952e54 | 2009-02-01 04:47:30 +0000 | [diff] [blame] | 183 | |
Bryan Duxbury | 6a68187 | 2010-05-02 22:39:31 +0000 | [diff] [blame] | 184 | AX_THRIFT_LIB(php, [PHP], yes) |
| 185 | if test "$with_php" = "yes"; then |
| 186 | AC_PATH_PROG([PHP], [php]) |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 187 | if test -n "$PHP" ; then |
| 188 | have_php="yes" |
| 189 | fi |
Bryan Duxbury | 6a68187 | 2010-05-02 22:39:31 +0000 | [diff] [blame] | 190 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 191 | AM_CONDITIONAL(WITH_PHP, [test "$have_php" = "yes"]) |
Bryan Duxbury | 6a68187 | 2010-05-02 22:39:31 +0000 | [diff] [blame] | 192 | |
Bryan Duxbury | 89200e1 | 2010-08-25 17:09:02 +0000 | [diff] [blame] | 193 | AX_THRIFT_LIB(php_extension, [PHP_EXTENSION], yes) |
| 194 | if test "$with_php_extension" = "yes"; then |
| 195 | AC_PATH_PROG([PHP_CONFIG], [php-config]) |
Anthony F. Molinaro | ddcf32a | 2010-10-05 16:45:50 +0000 | [diff] [blame] | 196 | if test -n "$PHP_CONFIG" ; then |
| 197 | AC_CONFIG_SUBDIRS([lib/php/src/ext/thrift_protocol]) |
| 198 | have_php_extension="yes" |
| 199 | fi |
Bryan Duxbury | 89200e1 | 2010-08-25 17:09:02 +0000 | [diff] [blame] | 200 | fi |
Anthony F. Molinaro | ddcf32a | 2010-10-05 16:45:50 +0000 | [diff] [blame] | 201 | AM_CONDITIONAL(WITH_PHP_EXTENSION, [test "$have_php_extension" = "yes"]) |
Bryan Duxbury | 89200e1 | 2010-08-25 17:09:02 +0000 | [diff] [blame] | 202 | |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 203 | AX_THRIFT_LIB(ruby, [Ruby], yes) |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 204 | have_ruby=no |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 205 | if test "$with_ruby" = "yes"; then |
| 206 | AC_PATH_PROG([RUBY], [ruby]) |
Bryan Duxbury | ec47358 | 2009-04-07 16:31:04 +0000 | [diff] [blame] | 207 | AC_PATH_PROG([RSPEC], [spec]) |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 208 | if test "x$RUBY" != "x" ; then |
| 209 | have_ruby="yes" |
| 210 | fi |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 211 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 212 | AM_CONDITIONAL(WITH_RUBY, [test "$have_ruby" = "yes"]) |
| 213 | AM_CONDITIONAL(HAVE_RSPEC, [test "x$RSPEC" != "x"]) |
Bryan Duxbury | ec47358 | 2009-04-07 16:31:04 +0000 | [diff] [blame] | 214 | |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 215 | AX_THRIFT_LIB(haskell, [Haskell], yes) |
| 216 | have_haskell=no |
| 217 | RUNHASKELL=true |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 218 | CABAL=true |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 219 | if test "$with_haskell" = "yes"; then |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 220 | AC_PATH_PROG([CABAL], [cabal]) |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 221 | AC_PATH_PROG([RUNHASKELL], [runhaskell]) |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 222 | if test "x$CABAL" != "x" -a "x$RUNHASKELL" != "x"; then |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 223 | have_haskell="yes" |
| 224 | else |
| 225 | RUNHASKELL=true |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 226 | CABAL=true |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 227 | fi |
| 228 | fi |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 229 | AC_SUBST(CABAL) |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 230 | AC_SUBST(RUNHASKELL) |
| 231 | AM_CONDITIONAL(WITH_HASKELL, [test "$have_haskell" = "yes"]) |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 232 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 233 | AC_C_CONST |
| 234 | AC_C_INLINE |
| 235 | AC_C_VOLATILE |
| 236 | |
| 237 | AC_HEADER_STDBOOL |
| 238 | AC_HEADER_STDC |
| 239 | AC_HEADER_TIME |
| 240 | AC_CHECK_HEADERS([arpa/inet.h]) |
Bryan Duxbury | 184d262 | 2010-08-17 17:43:58 +0000 | [diff] [blame] | 241 | AC_CHECK_HEADERS([sys/param.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 242 | AC_CHECK_HEADERS([fcntl.h]) |
| 243 | AC_CHECK_HEADERS([inttypes.h]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 244 | AC_CHECK_HEADERS([limits.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 245 | AC_CHECK_HEADERS([netdb.h]) |
| 246 | AC_CHECK_HEADERS([netinet/in.h]) |
| 247 | AC_CHECK_HEADERS([pthread.h]) |
| 248 | AC_CHECK_HEADERS([stddef.h]) |
David Reiss | d7a16f4 | 2008-02-19 22:47:29 +0000 | [diff] [blame] | 249 | AC_CHECK_HEADERS([stdlib.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 250 | AC_CHECK_HEADERS([sys/socket.h]) |
| 251 | AC_CHECK_HEADERS([sys/time.h]) |
| 252 | AC_CHECK_HEADERS([unistd.h]) |
| 253 | AC_CHECK_HEADERS([libintl.h]) |
| 254 | AC_CHECK_HEADERS([malloc.h]) |
| 255 | |
| 256 | AC_CHECK_LIB(pthread, pthread_create) |
David Reiss | e4ca179 | 2009-05-21 02:28:19 +0000 | [diff] [blame] | 257 | dnl NOTE(dreiss): I haven't been able to find any really solid docs |
| 258 | dnl on what librt is and how it fits into various Unix systems. |
| 259 | dnl My best guess is that it is where glibc stashes its implementation |
| 260 | dnl of the POSIX Real-Time Extensions. This seems necessary on Linux, |
| 261 | dnl and we haven't yet found a system where this is a problem. |
| 262 | AC_CHECK_LIB(rt, clock_gettime) |
David Reiss | 9b90344 | 2009-10-21 05:51:28 +0000 | [diff] [blame] | 263 | AC_CHECK_LIB(socket, setsockopt) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 264 | |
| 265 | AC_TYPE_INT16_T |
| 266 | AC_TYPE_INT32_T |
| 267 | AC_TYPE_INT64_T |
| 268 | AC_TYPE_INT8_T |
| 269 | AC_TYPE_MODE_T |
| 270 | AC_TYPE_OFF_T |
| 271 | AC_TYPE_SIZE_T |
David Reiss | 847a294 | 2008-04-21 18:07:43 +0000 | [diff] [blame] | 272 | AC_TYPE_SSIZE_T |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 273 | AC_TYPE_UINT16_T |
| 274 | AC_TYPE_UINT32_T |
| 275 | AC_TYPE_UINT64_T |
| 276 | AC_TYPE_UINT8_T |
David Reiss | 33fc5ad | 2008-05-09 07:17:34 +0000 | [diff] [blame] | 277 | AC_CHECK_TYPES([ptrdiff_t], [], [exit 1]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 278 | |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 279 | AC_STRUCT_TM |
| 280 | |
David Reiss | 85a8f7b | 2009-05-21 02:28:16 +0000 | [diff] [blame] | 281 | dnl NOTE(dreiss): AI_ADDRCONFIG is not defined on OpenBSD. |
| 282 | AC_CHECK_DECL([AI_ADDRCONFIG], [], |
| 283 | [AC_DEFINE([AI_ADDRCONFIG], 0, |
| 284 | [Define if the AI_ADDRCONFIG symbol is unavailable])], |
| 285 | [ |
| 286 | #include <sys/types.h> |
| 287 | #include <sys/socket.h> |
| 288 | #include <netdb.h> |
| 289 | ]) |
| 290 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 291 | AC_FUNC_ALLOCA |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame^] | 292 | AC_FUNC_FORK |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 293 | AC_FUNC_MALLOC |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 294 | AC_FUNC_MEMCMP |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 295 | AC_FUNC_REALLOC |
| 296 | AC_FUNC_SELECT_ARGTYPES |
| 297 | AC_FUNC_STAT |
| 298 | AC_FUNC_STRERROR_R |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 299 | AC_FUNC_STRFTIME |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 300 | AC_FUNC_VPRINTF |
| 301 | AC_CHECK_FUNCS([strtoul]) |
| 302 | AC_CHECK_FUNCS([bzero]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 303 | AC_CHECK_FUNCS([ftruncate]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 304 | AC_CHECK_FUNCS([gethostbyname]) |
| 305 | AC_CHECK_FUNCS([gettimeofday]) |
| 306 | AC_CHECK_FUNCS([memmove]) |
| 307 | AC_CHECK_FUNCS([memset]) |
| 308 | AC_CHECK_FUNCS([mkdir]) |
| 309 | AC_CHECK_FUNCS([realpath]) |
| 310 | AC_CHECK_FUNCS([select]) |
| 311 | AC_CHECK_FUNCS([socket]) |
| 312 | AC_CHECK_FUNCS([strchr]) |
| 313 | AC_CHECK_FUNCS([strdup]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 314 | AC_CHECK_FUNCS([strerror]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 315 | AC_CHECK_FUNCS([strstr]) |
| 316 | AC_CHECK_FUNCS([strtol]) |
| 317 | AC_CHECK_FUNCS([sqrt]) |
David Reiss | e4ca179 | 2009-05-21 02:28:19 +0000 | [diff] [blame] | 318 | dnl The following functions are optional. |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame^] | 319 | AC_CHECK_FUNCS([alarm]) |
David Reiss | e4ca179 | 2009-05-21 02:28:19 +0000 | [diff] [blame] | 320 | AC_CHECK_FUNCS([clock_gettime]) |
| 321 | AC_CHECK_FUNCS([sched_get_priority_min]) |
| 322 | AC_CHECK_FUNCS([sched_get_priority_max]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 323 | |
David Reiss | 79db3e1 | 2010-08-31 16:51:31 +0000 | [diff] [blame] | 324 | if test "$cross_compiling" = "no" ; then |
| 325 | AX_SIGNED_RIGHT_SHIFT |
| 326 | fi |
David Reiss | e4d4ea0 | 2009-04-02 21:37:17 +0000 | [diff] [blame] | 327 | |
David Reiss | 5ddabb8 | 2010-10-06 17:09:37 +0000 | [diff] [blame] | 328 | dnl autoscan thinks we need this macro because we have a member function |
| 329 | dnl called "error". Invoke the macro but don't run the check so autoscan |
| 330 | dnl thinks we are in the clear. It's highly unlikely that we will ever |
| 331 | dnl actually use the function that this checks for. |
| 332 | if false ; then |
| 333 | AC_FUNC_ERROR_AT_LINE |
| 334 | fi |
| 335 | |
David Reiss | 2258573 | 2008-02-27 01:55:33 +0000 | [diff] [blame] | 336 | AX_THRIFT_GEN(cpp, [C++], yes) |
| 337 | AM_CONDITIONAL([THRIFT_GEN_cpp], [test "$ax_thrift_gen_cpp" = "yes"]) |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame^] | 338 | AX_THRIFT_GEN(c_glib, [C (GLib)], yes) |
| 339 | AM_CONDITIONAL([THRIFT_GEN_c_glib], [test "$ax_thrift_gen_c_glib" = "yes"]) |
David Reiss | e8a87de | 2008-02-27 02:39:25 +0000 | [diff] [blame] | 340 | AX_THRIFT_GEN(java, [Java], yes) |
| 341 | AM_CONDITIONAL([THRIFT_GEN_java], [test "$ax_thrift_gen_java" = "yes"]) |
Bryan Duxbury | 321eb7a | 2010-04-22 21:17:39 +0000 | [diff] [blame] | 342 | AX_THRIFT_GEN(as3, [AS3], yes) |
| 343 | AM_CONDITIONAL([THRIFT_GEN_as3], [test "$ax_thrift_gen_as3" = "yes"]) |
David Reiss | ce4f4f0 | 2008-03-27 21:41:31 +0000 | [diff] [blame] | 344 | AX_THRIFT_GEN(csharp, [C#], yes) |
| 345 | AM_CONDITIONAL([THRIFT_GEN_csharp], [test "$ax_thrift_gen_csharp" = "yes"]) |
David Reiss | bfd26dc | 2008-03-27 21:41:49 +0000 | [diff] [blame] | 346 | AX_THRIFT_GEN(py, [Python], yes) |
| 347 | AM_CONDITIONAL([THRIFT_GEN_py], [test "$ax_thrift_gen_py" = "yes"]) |
David Reiss | ae25358 | 2008-03-27 21:42:11 +0000 | [diff] [blame] | 348 | AX_THRIFT_GEN(rb, [Ruby], yes) |
| 349 | AM_CONDITIONAL([THRIFT_GEN_rb], [test "$ax_thrift_gen_rb" = "yes"]) |
David Reiss | fdc21aa | 2008-03-27 21:42:34 +0000 | [diff] [blame] | 350 | AX_THRIFT_GEN(perl, [Perl], yes) |
| 351 | AM_CONDITIONAL([THRIFT_GEN_perl], [test "$ax_thrift_gen_perl" = "yes"]) |
David Reiss | 32272d9 | 2009-02-17 20:28:30 +0000 | [diff] [blame] | 352 | AX_THRIFT_GEN(php, [PHP], yes) |
| 353 | AM_CONDITIONAL([THRIFT_GEN_php], [test "$ax_thrift_gen_php" = "yes"]) |
David Reiss | f3b0db3 | 2009-02-17 20:28:01 +0000 | [diff] [blame] | 354 | AX_THRIFT_GEN(erl, [Erlang], yes) |
| 355 | AM_CONDITIONAL([THRIFT_GEN_erl], [test "$ax_thrift_gen_erl" = "yes"]) |
David Reiss | 4b349aa | 2008-03-27 21:41:02 +0000 | [diff] [blame] | 356 | AX_THRIFT_GEN(cocoa, [Cocoa], yes) |
| 357 | AM_CONDITIONAL([THRIFT_GEN_cocoa], [test "$ax_thrift_gen_cocoa" = "yes"]) |
David Reiss | b3ac8a6 | 2008-03-27 21:40:42 +0000 | [diff] [blame] | 358 | AX_THRIFT_GEN(st, [Smalltalk], yes) |
| 359 | AM_CONDITIONAL([THRIFT_GEN_st], [test "$ax_thrift_gen_st" = "yes"]) |
David Reiss | 3d671b5 | 2008-03-27 21:40:11 +0000 | [diff] [blame] | 360 | AX_THRIFT_GEN(ocaml, [OCaml], yes) |
| 361 | AM_CONDITIONAL([THRIFT_GEN_ocaml], [test "$ax_thrift_gen_ocaml" = "yes"]) |
David Reiss | 22812f8 | 2008-03-27 21:40:26 +0000 | [diff] [blame] | 362 | AX_THRIFT_GEN(hs, [Haskell], yes) |
| 363 | AM_CONDITIONAL([THRIFT_GEN_hs], [test "$ax_thrift_gen_hs" = "yes"]) |
David Reiss | 782cb67 | 2009-02-17 20:28:13 +0000 | [diff] [blame] | 364 | AX_THRIFT_GEN(xsd, [XSD], yes) |
| 365 | AM_CONDITIONAL([THRIFT_GEN_xsd], [test "$ax_thrift_gen_xsd" = "yes"]) |
David Reiss | dc0aada | 2008-10-21 00:09:23 +0000 | [diff] [blame] | 366 | AX_THRIFT_GEN(html, [HTML], yes) |
| 367 | AM_CONDITIONAL([THRIFT_GEN_html], [test "$ax_thrift_gen_html" = "yes"]) |
T Jake Luciani | 322caa2 | 2010-02-15 03:24:55 +0000 | [diff] [blame] | 368 | AX_THRIFT_GEN(js, [JavaScript], yes) |
| 369 | AM_CONDITIONAL([THRIFT_GEN_js], [test "$ax_thrift_gen_js" = "yes"]) |
Bryan Duxbury | 1237dcb | 2010-09-20 17:49:09 +0000 | [diff] [blame] | 370 | AX_THRIFT_GEN(javame, [JavaME], yes) |
| 371 | AM_CONDITIONAL([THRIFT_GEN_javame], [test "$ax_thrift_gen_javame" = "yes"]) |
David Reiss | 2258573 | 2008-02-27 01:55:33 +0000 | [diff] [blame] | 372 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame^] | 373 | # --- Coverage hooks --- |
| 374 | |
| 375 | AC_ARG_ENABLE(coverage, |
| 376 | [ --enable-coverage turn on -fprofile-arcs -ftest-coverage], |
| 377 | [case "${enableval}" in |
| 378 | yes) ENABLE_COVERAGE=1 ;; |
| 379 | no) ENABLE_COVERAGE=0 ;; |
| 380 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-cov) ;; |
| 381 | esac], |
| 382 | [ENABLE_COVERAGE=2]) |
| 383 | |
| 384 | if test "x[$]ENABLE_COVERAGE" = "x1"; then |
| 385 | AC_MSG_WARN(enable coverage) |
| 386 | GCOV_CFLAGS="`echo \"[$]CFLAGS\" | perl -pe 's/-O\d+//g;'` -fprofile-arcs -ftest-coverage" |
| 387 | GCOV_CXXFLAGS="`echo \"[$]CXXFLAGS\" | perl -pe 's/-O\d+//g;'` -fprofile-arcs -ftest-coverage" |
| 388 | GCOV_LDFLAGS="-XCClinker -fprofile-arcs -XCClinker -ftest-coverage" |
| 389 | fi |
| 390 | |
| 391 | AC_SUBST(ENABLE_COVERAGE) |
| 392 | AC_SUBST(GCOV_CFLAGS) |
| 393 | AC_SUBST(GCOV_CXXFLAGS) |
| 394 | AC_SUBST(GCOV_LDFLAGS) |
| 395 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 396 | AC_CONFIG_HEADERS(config.h:config.hin) |
| 397 | |
| 398 | AC_CONFIG_FILES([ |
| 399 | Makefile |
| 400 | compiler/cpp/Makefile |
Bryan Duxbury | a1e268c | 2010-05-03 21:33:00 +0000 | [diff] [blame] | 401 | compiler/cpp/version.h |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 402 | lib/Makefile |
| 403 | lib/cpp/Makefile |
David Reiss | 351e22b | 2010-08-31 16:51:19 +0000 | [diff] [blame] | 404 | lib/cpp/test/Makefile |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 405 | lib/cpp/thrift-nb.pc |
| 406 | lib/cpp/thrift-z.pc |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 407 | lib/cpp/thrift.pc |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame^] | 408 | lib/c_glib/Makefile |
| 409 | lib/c_glib/thrift_c_glib.pc |
| 410 | lib/c_glib/test/Makefile |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 411 | lib/csharp/Makefile |
Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 412 | lib/erl/Makefile |
Anthony F. Molinaro | ef16420 | 2010-09-07 03:35:30 +0000 | [diff] [blame] | 413 | lib/erl/src/Makefile |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 414 | lib/hs/Makefile |
David Reiss | f8dcf03 | 2008-02-23 22:07:39 +0000 | [diff] [blame] | 415 | lib/java/Makefile |
T Jake Luciani | 1952e54 | 2009-02-01 04:47:30 +0000 | [diff] [blame] | 416 | lib/perl/Makefile |
| 417 | lib/perl/test/Makefile |
Bryan Duxbury | 6a68187 | 2010-05-02 22:39:31 +0000 | [diff] [blame] | 418 | lib/php/Makefile |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 419 | lib/py/Makefile |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 420 | lib/rb/Makefile |
David Reiss | 8180c0c | 2008-02-04 21:14:14 +0000 | [diff] [blame] | 421 | test/Makefile |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 422 | test/hs/Makefile |
David Reiss | 9ff3b9d | 2008-02-15 01:10:23 +0000 | [diff] [blame] | 423 | test/py/Makefile |
Roger Meier | 50e4349 | 2010-10-08 17:46:06 +0000 | [diff] [blame] | 424 | test/py.twisted/Makefile |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 425 | test/rb/Makefile |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 426 | ]) |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 427 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame^] | 428 | AC_CONFIG_FILES([lib/c_glib/test/test-wrapper.sh], |
| 429 | [chmod +x lib/c_glib/test/test-wrapper.sh]) |
| 430 | |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 431 | AC_OUTPUT |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 432 | |
| 433 | |
| 434 | echo |
| 435 | echo "$PACKAGE $VERSION" |
| 436 | echo |
| 437 | echo "Building code generators ..... :$thrift_generators" |
| 438 | echo |
David Reiss | ea4c981 | 2010-08-31 16:51:21 +0000 | [diff] [blame] | 439 | echo "Building C++ Library ......... : $have_cpp" |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame^] | 440 | echo "Building C (GLib) Library .... : $have_c_glib" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 441 | echo "Building Java Library ........ : $have_java" |
| 442 | echo "Building C# Library .......... : $have_csharp" |
| 443 | echo "Building Python Library ...... : $have_python" |
| 444 | echo "Building Ruby Library ........ : $have_ruby" |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 445 | echo "Building Haskell Library ..... : $have_haskell" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 446 | echo "Building Perl Library ........ : $have_perl" |
| 447 | echo "Building PHP Library ......... : $have_php" |
| 448 | echo "Building Erlang Library ...... : $have_erlang" |
| 449 | if test "$have_cpp" = "yes" ; then |
| 450 | echo |
| 451 | echo "Building TZlibTransport ...... : $have_zlib" |
| 452 | echo "Building TNonblockingServer .. : $have_libevent" |
| 453 | fi |
| 454 | if test "$have_java" = "yes" ; then |
| 455 | echo |
| 456 | echo "Using javac .................. : $JAVAC" |
| 457 | echo "Using java ................... : $JAVA" |
| 458 | echo "Using ant .................... : $ANT" |
| 459 | fi |
| 460 | if test "$have_csharp" = "yes" ; then |
| 461 | echo |
| 462 | echo "Using .NET 3.5 ............... : $net_3_5" |
| 463 | fi |
| 464 | if test "$have_python" = "yes" ; then |
| 465 | echo |
| 466 | echo "Using Python ................. : $PYTHON" |
| 467 | fi |
Anthony F. Molinaro | ddcf32a | 2010-10-05 16:45:50 +0000 | [diff] [blame] | 468 | if test "$have_php" = "yes" ; then |
| 469 | echo |
| 470 | echo "Using php-config ............. : $PHP_CONFIG" |
| 471 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 472 | if test "$have_ruby" = "yes" ; then |
| 473 | echo |
| 474 | echo "Using Ruby ................... : $RUBY" |
| 475 | echo "Using rspec .................. : $RSPEC" |
| 476 | fi |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 477 | if test "$have_haskell" = "yes" ; then |
| 478 | echo |
| 479 | echo "Using Haskell ................ : $RUNHASKELL" |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 480 | echo "Using Cabal .................. : $CABAL" |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 481 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 482 | if test "$have_perl" = "yes" ; then |
| 483 | echo |
| 484 | echo "Using Perl ................... : $PERL" |
| 485 | fi |
| 486 | if test "$have_erlang" = "yes" ; then |
| 487 | echo |
| 488 | echo "Using erlc ................... : $ERLC" |
| 489 | fi |
| 490 | echo |
| 491 | echo "If something is missing that you think should be present," |
| 492 | echo "please skim the output of configure to find the missing" |
| 493 | echo "component. Details are present in config.log." |