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 | |
T Jake Luciani | 03ec1e4 | 2011-01-27 02:53:57 +0000 | [diff] [blame] | 20 | AC_PREREQ(2.65) |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 21 | |
Jake Farrell | 6fcecd4 | 2012-10-11 20:34:25 +0000 | [diff] [blame] | 22 | AC_INIT([thrift], [1.0.0-dev]) |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 23 | |
| 24 | AC_CONFIG_AUX_DIR([.]) |
| 25 | |
jfarrell | 92f24b2 | 2013-08-17 15:47:13 -0400 | [diff] [blame] | 26 | AM_INIT_AUTOMAKE([1.11 tar-ustar]) |
Bryan Duxbury | b005c1f | 2011-02-09 17:05:11 +0000 | [diff] [blame] | 27 | PKG_PROG_PKG_CONFIG |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 28 | |
David Reiss | d683219 | 2007-09-05 00:47:32 +0000 | [diff] [blame] | 29 | AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules. |
| 30 | (Normal --prefix is ignored for Python because |
| 31 | Python has different conventions.) |
| 32 | Default = "/usr"]) |
David Reiss | cdd6f3c | 2008-03-04 21:10:29 +0000 | [diff] [blame] | 33 | AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"]) |
David Reiss | d683219 | 2007-09-05 00:47:32 +0000 | [diff] [blame] | 34 | |
David Reiss | f0c21a7 | 2008-07-11 01:26:16 +0000 | [diff] [blame] | 35 | AC_ARG_VAR([JAVA_PREFIX], [Prefix for installing the Java lib jar. |
| 36 | (Normal --prefix is ignored for Java because |
Christian Lavoie | afc6d8f | 2011-02-20 02:39:19 +0000 | [diff] [blame] | 37 | Java has different conventions.) |
David Reiss | f0c21a7 | 2008-07-11 01:26:16 +0000 | [diff] [blame] | 38 | Default = "/usr/local/lib"]) |
| 39 | AS_IF([test "x$JAVA_PREFIX" = x], [JAVA_PREFIX="/usr/local/lib"]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 40 | |
Bryan Duxbury | 3f0b526 | 2010-05-12 21:31:58 +0000 | [diff] [blame] | 41 | AC_ARG_VAR([RUBY_PREFIX], [Prefix for installing Ruby modules. |
| 42 | (Normal --prefix is ignored for Ruby because |
| 43 | Ruby has different conventions.) |
| 44 | Default = none, let ruby setup decide]) |
| 45 | |
Bryan Duxbury | 6a68187 | 2010-05-02 22:39:31 +0000 | [diff] [blame] | 46 | AC_ARG_VAR([PHP_PREFIX], [Prefix for installing PHP modules. |
| 47 | (Normal --prefix is ignored for PHP because |
| 48 | PHP has different conventions.) |
| 49 | Default = "/usr/lib/php"]) |
| 50 | AS_IF([test "x$PHP_PREFIX" = x], [PHP_PREFIX="/usr/lib/php"]) |
| 51 | |
Bryan Duxbury | 89200e1 | 2010-08-25 17:09:02 +0000 | [diff] [blame] | 52 | AC_ARG_VAR([PHP_CONFIG_PREFIX], |
| 53 | [Prefix for installing PHP extension module .ini file. |
| 54 | (Normal --prefix is ignored for PHP because PHP has |
| 55 | different conventions.) |
| 56 | Default = "/etc/php.d"]) |
| 57 | AS_IF([test "x$PHP_CONFIG_PREFIX" = x], [PHP_CONFIG_PREFIX="/etc/php.d"]) |
| 58 | |
Jake Farrell | 05e0cdb | 2011-05-05 13:45:26 +0000 | [diff] [blame] | 59 | AC_ARG_VAR([INSTALLDIRS], [When installing Perl modules, specifies which |
| 60 | of the sets of installation directories |
| 61 | to choose: perl, site or vendor. |
| 62 | Default = "vendor"]) |
| 63 | AS_IF([test "x$INSTALLDIRS" = x], [INSTALLDIRS="vendor"]) |
| 64 | |
David Reiss | c07057e | 2010-06-11 17:57:32 +0000 | [diff] [blame] | 65 | AC_ARG_VAR([PERL_PREFIX], [Prefix for installing Perl modules. |
| 66 | (Normal --prefix is ignored for Perl because |
| 67 | Perl has different conventions.) |
Jake Farrell | 05e0cdb | 2011-05-05 13:45:26 +0000 | [diff] [blame] | 68 | Ignored, when INSTALLDIRS set to site or vendor. |
David Reiss | c07057e | 2010-06-11 17:57:32 +0000 | [diff] [blame] | 69 | Default = "/usr/local/lib"]) |
| 70 | AS_IF([test "x$PERL_PREFIX" = x], [PERL_PREFIX="/usr/local"]) |
| 71 | |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 72 | AC_ARG_VAR([CABAL_CONFIGURE_FLAGS], |
| 73 | [Extra flags to pass to cabal: "cabal Setup.lhs configure $CABAL_CONFIGURE_FLAGS". |
| 74 | (Typically used to set --user or force --global.)]) |
| 75 | |
| 76 | AC_SUBST(CABAL_CONFIGURE_FLAGS) |
| 77 | |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 78 | AC_ARG_VAR([D_IMPORT_PREFIX], [Prefix for installing D modules. |
| 79 | [INCLUDEDIR/d2]]) |
| 80 | AS_IF([test "x$D_IMPORT_PREFIX" = x], [D_IMPORT_PREFIX="${includedir}/d2"]) |
| 81 | |
| 82 | AC_ARG_VAR([DMD_LIBEVENT_FLAGS], [DMD flags for linking libevent (auto-detected if not set).]) |
| 83 | AC_ARG_VAR([DMD_OPENSSL_FLAGS], [DMD flags for linking OpenSSL (auto-detected if not set).]) |
| 84 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 85 | AC_PROG_CC |
| 86 | AC_PROG_CPP |
| 87 | AC_PROG_CXX |
| 88 | AC_PROG_INSTALL |
| 89 | AC_PROG_LIBTOOL |
| 90 | AC_PROG_MAKE_SET |
| 91 | AC_PROG_YACC |
| 92 | AC_PROG_LEX |
| 93 | AM_PROG_LEX |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 94 | AC_PROG_LN_S |
| 95 | AC_PROG_MKDIR_P |
Christian Lavoie | afc6d8f | 2011-02-20 02:39:19 +0000 | [diff] [blame] | 96 | AC_PROG_AWK |
| 97 | AC_PROG_RANLIB |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 98 | |
| 99 | AC_LANG([C++]) |
jfarrell | 84cd284 | 2014-01-14 21:51:59 -0500 | [diff] [blame] | 100 | AX_CXX_COMPILE_STDCXX_11([noext]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 101 | |
Roger Meier | c92cda0 | 2014-02-09 21:13:53 +0100 | [diff] [blame] | 102 | AC_ARG_ENABLE([libs], |
| 103 | AS_HELP_STRING([--enable-libs], [build the Apache Thrift libraries [default=yes]]), |
| 104 | [], enable_libs=yes |
| 105 | ) |
| 106 | have_libs=yes |
| 107 | if test "$enable_libs" = "no"; then |
| 108 | have_libs="no" |
| 109 | with_cpp="no" |
| 110 | with_c_glib="no" |
| 111 | with_java="no" |
| 112 | with_csharp="no" |
| 113 | with_python="no" |
| 114 | with_ruby="no" |
| 115 | with_haskell="no" |
| 116 | with_perl="no" |
| 117 | with_php="no" |
| 118 | with_php_extension="no" |
| 119 | with_erlang="no" |
| 120 | with_go="no" |
| 121 | with_d="no" |
| 122 | with_nodejs="no" |
Roger Meier | 6cf0ffc | 2014-04-05 00:45:42 +0200 | [diff] [blame] | 123 | with_lua="no" |
Roger Meier | c92cda0 | 2014-02-09 21:13:53 +0100 | [diff] [blame] | 124 | fi |
| 125 | |
| 126 | |
David Reiss | ea4c981 | 2010-08-31 16:51:21 +0000 | [diff] [blame] | 127 | AX_THRIFT_LIB(cpp, [C++], yes) |
| 128 | have_cpp=no |
| 129 | if test "$with_cpp" = "yes"; then |
Roger Meier | 6bb0a7a | 2012-05-11 10:44:32 +0000 | [diff] [blame] | 130 | AX_BOOST_BASE([1.40.0]) |
Jake Farrell | 3ad8081 | 2011-06-09 19:14:22 +0000 | [diff] [blame] | 131 | if test "x$succeeded" = "xyes" ; then |
David Reiss | ef5e81b | 2010-08-31 16:51:28 +0000 | [diff] [blame] | 132 | have_cpp="yes" |
| 133 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 134 | |
David Reiss | ea4c981 | 2010-08-31 16:51:21 +0000 | [diff] [blame] | 135 | AX_LIB_EVENT([1.0]) |
| 136 | have_libevent=$success |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 137 | |
David Reiss | ea4c981 | 2010-08-31 16:51:21 +0000 | [diff] [blame] | 138 | AX_LIB_ZLIB([1.2.3]) |
| 139 | have_zlib=$success |
Chris Piro | 20c81ad | 2013-03-07 11:32:48 -0500 | [diff] [blame] | 140 | |
Jake Farrell | d6d3e37 | 2012-07-27 16:01:33 +0000 | [diff] [blame] | 141 | AX_THRIFT_LIB(qt4, [Qt], yes) |
| 142 | have_qt=no |
| 143 | if test "$with_qt4" = "yes"; then |
| 144 | PKG_CHECK_MODULES([QT], [QtCore >= 4.3, QtNetwork >= 4.3], have_qt=yes, have_qt=no) |
| 145 | fi |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 146 | if test "$have_qt" = "yes"; then |
| 147 | AC_PATH_PROGS([QT_MOC], [moc-qt4 moc]) |
| 148 | have_qt=$success |
| 149 | fi |
David Reiss | ea4c981 | 2010-08-31 16:51:21 +0000 | [diff] [blame] | 150 | fi |
| 151 | AM_CONDITIONAL([WITH_CPP], [test "$have_cpp" = "yes"]) |
| 152 | AM_CONDITIONAL([AMX_HAVE_LIBEVENT], [test "$have_libevent" = "yes"]) |
| 153 | AM_CONDITIONAL([AMX_HAVE_ZLIB], [test "$have_zlib" = "yes"]) |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 154 | AM_CONDITIONAL([AMX_HAVE_QT], [test "$have_qt" = "yes"]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 155 | |
Roger Meier | 3217723 | 2012-05-01 11:19:53 +0000 | [diff] [blame] | 156 | AX_THRIFT_LIB(c_glib, [C (GLib)], yes) |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 157 | if test "$with_c_glib" = "yes"; then |
| 158 | PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.0], have_glib2=yes, have_glib2=no) |
| 159 | PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.0], have_gobject2=yes, have_gobject2=no) |
| 160 | if test "$have_glib2" = "yes" -a "$have_gobject2" = "yes" ; then |
| 161 | have_c_glib="yes" |
| 162 | fi |
| 163 | fi |
| 164 | AM_CONDITIONAL(WITH_C_GLIB, [test "$have_glib2" = "yes" -a "$have_gobject2" = "yes"]) |
| 165 | |
David Reiss | 520b5ee | 2008-03-02 07:00:26 +0000 | [diff] [blame] | 166 | AX_THRIFT_LIB(csharp, [C#], yes) |
| 167 | if test "$with_csharp" = "yes"; then |
David Reiss | d831a21 | 2009-02-13 03:09:52 +0000 | [diff] [blame] | 168 | PKG_CHECK_MODULES(MONO, mono >= 2.0.0, net_3_5=yes, net_3_5=no) |
| 169 | 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] | 170 | if test "$have_mono" = "yes" ; then |
| 171 | have_csharp="yes" |
| 172 | fi |
David Reiss | 520b5ee | 2008-03-02 07:00:26 +0000 | [diff] [blame] | 173 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 174 | AM_CONDITIONAL(WITH_MONO, [test "$have_csharp" = "yes"]) |
David Reiss | d831a21 | 2009-02-13 03:09:52 +0000 | [diff] [blame] | 175 | AM_CONDITIONAL(NET_2_0, [test "$net_3_5" = "no"]) |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 176 | |
David Reiss | 62d3981 | 2008-03-02 07:00:22 +0000 | [diff] [blame] | 177 | AX_THRIFT_LIB(java, [Java], yes) |
| 178 | if test "$with_java" = "yes"; then |
David Reiss | d9cdf42 | 2009-03-13 21:25:29 +0000 | [diff] [blame] | 179 | AX_JAVAC_AND_JAVA |
Bryan Duxbury | 38bab12 | 2010-08-12 00:27:14 +0000 | [diff] [blame] | 180 | AC_PATH_PROG([ANT], [ant]) |
Jake Farrell | 210d766 | 2011-05-25 21:07:29 +0000 | [diff] [blame] | 181 | AX_CHECK_ANT_VERSION($ANT, 1.7) |
David Reiss | fff84d1 | 2009-05-22 19:50:33 +0000 | [diff] [blame] | 182 | AC_SUBST(CLASSPATH) |
David Reiss | 4ca0c8e | 2009-05-12 23:16:55 +0000 | [diff] [blame] | 183 | AC_SUBST(ANT_FLAGS) |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 184 | if test "x$JAVAC" != "x" && test "x$JAVAC" != "x" && test "x$ANT" != "x" ; then |
| 185 | have_java="yes" |
| 186 | fi |
David Reiss | 62d3981 | 2008-03-02 07:00:22 +0000 | [diff] [blame] | 187 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 188 | AM_CONDITIONAL([WITH_JAVA], [test "$have_java" = "yes"]) |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 189 | |
Christopher Piro | b6f18c2 | 2008-03-04 07:09:12 +0000 | [diff] [blame] | 190 | AX_THRIFT_LIB(erlang, [Erlang], yes) |
| 191 | if test "$with_erlang" = "yes"; then |
David Reiss | 9e2fd79 | 2010-05-18 16:52:48 +0000 | [diff] [blame] | 192 | AC_ERLANG_PATH_ERL |
| 193 | AC_ERLANG_PATH_ERLC |
David Reiss | 31e1b6e | 2010-08-24 20:45:24 +0000 | [diff] [blame] | 194 | if test -n "$ERLC" ; then |
| 195 | AC_ERLANG_SUBST_LIB_DIR |
| 196 | # Install into the detected Erlang directory instead of $libdir/erlang/lib |
| 197 | ERLANG_INSTALL_LIB_DIR="$ERLANG_LIB_DIR" |
| 198 | AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
| 199 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 200 | if test -n "$ERL" -a -n "$ERLC" ; then |
| 201 | have_erlang="yes" |
| 202 | fi |
Christopher Piro | b6f18c2 | 2008-03-04 07:09:12 +0000 | [diff] [blame] | 203 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 204 | AM_CONDITIONAL(WITH_ERLANG, [test "$have_erlang" = "yes"]) |
Christopher Piro | b6f18c2 | 2008-03-04 07:09:12 +0000 | [diff] [blame] | 205 | |
Roger Meier | 8909cbd | 2014-01-26 11:44:27 +0100 | [diff] [blame] | 206 | AX_THRIFT_LIB(nodejs, [Nodejs], yes) |
| 207 | have_nodejs=no |
| 208 | if test "$with_nodejs" = "yes"; then |
| 209 | AC_PATH_PROGS([NODEJS], [nodejs node]) |
| 210 | AC_PATH_PROG([NPM], [npm]) |
| 211 | if test "x$NODEJS" != "x" -a "x$NPM" != "x"; then |
| 212 | have_nodejs="yes" |
| 213 | fi |
| 214 | fi |
| 215 | AM_CONDITIONAL(WITH_NODEJS, [test "$have_nodejs" = "yes"]) |
| 216 | AM_CONDITIONAL(HAVE_NPM, [test "x$NPM" != "x"]) |
| 217 | |
Roger Meier | 6cf0ffc | 2014-04-05 00:45:42 +0200 | [diff] [blame] | 218 | AX_THRIFT_LIB(lua, [Lua], yes) |
| 219 | have_lua=no |
| 220 | if test "$with_lua" = "yes"; then |
| 221 | AC_PATH_PROGS([LUA], [lua]) |
| 222 | if test "x$LUA" != "x"; then |
| 223 | have_lua="yes" |
| 224 | fi |
| 225 | fi |
| 226 | AM_CONDITIONAL(WITH_LUA, [test "$have_lua" = "yes"]) |
| 227 | |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 228 | AX_THRIFT_LIB(python, [Python], yes) |
| 229 | if test "$with_python" = "yes"; then |
David Reiss | 1a14091 | 2008-06-11 01:16:37 +0000 | [diff] [blame] | 230 | AM_PATH_PYTHON(2.4,, :) |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 231 | if test "x$PYTHON" != "x" && test "x$PYTHON" != "x:" ; then |
| 232 | have_python="yes" |
| 233 | fi |
David Reiss | 1a14091 | 2008-06-11 01:16:37 +0000 | [diff] [blame] | 234 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 235 | AM_CONDITIONAL(WITH_PYTHON, [test "$have_python" = "yes"]) |
David Reiss | 1a14091 | 2008-06-11 01:16:37 +0000 | [diff] [blame] | 236 | |
Roger Meier | 50e4349 | 2010-10-08 17:46:06 +0000 | [diff] [blame] | 237 | AC_PATH_PROG([TRIAL], [trial]) |
| 238 | |
T Jake Luciani | 1952e54 | 2009-02-01 04:47:30 +0000 | [diff] [blame] | 239 | AX_THRIFT_LIB(perl, [Perl], yes) |
| 240 | if test "$with_perl" = "yes"; then |
| 241 | AC_PATH_PROG([PERL], [perl]) |
David Reiss | dcc7e9b | 2010-08-31 16:51:22 +0000 | [diff] [blame] | 242 | if test -n "$PERL" ; then |
| 243 | AC_PROG_PERL_MODULES([Bit::Vector], success="yes", success="no") |
| 244 | have_perl_bit_vector="$success" |
Roger Meier | aae8acb | 2014-01-15 13:55:09 +0100 | [diff] [blame] | 245 | AC_PROG_PERL_MODULES([Class::Accessor], success="yes", success="no") |
| 246 | have_perl_class_accessor="$success" |
Bryan Duxbury | 1237369 | 2010-08-19 05:23:59 +0000 | [diff] [blame] | 247 | fi |
David Reiss | dcc7e9b | 2010-08-31 16:51:22 +0000 | [diff] [blame] | 248 | if test -n "$PERL" -a "$have_perl_bit_vector" = "yes" ; then |
Roger Meier | aae8acb | 2014-01-15 13:55:09 +0100 | [diff] [blame] | 249 | if test -n "$PERL" -a "$have_perl_class_accessor" = "yes" ; then |
| 250 | have_perl="yes" |
| 251 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 252 | fi |
T Jake Luciani | 1952e54 | 2009-02-01 04:47:30 +0000 | [diff] [blame] | 253 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 254 | AM_CONDITIONAL(WITH_PERL, [test "$have_perl" = "yes"]) |
T Jake Luciani | 1952e54 | 2009-02-01 04:47:30 +0000 | [diff] [blame] | 255 | |
Bryan Duxbury | 6a68187 | 2010-05-02 22:39:31 +0000 | [diff] [blame] | 256 | AX_THRIFT_LIB(php, [PHP], yes) |
| 257 | if test "$with_php" = "yes"; then |
| 258 | AC_PATH_PROG([PHP], [php]) |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 259 | if test -n "$PHP" ; then |
| 260 | have_php="yes" |
| 261 | fi |
Bryan Duxbury | 6a68187 | 2010-05-02 22:39:31 +0000 | [diff] [blame] | 262 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 263 | AM_CONDITIONAL(WITH_PHP, [test "$have_php" = "yes"]) |
Bryan Duxbury | 6a68187 | 2010-05-02 22:39:31 +0000 | [diff] [blame] | 264 | |
Bryan Duxbury | 89200e1 | 2010-08-25 17:09:02 +0000 | [diff] [blame] | 265 | AX_THRIFT_LIB(php_extension, [PHP_EXTENSION], yes) |
| 266 | if test "$with_php_extension" = "yes"; then |
| 267 | AC_PATH_PROG([PHP_CONFIG], [php-config]) |
Anthony F. Molinaro | ddcf32a | 2010-10-05 16:45:50 +0000 | [diff] [blame] | 268 | if test -n "$PHP_CONFIG" ; then |
| 269 | AC_CONFIG_SUBDIRS([lib/php/src/ext/thrift_protocol]) |
| 270 | have_php_extension="yes" |
| 271 | fi |
Bryan Duxbury | 89200e1 | 2010-08-25 17:09:02 +0000 | [diff] [blame] | 272 | fi |
Anthony F. Molinaro | ddcf32a | 2010-10-05 16:45:50 +0000 | [diff] [blame] | 273 | AM_CONDITIONAL(WITH_PHP_EXTENSION, [test "$have_php_extension" = "yes"]) |
Bryan Duxbury | 89200e1 | 2010-08-25 17:09:02 +0000 | [diff] [blame] | 274 | |
Roger Meier | 33b720a | 2012-01-24 18:42:46 +0000 | [diff] [blame] | 275 | AC_PATH_PROG([PHPUNIT], [phpunit]) |
| 276 | AM_CONDITIONAL(HAVE_PHPUNIT, [test "x$PHPUNIT" != "x"]) |
| 277 | |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 278 | AX_THRIFT_LIB(ruby, [Ruby], yes) |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 279 | have_ruby=no |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 280 | if test "$with_ruby" = "yes"; then |
| 281 | AC_PATH_PROG([RUBY], [ruby]) |
Jake Farrell | 9c39f77 | 2011-08-30 19:12:10 +0000 | [diff] [blame] | 282 | AC_PATH_PROG([BUNDLER], [bundle]) |
jfarrell | 507740c | 2014-01-22 22:20:21 -0500 | [diff] [blame] | 283 | if test "x$RUBY" != "x" -a "x$BUNDLER" != "x"; then |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 284 | have_ruby="yes" |
| 285 | fi |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 286 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 287 | AM_CONDITIONAL(WITH_RUBY, [test "$have_ruby" = "yes"]) |
Jake Farrell | 9c39f77 | 2011-08-30 19:12:10 +0000 | [diff] [blame] | 288 | AM_CONDITIONAL(HAVE_BUNDLER, [test "x$BUNDLER" != "x"]) |
Bryan Duxbury | ec47358 | 2009-04-07 16:31:04 +0000 | [diff] [blame] | 289 | |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 290 | AX_THRIFT_LIB(haskell, [Haskell], yes) |
| 291 | have_haskell=no |
| 292 | RUNHASKELL=true |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 293 | CABAL=true |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 294 | if test "$with_haskell" = "yes"; then |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 295 | AC_PATH_PROG([CABAL], [cabal]) |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 296 | AC_PATH_PROG([RUNHASKELL], [runhaskell]) |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 297 | if test "x$CABAL" != "x" -a "x$RUNHASKELL" != "x"; then |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 298 | have_haskell="yes" |
| 299 | else |
| 300 | RUNHASKELL=true |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 301 | CABAL=true |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 302 | fi |
| 303 | fi |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 304 | AC_SUBST(CABAL) |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 305 | AC_SUBST(RUNHASKELL) |
| 306 | AM_CONDITIONAL(WITH_HASKELL, [test "$have_haskell" = "yes"]) |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 307 | |
Christian Lavoie | afc6d8f | 2011-02-20 02:39:19 +0000 | [diff] [blame] | 308 | AX_THRIFT_LIB(go, [Go], yes) |
| 309 | if test "$with_go" = "yes"; then |
Jens Geyer | 0e87c46 | 2013-06-18 22:25:07 +0200 | [diff] [blame] | 310 | AC_PATH_PROG([GO], [go]) |
| 311 | if [[ -x "$GO" ]] ; then |
Christian Lavoie | afc6d8f | 2011-02-20 02:39:19 +0000 | [diff] [blame] | 312 | have_go="yes" |
| 313 | fi |
| 314 | fi |
| 315 | AM_CONDITIONAL(WITH_GO, [test "$have_go" = "yes"]) |
| 316 | |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 317 | |
| 318 | AX_THRIFT_LIB(d, [D], yes) |
| 319 | if test "$with_d" = "yes"; then |
| 320 | AX_DMD |
| 321 | AC_SUBST(DMD) |
| 322 | if test "x$DMD" != "x"; then |
| 323 | have_d="yes" |
| 324 | fi |
| 325 | fi |
| 326 | |
| 327 | # Determine actual name of the generated D library for use in the command line |
| 328 | # when compiling tests. This is needed because the -l<lib> syntax doesn't work |
| 329 | # with OPTLINK (Windows). |
| 330 | lib_prefix=lib |
| 331 | lib_suffix=a |
| 332 | case "$host_os" in |
| 333 | cygwin* | mingw* | pw32* | cegcc*) |
| 334 | lib_prefix="" |
| 335 | lib_suffix=lib |
| 336 | ;; |
| 337 | esac |
| 338 | D_LIB_NAME="${lib_prefix}thriftd.${lib_suffix}" |
| 339 | AC_SUBST(D_LIB_NAME) |
| 340 | D_EVENT_LIB_NAME="${lib_prefix}thriftd-event.${lib_suffix}" |
| 341 | AC_SUBST(D_EVENT_LIB_NAME) |
| 342 | D_SSL_LIB_NAME="${lib_prefix}thriftd-ssl.${lib_suffix}" |
| 343 | AC_SUBST(D_SSL_LIB_NAME) |
| 344 | |
| 345 | if test "$have_d" = "yes"; then |
| 346 | AX_CHECK_D_MODULE(deimos.event2.event) |
| 347 | have_deimos_event2=$success |
| 348 | |
| 349 | with_d_event_tests="no" |
| 350 | if test "$have_deimos_event2" = "yes"; then |
| 351 | if test "x$DMD_LIBEVENT_FLAGS" = "x"; then |
| 352 | if test "$dmd_optlink" = "yes"; then |
| 353 | AC_MSG_WARN([D libevent interface found, but cannot auto-detect \ |
| 354 | linker flags for OPTLINK. Please set DMD_LIBEVENT_FLAGS manually.]) |
| 355 | else |
| 356 | AX_LIB_EVENT([2.0]) |
| 357 | if test "$success" = "yes"; then |
| 358 | DMD_LIBEVENT_FLAGS=$(echo "$LIBEVENT_LDFLAGS $LIBEVENT_LIBS" | \ |
| 359 | sed -e 's/^ *//g;s/ *$//g;s/^\(.\)/-L\1/g;s/ */ -L/g') |
| 360 | with_d_event_tests="yes" |
| 361 | else |
| 362 | AC_MSG_WARN([D libevent interface present, but libevent library not found.]) |
| 363 | fi |
| 364 | fi |
| 365 | else |
| 366 | with_d_event_tests="yes" |
| 367 | fi |
| 368 | fi |
| 369 | |
| 370 | AX_CHECK_D_MODULE(deimos.openssl.ssl) |
| 371 | have_deimos_openssl=$success |
| 372 | |
| 373 | with_d_ssl_tests="no" |
| 374 | if test "$have_deimos_openssl" = "yes"; then |
| 375 | if test "x$DMD_OPENSSL_FLAGS" = "x"; then |
| 376 | if test "$dmd_optlink" = "yes"; then |
| 377 | AC_MSG_WARN([D OpenSSL interface found, but cannot auto-detect \ |
| 378 | linker flags for OPTLINK. Please set DMD_OPENSSL_FLAGS manually.]) |
| 379 | else |
| 380 | AX_CHECK_OPENSSL([with_d_ssl_tests="yes"]) |
| 381 | if test "$with_d_ssl_tests" = "yes"; then |
| 382 | DMD_OPENSSL_FLAGS=$(echo "$OPENSSL_LDFLAGS $OPENSSL_LIBS" | \ |
| 383 | sed -e 's/^ *//g;s/ *$//g;s/^\(.\)/-L\1/g;s/ */ -L/g') |
| 384 | else |
| 385 | AC_MSG_WARN([D OpenSSL interface present, but OpenSSL library not found.]) |
| 386 | fi |
| 387 | fi |
| 388 | else |
| 389 | with_d_ssl_tests="yes" |
| 390 | fi |
| 391 | fi |
| 392 | fi |
| 393 | |
| 394 | AM_CONDITIONAL(WITH_D, [test "$have_d" = "yes"]) |
| 395 | AM_CONDITIONAL(DMD_OPTLINK, [test "$dmd_optlink" = "yes"]) |
| 396 | AC_SUBST(DMD_OF_DIRSEP, "$dmd_of_dirsep") |
| 397 | AM_CONDITIONAL(HAVE_DEIMOS_EVENT2, [test "$have_deimos_event2" = "yes"]) |
| 398 | AM_CONDITIONAL(WITH_D_EVENT_TESTS, [test "$with_d_event_tests" = "yes"]) |
| 399 | AC_SUBST(DMD_LIBEVENT_FLAGS) |
| 400 | AM_CONDITIONAL(HAVE_DEIMOS_OPENSSL, [test "$have_deimos_openssl" = "yes"]) |
| 401 | AM_CONDITIONAL(WITH_D_SSL_TESTS, [test "$with_d_ssl_tests" = "yes"]) |
| 402 | AC_SUBST(DMD_OPENSSL_FLAGS) |
| 403 | |
Roger Meier | c88d581 | 2014-01-26 11:51:26 +0100 | [diff] [blame] | 404 | AC_ARG_ENABLE([tests], |
| 405 | AS_HELP_STRING([--enable-tests], [build tests [default=yes]]), |
| 406 | [], enable_tests=yes |
| 407 | ) |
Jake Farrell | 627f1a0 | 2011-09-14 03:43:49 +0000 | [diff] [blame] | 408 | have_tests=yes |
Roger Meier | c88d581 | 2014-01-26 11:51:26 +0100 | [diff] [blame] | 409 | if test "$enable_tests" = "no"; then |
Jake Farrell | 627f1a0 | 2011-09-14 03:43:49 +0000 | [diff] [blame] | 410 | have_tests="no" |
| 411 | fi |
| 412 | AM_CONDITIONAL(WITH_TESTS, [test "$have_tests" = "yes"]) |
| 413 | |
Roger Meier | c88d581 | 2014-01-26 11:51:26 +0100 | [diff] [blame] | 414 | AC_ARG_ENABLE([tutorial], |
| 415 | AS_HELP_STRING([--enable-tutorial], [build tutorial [default=yes]]), |
| 416 | [], enable_tutorial=yes |
| 417 | ) |
| 418 | have_tutorial=yes |
| 419 | if test "$enable_tutorial" = "no"; then |
| 420 | have_tutorial="no" |
| 421 | fi |
| 422 | AM_CONDITIONAL(WITH_TUTORIAL, [test "$have_tutorial" = "yes"]) |
| 423 | |
Roger Meier | 6e96965 | 2011-12-13 00:36:01 +0000 | [diff] [blame] | 424 | AM_CONDITIONAL(MINGW, false) |
| 425 | case "${host_os}" in |
| 426 | *mingw*) |
| 427 | mingw32_support="yes" |
| 428 | AC_CHECK_HEADER(windows.h) |
| 429 | AM_CONDITIONAL(MINGW, true) |
| 430 | ;; |
| 431 | *) |
| 432 | AC_ISC_POSIX |
| 433 | ;; |
| 434 | esac |
| 435 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 436 | AC_C_CONST |
| 437 | AC_C_INLINE |
| 438 | AC_C_VOLATILE |
| 439 | |
| 440 | AC_HEADER_STDBOOL |
| 441 | AC_HEADER_STDC |
| 442 | AC_HEADER_TIME |
Christian Lavoie | afc6d8f | 2011-02-20 02:39:19 +0000 | [diff] [blame] | 443 | AC_HEADER_SYS_WAIT |
| 444 | AC_TYPE_SIGNAL |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 445 | AC_CHECK_HEADERS([arpa/inet.h]) |
Bryan Duxbury | 184d262 | 2010-08-17 17:43:58 +0000 | [diff] [blame] | 446 | AC_CHECK_HEADERS([sys/param.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 447 | AC_CHECK_HEADERS([fcntl.h]) |
| 448 | AC_CHECK_HEADERS([inttypes.h]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 449 | AC_CHECK_HEADERS([limits.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 450 | AC_CHECK_HEADERS([netdb.h]) |
| 451 | AC_CHECK_HEADERS([netinet/in.h]) |
| 452 | AC_CHECK_HEADERS([pthread.h]) |
| 453 | AC_CHECK_HEADERS([stddef.h]) |
David Reiss | d7a16f4 | 2008-02-19 22:47:29 +0000 | [diff] [blame] | 454 | AC_CHECK_HEADERS([stdlib.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 455 | AC_CHECK_HEADERS([sys/socket.h]) |
| 456 | AC_CHECK_HEADERS([sys/time.h]) |
Roger Meier | 2fa9c31 | 2011-09-05 19:15:53 +0000 | [diff] [blame] | 457 | AC_CHECK_HEADERS([sys/un.h]) |
| 458 | AC_CHECK_HEADERS([sys/poll.h]) |
| 459 | AC_CHECK_HEADERS([sys/resource.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 460 | AC_CHECK_HEADERS([unistd.h]) |
| 461 | AC_CHECK_HEADERS([libintl.h]) |
| 462 | AC_CHECK_HEADERS([malloc.h]) |
Roger Meier | 9d9c4b9 | 2011-02-23 20:27:54 +0000 | [diff] [blame] | 463 | AC_CHECK_HEADERS([openssl/ssl.h]) |
| 464 | AC_CHECK_HEADERS([openssl/rand.h]) |
| 465 | AC_CHECK_HEADERS([openssl/x509v3.h]) |
Roger Meier | 12d7053 | 2011-12-14 23:35:28 +0000 | [diff] [blame] | 466 | AC_CHECK_HEADERS([sched.h]) |
Roger Meier | 9357636 | 2013-03-15 19:49:23 +0100 | [diff] [blame] | 467 | AC_CHECK_HEADERS([wchar.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 468 | |
| 469 | AC_CHECK_LIB(pthread, pthread_create) |
David Reiss | e4ca179 | 2009-05-21 02:28:19 +0000 | [diff] [blame] | 470 | dnl NOTE(dreiss): I haven't been able to find any really solid docs |
| 471 | dnl on what librt is and how it fits into various Unix systems. |
| 472 | dnl My best guess is that it is where glibc stashes its implementation |
| 473 | dnl of the POSIX Real-Time Extensions. This seems necessary on Linux, |
| 474 | dnl and we haven't yet found a system where this is a problem. |
| 475 | AC_CHECK_LIB(rt, clock_gettime) |
David Reiss | 9b90344 | 2009-10-21 05:51:28 +0000 | [diff] [blame] | 476 | AC_CHECK_LIB(socket, setsockopt) |
Roger Meier | 6869112 | 2011-09-09 06:19:35 +0000 | [diff] [blame] | 477 | |
| 478 | if test "$have_cpp" = "yes" ; then |
| 479 | # mingw toolchain used to build "Thrift Compiler for Windows" |
| 480 | # does not support libcrypto, so we just check if we building the cpp library |
Jake Farrell | 012dfda | 2011-08-29 18:18:55 +0000 | [diff] [blame] | 481 | AC_CHECK_LIB(crypto, |
| 482 | BN_init, |
| 483 | [AC_CHECK_LIB(ssl, |
| 484 | SSL_ctrl, |
| 485 | [LIBS="-lssl -lcrypto $LIBS"], |
| 486 | [AC_MSG_ERROR(["Error: libssl required"])], |
| 487 | -lcrypto |
| 488 | )], |
| 489 | [AC_MSG_ERROR(["Error: libcrypto required."])] |
| 490 | ) |
Roger Meier | 6869112 | 2011-09-09 06:19:35 +0000 | [diff] [blame] | 491 | fi |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 492 | |
| 493 | AC_TYPE_INT16_T |
| 494 | AC_TYPE_INT32_T |
| 495 | AC_TYPE_INT64_T |
| 496 | AC_TYPE_INT8_T |
| 497 | AC_TYPE_MODE_T |
| 498 | AC_TYPE_OFF_T |
| 499 | AC_TYPE_SIZE_T |
David Reiss | 847a294 | 2008-04-21 18:07:43 +0000 | [diff] [blame] | 500 | AC_TYPE_SSIZE_T |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 501 | AC_TYPE_UINT16_T |
| 502 | AC_TYPE_UINT32_T |
| 503 | AC_TYPE_UINT64_T |
| 504 | AC_TYPE_UINT8_T |
David Reiss | 33fc5ad | 2008-05-09 07:17:34 +0000 | [diff] [blame] | 505 | AC_CHECK_TYPES([ptrdiff_t], [], [exit 1]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 506 | |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 507 | AC_STRUCT_TM |
| 508 | |
David Reiss | 85a8f7b | 2009-05-21 02:28:16 +0000 | [diff] [blame] | 509 | dnl NOTE(dreiss): AI_ADDRCONFIG is not defined on OpenBSD. |
| 510 | AC_CHECK_DECL([AI_ADDRCONFIG], [], |
| 511 | [AC_DEFINE([AI_ADDRCONFIG], 0, |
| 512 | [Define if the AI_ADDRCONFIG symbol is unavailable])], |
| 513 | [ |
| 514 | #include <sys/types.h> |
| 515 | #include <sys/socket.h> |
| 516 | #include <netdb.h> |
| 517 | ]) |
| 518 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 519 | AC_FUNC_ALLOCA |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 520 | AC_FUNC_FORK |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 521 | AC_FUNC_MALLOC |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 522 | AC_FUNC_MEMCMP |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 523 | AC_FUNC_REALLOC |
| 524 | AC_FUNC_SELECT_ARGTYPES |
| 525 | AC_FUNC_STAT |
| 526 | AC_FUNC_STRERROR_R |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 527 | AC_FUNC_STRFTIME |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 528 | AC_FUNC_VPRINTF |
| 529 | AC_CHECK_FUNCS([strtoul]) |
| 530 | AC_CHECK_FUNCS([bzero]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 531 | AC_CHECK_FUNCS([ftruncate]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 532 | AC_CHECK_FUNCS([gethostbyname]) |
Roger Meier | bea3144 | 2014-04-08 23:52:01 +0200 | [diff] [blame^] | 533 | AC_CHECK_FUNCS([gethostbyname_r]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 534 | AC_CHECK_FUNCS([gettimeofday]) |
| 535 | AC_CHECK_FUNCS([memmove]) |
| 536 | AC_CHECK_FUNCS([memset]) |
| 537 | AC_CHECK_FUNCS([mkdir]) |
| 538 | AC_CHECK_FUNCS([realpath]) |
| 539 | AC_CHECK_FUNCS([select]) |
| 540 | AC_CHECK_FUNCS([socket]) |
| 541 | AC_CHECK_FUNCS([strchr]) |
| 542 | AC_CHECK_FUNCS([strdup]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 543 | AC_CHECK_FUNCS([strerror]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 544 | AC_CHECK_FUNCS([strstr]) |
| 545 | AC_CHECK_FUNCS([strtol]) |
| 546 | AC_CHECK_FUNCS([sqrt]) |
David Reiss | e4ca179 | 2009-05-21 02:28:19 +0000 | [diff] [blame] | 547 | dnl The following functions are optional. |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 548 | AC_CHECK_FUNCS([alarm]) |
David Reiss | e4ca179 | 2009-05-21 02:28:19 +0000 | [diff] [blame] | 549 | AC_CHECK_FUNCS([clock_gettime]) |
| 550 | AC_CHECK_FUNCS([sched_get_priority_min]) |
| 551 | AC_CHECK_FUNCS([sched_get_priority_max]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 552 | |
David Reiss | 79db3e1 | 2010-08-31 16:51:31 +0000 | [diff] [blame] | 553 | if test "$cross_compiling" = "no" ; then |
| 554 | AX_SIGNED_RIGHT_SHIFT |
| 555 | fi |
David Reiss | e4d4ea0 | 2009-04-02 21:37:17 +0000 | [diff] [blame] | 556 | |
David Reiss | 5ddabb8 | 2010-10-06 17:09:37 +0000 | [diff] [blame] | 557 | dnl autoscan thinks we need this macro because we have a member function |
| 558 | dnl called "error". Invoke the macro but don't run the check so autoscan |
| 559 | dnl thinks we are in the clear. It's highly unlikely that we will ever |
| 560 | dnl actually use the function that this checks for. |
| 561 | if false ; then |
| 562 | AC_FUNC_ERROR_AT_LINE |
| 563 | fi |
| 564 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 565 | # --- Coverage hooks --- |
| 566 | |
| 567 | AC_ARG_ENABLE(coverage, |
| 568 | [ --enable-coverage turn on -fprofile-arcs -ftest-coverage], |
| 569 | [case "${enableval}" in |
| 570 | yes) ENABLE_COVERAGE=1 ;; |
| 571 | no) ENABLE_COVERAGE=0 ;; |
| 572 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-cov) ;; |
| 573 | esac], |
| 574 | [ENABLE_COVERAGE=2]) |
| 575 | |
| 576 | if test "x[$]ENABLE_COVERAGE" = "x1"; then |
| 577 | AC_MSG_WARN(enable coverage) |
| 578 | GCOV_CFLAGS="`echo \"[$]CFLAGS\" | perl -pe 's/-O\d+//g;'` -fprofile-arcs -ftest-coverage" |
| 579 | GCOV_CXXFLAGS="`echo \"[$]CXXFLAGS\" | perl -pe 's/-O\d+//g;'` -fprofile-arcs -ftest-coverage" |
| 580 | GCOV_LDFLAGS="-XCClinker -fprofile-arcs -XCClinker -ftest-coverage" |
| 581 | fi |
| 582 | |
| 583 | AC_SUBST(ENABLE_COVERAGE) |
| 584 | AC_SUBST(GCOV_CFLAGS) |
| 585 | AC_SUBST(GCOV_CXXFLAGS) |
| 586 | AC_SUBST(GCOV_LDFLAGS) |
| 587 | |
Roger Meier | 3faaedf | 2011-10-02 10:51:45 +0000 | [diff] [blame] | 588 | AC_ARG_ENABLE(boostthreads, |
| 589 | [ --enable-boostthreads use boost threads, instead of POSIX pthread (experimental) ], |
| 590 | [case "${enableval}" in |
| 591 | yes) ENABLE_BOOSTTHREADS=1 ;; |
| 592 | no) ENABLE_BOOSTTHREADS=0 ;; |
| 593 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-cov) ;; |
| 594 | esac], |
| 595 | [ENABLE_BOOSTTHREADS=2]) |
| 596 | |
| 597 | |
| 598 | if test "x[$]ENABLE_BOOSTTHREADS" = "x1"; then |
| 599 | AC_MSG_WARN(enable boostthreads) |
| 600 | AC_DEFINE([USE_BOOST_THREAD], [1], [experimental --enable-boostthreads that replaces POSIX pthread by boost::thread]) |
Roger Meier | 3831578 | 2011-11-06 11:29:41 +0000 | [diff] [blame] | 601 | LIBS="-lboost_thread $LIBS" |
Roger Meier | 3faaedf | 2011-10-02 10:51:45 +0000 | [diff] [blame] | 602 | fi |
| 603 | |
| 604 | AM_CONDITIONAL([WITH_BOOSTTHREADS], [test "x[$]ENABLE_BOOSTTHREADS" = "x1"]) |
| 605 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 606 | AC_CONFIG_HEADERS(config.h:config.hin) |
Roger Meier | 58fe536 | 2013-06-22 22:05:22 +0200 | [diff] [blame] | 607 | AC_CONFIG_HEADERS(lib/cpp/src/thrift/config.h:config.hin) |
Jake Farrell | 240df17 | 2013-06-04 23:59:34 -0400 | [diff] [blame] | 608 | # gruard against pre defined config.h |
| 609 | AH_TOP([ |
| 610 | #ifndef CONFIG_H |
Roger Meier | 8909cbd | 2014-01-26 11:44:27 +0100 | [diff] [blame] | 611 | #define CONFIG_H |
Jake Farrell | 240df17 | 2013-06-04 23:59:34 -0400 | [diff] [blame] | 612 | ]) |
| 613 | AH_BOTTOM([ |
| 614 | #endif |
| 615 | ]) |
| 616 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 617 | |
| 618 | AC_CONFIG_FILES([ |
| 619 | Makefile |
| 620 | compiler/cpp/Makefile |
Bryan Duxbury | a1e268c | 2010-05-03 21:33:00 +0000 | [diff] [blame] | 621 | compiler/cpp/version.h |
Jake Farrell | 16b7641 | 2012-06-22 03:51:38 +0000 | [diff] [blame] | 622 | compiler/cpp/src/windows/version.h |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 623 | lib/Makefile |
| 624 | lib/cpp/Makefile |
David Reiss | 351e22b | 2010-08-31 16:51:19 +0000 | [diff] [blame] | 625 | lib/cpp/test/Makefile |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 626 | lib/cpp/thrift-nb.pc |
| 627 | lib/cpp/thrift-z.pc |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 628 | lib/cpp/thrift-qt.pc |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 629 | lib/cpp/thrift.pc |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 630 | lib/c_glib/Makefile |
| 631 | lib/c_glib/thrift_c_glib.pc |
| 632 | lib/c_glib/test/Makefile |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 633 | lib/csharp/Makefile |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 634 | lib/d/Makefile |
| 635 | lib/d/test/Makefile |
Bryan Duxbury | 7173bd9 | 2010-05-02 22:54:22 +0000 | [diff] [blame] | 636 | lib/erl/Makefile |
Jens Geyer | 0e87c46 | 2013-06-18 22:25:07 +0200 | [diff] [blame] | 637 | lib/go/Makefile |
Jens Geyer | a7da488 | 2013-07-18 00:33:05 +0200 | [diff] [blame] | 638 | lib/go/test/Makefile |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 639 | lib/hs/Makefile |
David Reiss | f8dcf03 | 2008-02-23 22:07:39 +0000 | [diff] [blame] | 640 | lib/java/Makefile |
Roger Meier | f249576 | 2011-03-17 19:13:36 +0000 | [diff] [blame] | 641 | lib/js/test/Makefile |
Roger Meier | 8909cbd | 2014-01-26 11:44:27 +0100 | [diff] [blame] | 642 | lib/nodejs/Makefile |
T Jake Luciani | 1952e54 | 2009-02-01 04:47:30 +0000 | [diff] [blame] | 643 | lib/perl/Makefile |
| 644 | lib/perl/test/Makefile |
Bryan Duxbury | 6a68187 | 2010-05-02 22:39:31 +0000 | [diff] [blame] | 645 | lib/php/Makefile |
Roger Meier | 33b720a | 2012-01-24 18:42:46 +0000 | [diff] [blame] | 646 | lib/php/test/Makefile |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 647 | lib/py/Makefile |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 648 | lib/rb/Makefile |
Roger Meier | 6cf0ffc | 2014-04-05 00:45:42 +0200 | [diff] [blame] | 649 | lib/lua/Makefile |
David Reiss | 8180c0c | 2008-02-04 21:14:14 +0000 | [diff] [blame] | 650 | test/Makefile |
Roger Meier | d3b9dca | 2011-06-24 14:01:10 +0000 | [diff] [blame] | 651 | test/cpp/Makefile |
Bryan Duxbury | c657447 | 2010-10-06 00:12:33 +0000 | [diff] [blame] | 652 | test/hs/Makefile |
Roger Meier | b33967b | 2012-01-21 09:18:05 +0000 | [diff] [blame] | 653 | test/php/Makefile |
Roger Meier | 01b568c | 2012-01-10 21:30:02 +0000 | [diff] [blame] | 654 | test/perl/Makefile |
David Reiss | 9ff3b9d | 2008-02-15 01:10:23 +0000 | [diff] [blame] | 655 | test/py/Makefile |
Roger Meier | 50e4349 | 2010-10-08 17:46:06 +0000 | [diff] [blame] | 656 | test/py.twisted/Makefile |
Chris Piro | 20c81ad | 2013-03-07 11:32:48 -0500 | [diff] [blame] | 657 | test/py.tornado/Makefile |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 658 | test/rb/Makefile |
Roger Meier | fa89932 | 2012-10-22 19:27:38 +0000 | [diff] [blame] | 659 | tutorial/Makefile |
Roger Meier | 18a90d1 | 2012-10-24 18:40:06 +0000 | [diff] [blame] | 660 | tutorial/cpp/Makefile |
Jens Geyer | 0e87c46 | 2013-06-18 22:25:07 +0200 | [diff] [blame] | 661 | tutorial/go/Makefile |
Roger Meier | fa89932 | 2012-10-22 19:27:38 +0000 | [diff] [blame] | 662 | tutorial/java/Makefile |
| 663 | tutorial/js/Makefile |
Roger Meier | 64998e2 | 2014-01-27 21:15:56 +0100 | [diff] [blame] | 664 | tutorial/nodejs/Makefile |
Roger Meier | 1d66d06 | 2012-10-26 21:46:18 +0000 | [diff] [blame] | 665 | tutorial/py/Makefile |
| 666 | tutorial/py.twisted/Makefile |
Chris Piro | 20c81ad | 2013-03-07 11:32:48 -0500 | [diff] [blame] | 667 | tutorial/py.tornado/Makefile |
Roger Meier | ed817d0 | 2013-06-09 23:10:06 +0200 | [diff] [blame] | 668 | tutorial/rb/Makefile |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 669 | ]) |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 670 | |
| 671 | AC_OUTPUT |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 672 | |
| 673 | |
| 674 | echo |
| 675 | echo "$PACKAGE $VERSION" |
| 676 | echo |
David Reiss | ea4c981 | 2010-08-31 16:51:21 +0000 | [diff] [blame] | 677 | echo "Building C++ Library ......... : $have_cpp" |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 678 | echo "Building C (GLib) Library .... : $have_c_glib" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 679 | echo "Building Java Library ........ : $have_java" |
| 680 | echo "Building C# Library .......... : $have_csharp" |
| 681 | echo "Building Python Library ...... : $have_python" |
| 682 | echo "Building Ruby Library ........ : $have_ruby" |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 683 | echo "Building Haskell Library ..... : $have_haskell" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 684 | echo "Building Perl Library ........ : $have_perl" |
| 685 | echo "Building PHP Library ......... : $have_php" |
| 686 | echo "Building Erlang Library ...... : $have_erlang" |
Christian Lavoie | afc6d8f | 2011-02-20 02:39:19 +0000 | [diff] [blame] | 687 | echo "Building Go Library .......... : $have_go" |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 688 | echo "Building D Library ........... : $have_d" |
Roger Meier | 8909cbd | 2014-01-26 11:44:27 +0100 | [diff] [blame] | 689 | echo "Building NodeJS Library ...... : $have_nodejs" |
Roger Meier | 6cf0ffc | 2014-04-05 00:45:42 +0200 | [diff] [blame] | 690 | echo "Building Lua Library ......... : $have_lua" |
Jake Farrell | c9c972b | 2012-07-24 17:28:24 +0000 | [diff] [blame] | 691 | |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 692 | if test "$have_cpp" = "yes" ; then |
| 693 | echo |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 694 | echo "C++ Library:" |
| 695 | echo " Build TZlibTransport ...... : $have_zlib" |
| 696 | echo " Build TNonblockingServer .. : $have_libevent" |
| 697 | echo " Build TQTcpServer (Qt) .... : $have_qt" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 698 | fi |
| 699 | if test "$have_java" = "yes" ; then |
| 700 | echo |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 701 | echo "Java Library:" |
| 702 | echo " Using javac ............... : $JAVAC" |
| 703 | echo " Using java ................ : $JAVA" |
| 704 | echo " Using ant ................. : $ANT" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 705 | fi |
| 706 | if test "$have_csharp" = "yes" ; then |
| 707 | echo |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 708 | echo "C# Library:" |
| 709 | echo " Using .NET 3.5 ............ : $net_3_5" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 710 | fi |
| 711 | if test "$have_python" = "yes" ; then |
| 712 | echo |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 713 | echo "Python Library:" |
| 714 | echo " Using Python .............. : $PYTHON" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 715 | fi |
Anthony F. Molinaro | ddcf32a | 2010-10-05 16:45:50 +0000 | [diff] [blame] | 716 | if test "$have_php" = "yes" ; then |
| 717 | echo |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 718 | echo "PHP Library:" |
| 719 | echo " Using php-config .......... : $PHP_CONFIG" |
Anthony F. Molinaro | ddcf32a | 2010-10-05 16:45:50 +0000 | [diff] [blame] | 720 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 721 | if test "$have_ruby" = "yes" ; then |
| 722 | echo |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 723 | echo "Ruby Library:" |
| 724 | echo " Using Ruby ................ : $RUBY" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 725 | fi |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 726 | if test "$have_haskell" = "yes" ; then |
| 727 | echo |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 728 | echo "Haskell Library:" |
| 729 | echo " Using Haskell ............. : $RUNHASKELL" |
| 730 | echo " Using Cabal ............... : $CABAL" |
Anthony F. Molinaro | a5df7c7 | 2010-09-27 17:22:17 +0000 | [diff] [blame] | 731 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 732 | if test "$have_perl" = "yes" ; then |
| 733 | echo |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 734 | echo "Perl Library:" |
| 735 | echo " Using Perl ................ : $PERL" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 736 | fi |
| 737 | if test "$have_erlang" = "yes" ; then |
| 738 | echo |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 739 | echo "Erlang Library:" |
| 740 | echo " Using erlc ................ : $ERLC" |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 741 | fi |
Christian Lavoie | afc6d8f | 2011-02-20 02:39:19 +0000 | [diff] [blame] | 742 | if test "$have_go" = "yes" ; then |
| 743 | echo |
Roger Meier | 86e8986 | 2012-02-10 19:53:20 +0000 | [diff] [blame] | 744 | echo "Go Library:" |
Jens Geyer | 0e87c46 | 2013-06-18 22:25:07 +0200 | [diff] [blame] | 745 | echo " Using Go................... : $GO" |
Jens Geyer | a7da488 | 2013-07-18 00:33:05 +0200 | [diff] [blame] | 746 | echo " Using Go version........... : $($GO version)" |
Christian Lavoie | afc6d8f | 2011-02-20 02:39:19 +0000 | [diff] [blame] | 747 | fi |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 748 | if test "$have_d" = "yes" ; then |
| 749 | echo |
Jens Geyer | bcca1d9 | 2013-12-26 19:24:30 +0100 | [diff] [blame] | 750 | echo "D Library:" |
| 751 | echo " Using D Compiler .......... : $DMD" |
| 752 | echo " Building D libevent tests . : $with_d_event_tests" |
| 753 | echo " Building D SSL tests ...... : $with_d_ssl_tests" |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 754 | fi |
Roger Meier | 8909cbd | 2014-01-26 11:44:27 +0100 | [diff] [blame] | 755 | if test "$have_nodejs" = "yes" ; then |
| 756 | echo |
| 757 | echo "NodeJS Library:" |
| 758 | echo " Using NodeJS .............. : $NODEJS" |
| 759 | echo " Using NodeJS version....... : $($NODEJS --version)" |
| 760 | fi |
Roger Meier | 6cf0ffc | 2014-04-05 00:45:42 +0200 | [diff] [blame] | 761 | if test "$have_lua" = "yes" ; then |
| 762 | echo |
| 763 | echo "Lua Library:" |
| 764 | echo " Using Lua .............. : $LUA" |
| 765 | fi |
David Reiss | 5cc3ba8 | 2010-08-31 16:51:20 +0000 | [diff] [blame] | 766 | echo |
| 767 | echo "If something is missing that you think should be present," |
| 768 | echo "please skim the output of configure to find the missing" |
| 769 | echo "component. Details are present in config.log." |