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 | |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 20 | AC_PREREQ(2.59) |
| 21 | |
David Reiss | 10a22bf | 2008-04-21 18:08:07 +0000 | [diff] [blame] | 22 | AC_INIT([thrift], [20080411]) |
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 | |
| 40 | AC_PROG_CC |
| 41 | AC_PROG_CPP |
| 42 | AC_PROG_CXX |
| 43 | AC_PROG_INSTALL |
| 44 | AC_PROG_LIBTOOL |
| 45 | AC_PROG_MAKE_SET |
| 46 | AC_PROG_YACC |
| 47 | AC_PROG_LEX |
| 48 | AM_PROG_LEX |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 49 | AC_PROG_LN_S |
| 50 | AC_PROG_MKDIR_P |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 51 | |
| 52 | AC_LANG([C++]) |
| 53 | AX_BOOST_BASE([1.33.1]) |
| 54 | |
| 55 | AX_LIB_EVENT([1.0]) |
| 56 | AM_CONDITIONAL([AMX_HAVE_LIBEVENT], [test "$success" = "yes"]) |
| 57 | |
| 58 | AX_LIB_ZLIB([1.2.3]) |
| 59 | AM_CONDITIONAL([AMX_HAVE_ZLIB], [test "$success" = "yes"]) |
| 60 | |
David Reiss | 520b5ee | 2008-03-02 07:00:26 +0000 | [diff] [blame] | 61 | AX_THRIFT_LIB(csharp, [C#], yes) |
| 62 | if test "$with_csharp" = "yes"; then |
David Reiss | d831a21 | 2009-02-13 03:09:52 +0000 | [diff] [blame] | 63 | PKG_CHECK_MODULES(MONO, mono >= 2.0.0, net_3_5=yes, net_3_5=no) |
| 64 | PKG_CHECK_MODULES(MONO, mono >= 1.2.4, have_mono=yes, have_mono=no) |
David Reiss | 520b5ee | 2008-03-02 07:00:26 +0000 | [diff] [blame] | 65 | fi |
David Reiss | 82c1bab | 2008-06-11 01:16:53 +0000 | [diff] [blame] | 66 | AM_CONDITIONAL(WITH_MONO, [test "$have_mono" = "yes"]) |
David Reiss | d831a21 | 2009-02-13 03:09:52 +0000 | [diff] [blame] | 67 | AM_CONDITIONAL(NET_2_0, [test "$net_3_5" = "no"]) |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 68 | |
David Reiss | 62d3981 | 2008-03-02 07:00:22 +0000 | [diff] [blame] | 69 | AX_THRIFT_LIB(java, [Java], yes) |
| 70 | if test "$with_java" = "yes"; then |
David Reiss | d9cdf42 | 2009-03-13 21:25:29 +0000 | [diff] [blame] | 71 | AX_JAVAC_AND_JAVA |
David Reiss | 62d3981 | 2008-03-02 07:00:22 +0000 | [diff] [blame] | 72 | AC_PATH_PROG([ANT], [ant]) |
David Reiss | 62d3981 | 2008-03-02 07:00:22 +0000 | [diff] [blame] | 73 | fi |
David Reiss | 82c1bab | 2008-06-11 01:16:53 +0000 | [diff] [blame] | 74 | AM_CONDITIONAL([WITH_JAVA], |
David Reiss | f8dcf03 | 2008-02-23 22:07:39 +0000 | [diff] [blame] | 75 | [test -n "$ANT" -a -n "$JAVA" -a -n "$JAVAC"]) |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 76 | |
Christopher Piro | b6f18c2 | 2008-03-04 07:09:12 +0000 | [diff] [blame] | 77 | AX_THRIFT_LIB(erlang, [Erlang], yes) |
| 78 | if test "$with_erlang" = "yes"; then |
| 79 | AC_PATH_PROG([ERLC], [erlc]) |
| 80 | fi |
David Reiss | 82c1bab | 2008-06-11 01:16:53 +0000 | [diff] [blame] | 81 | AM_CONDITIONAL(WITH_ERLANG, [test -n "$ERLC"]) |
Christopher Piro | b6f18c2 | 2008-03-04 07:09:12 +0000 | [diff] [blame] | 82 | |
David Reiss | 1a14091 | 2008-06-11 01:16:37 +0000 | [diff] [blame] | 83 | AX_THRIFT_LIB(py, [Python], yes) |
| 84 | if test "$with_py" = "yes"; then |
| 85 | AM_PATH_PYTHON(2.4,, :) |
| 86 | fi |
David Reiss | 82c1bab | 2008-06-11 01:16:53 +0000 | [diff] [blame] | 87 | AM_CONDITIONAL(WITH_PYTHON, [test -n "$PYTHON" -a "$PYTHON" != ":"]) |
David Reiss | 1a14091 | 2008-06-11 01:16:37 +0000 | [diff] [blame] | 88 | |
T Jake Luciani | 1952e54 | 2009-02-01 04:47:30 +0000 | [diff] [blame] | 89 | AX_THRIFT_LIB(perl, [Perl], yes) |
| 90 | if test "$with_perl" = "yes"; then |
| 91 | AC_PATH_PROG([PERL], [perl]) |
| 92 | fi |
| 93 | AM_CONDITIONAL(WITH_PERL, [test -n "$PERL"]) |
| 94 | |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 95 | AX_THRIFT_LIB(ruby, [Ruby], yes) |
| 96 | if test "$with_ruby" = "yes"; then |
| 97 | AC_PATH_PROG([RUBY], [ruby]) |
| 98 | fi |
David Reiss | 8d07e1d | 2008-07-11 08:04:12 +0000 | [diff] [blame] | 99 | AM_CONDITIONAL(WITH_RUBY, [test -n "$RUBY"]) |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 100 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 101 | AC_C_CONST |
| 102 | AC_C_INLINE |
| 103 | AC_C_VOLATILE |
| 104 | |
| 105 | AC_HEADER_STDBOOL |
| 106 | AC_HEADER_STDC |
| 107 | AC_HEADER_TIME |
| 108 | AC_CHECK_HEADERS([arpa/inet.h]) |
| 109 | AC_CHECK_HEADERS([endian.h]) |
| 110 | AC_CHECK_HEADERS([fcntl.h]) |
| 111 | AC_CHECK_HEADERS([inttypes.h]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 112 | AC_CHECK_HEADERS([limits.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 113 | AC_CHECK_HEADERS([netdb.h]) |
| 114 | AC_CHECK_HEADERS([netinet/in.h]) |
| 115 | AC_CHECK_HEADERS([pthread.h]) |
| 116 | AC_CHECK_HEADERS([stddef.h]) |
David Reiss | d7a16f4 | 2008-02-19 22:47:29 +0000 | [diff] [blame] | 117 | AC_CHECK_HEADERS([stdlib.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 118 | AC_CHECK_HEADERS([sys/socket.h]) |
| 119 | AC_CHECK_HEADERS([sys/time.h]) |
| 120 | AC_CHECK_HEADERS([unistd.h]) |
| 121 | AC_CHECK_HEADERS([libintl.h]) |
| 122 | AC_CHECK_HEADERS([malloc.h]) |
| 123 | |
| 124 | AC_CHECK_LIB(pthread, pthread_create) |
| 125 | AC_CHECK_LIB(rt, sched_get_priority_min) |
| 126 | |
| 127 | AC_TYPE_INT16_T |
| 128 | AC_TYPE_INT32_T |
| 129 | AC_TYPE_INT64_T |
| 130 | AC_TYPE_INT8_T |
| 131 | AC_TYPE_MODE_T |
| 132 | AC_TYPE_OFF_T |
| 133 | AC_TYPE_SIZE_T |
David Reiss | 847a294 | 2008-04-21 18:07:43 +0000 | [diff] [blame] | 134 | AC_TYPE_SSIZE_T |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 135 | AC_TYPE_UINT16_T |
| 136 | AC_TYPE_UINT32_T |
| 137 | AC_TYPE_UINT64_T |
| 138 | AC_TYPE_UINT8_T |
David Reiss | 33fc5ad | 2008-05-09 07:17:34 +0000 | [diff] [blame] | 139 | AC_CHECK_TYPES([ptrdiff_t], [], [exit 1]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 140 | |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 141 | AC_STRUCT_TM |
| 142 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 143 | AC_FUNC_ALLOCA |
| 144 | AC_FUNC_MALLOC |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 145 | AC_FUNC_MEMCMP |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 146 | AC_FUNC_REALLOC |
| 147 | AC_FUNC_SELECT_ARGTYPES |
| 148 | AC_FUNC_STAT |
| 149 | AC_FUNC_STRERROR_R |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 150 | AC_FUNC_STRFTIME |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 151 | AC_FUNC_VPRINTF |
| 152 | AC_CHECK_FUNCS([strtoul]) |
| 153 | AC_CHECK_FUNCS([bzero]) |
| 154 | AC_CHECK_FUNCS([clock_gettime]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 155 | AC_CHECK_FUNCS([ftruncate]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 156 | AC_CHECK_FUNCS([gethostbyname]) |
| 157 | AC_CHECK_FUNCS([gettimeofday]) |
| 158 | AC_CHECK_FUNCS([memmove]) |
| 159 | AC_CHECK_FUNCS([memset]) |
| 160 | AC_CHECK_FUNCS([mkdir]) |
| 161 | AC_CHECK_FUNCS([realpath]) |
| 162 | AC_CHECK_FUNCS([select]) |
| 163 | AC_CHECK_FUNCS([socket]) |
| 164 | AC_CHECK_FUNCS([strchr]) |
| 165 | AC_CHECK_FUNCS([strdup]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 166 | AC_CHECK_FUNCS([strerror]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 167 | AC_CHECK_FUNCS([strstr]) |
| 168 | AC_CHECK_FUNCS([strtol]) |
| 169 | AC_CHECK_FUNCS([sqrt]) |
| 170 | |
David Reiss | e4d4ea0 | 2009-04-02 21:37:17 +0000 | [diff] [blame^] | 171 | AX_SIGNED_RIGHT_SHIFT |
| 172 | |
David Reiss | 2258573 | 2008-02-27 01:55:33 +0000 | [diff] [blame] | 173 | AX_THRIFT_GEN(cpp, [C++], yes) |
| 174 | AM_CONDITIONAL([THRIFT_GEN_cpp], [test "$ax_thrift_gen_cpp" = "yes"]) |
David Reiss | e8a87de | 2008-02-27 02:39:25 +0000 | [diff] [blame] | 175 | AX_THRIFT_GEN(java, [Java], yes) |
| 176 | AM_CONDITIONAL([THRIFT_GEN_java], [test "$ax_thrift_gen_java" = "yes"]) |
David Reiss | ce4f4f0 | 2008-03-27 21:41:31 +0000 | [diff] [blame] | 177 | AX_THRIFT_GEN(csharp, [C#], yes) |
| 178 | AM_CONDITIONAL([THRIFT_GEN_csharp], [test "$ax_thrift_gen_csharp" = "yes"]) |
David Reiss | bfd26dc | 2008-03-27 21:41:49 +0000 | [diff] [blame] | 179 | AX_THRIFT_GEN(py, [Python], yes) |
| 180 | AM_CONDITIONAL([THRIFT_GEN_py], [test "$ax_thrift_gen_py" = "yes"]) |
David Reiss | ae25358 | 2008-03-27 21:42:11 +0000 | [diff] [blame] | 181 | AX_THRIFT_GEN(rb, [Ruby], yes) |
| 182 | AM_CONDITIONAL([THRIFT_GEN_rb], [test "$ax_thrift_gen_rb" = "yes"]) |
David Reiss | fdc21aa | 2008-03-27 21:42:34 +0000 | [diff] [blame] | 183 | AX_THRIFT_GEN(perl, [Perl], yes) |
| 184 | AM_CONDITIONAL([THRIFT_GEN_perl], [test "$ax_thrift_gen_perl" = "yes"]) |
David Reiss | 32272d9 | 2009-02-17 20:28:30 +0000 | [diff] [blame] | 185 | AX_THRIFT_GEN(php, [PHP], yes) |
| 186 | AM_CONDITIONAL([THRIFT_GEN_php], [test "$ax_thrift_gen_php" = "yes"]) |
David Reiss | f3b0db3 | 2009-02-17 20:28:01 +0000 | [diff] [blame] | 187 | AX_THRIFT_GEN(erl, [Erlang], yes) |
| 188 | AM_CONDITIONAL([THRIFT_GEN_erl], [test "$ax_thrift_gen_erl" = "yes"]) |
David Reiss | 4b349aa | 2008-03-27 21:41:02 +0000 | [diff] [blame] | 189 | AX_THRIFT_GEN(cocoa, [Cocoa], yes) |
| 190 | AM_CONDITIONAL([THRIFT_GEN_cocoa], [test "$ax_thrift_gen_cocoa" = "yes"]) |
David Reiss | b3ac8a6 | 2008-03-27 21:40:42 +0000 | [diff] [blame] | 191 | AX_THRIFT_GEN(st, [Smalltalk], yes) |
| 192 | AM_CONDITIONAL([THRIFT_GEN_st], [test "$ax_thrift_gen_st" = "yes"]) |
David Reiss | 3d671b5 | 2008-03-27 21:40:11 +0000 | [diff] [blame] | 193 | AX_THRIFT_GEN(ocaml, [OCaml], yes) |
| 194 | AM_CONDITIONAL([THRIFT_GEN_ocaml], [test "$ax_thrift_gen_ocaml" = "yes"]) |
David Reiss | 22812f8 | 2008-03-27 21:40:26 +0000 | [diff] [blame] | 195 | AX_THRIFT_GEN(hs, [Haskell], yes) |
| 196 | AM_CONDITIONAL([THRIFT_GEN_hs], [test "$ax_thrift_gen_hs" = "yes"]) |
David Reiss | 782cb67 | 2009-02-17 20:28:13 +0000 | [diff] [blame] | 197 | AX_THRIFT_GEN(xsd, [XSD], yes) |
| 198 | AM_CONDITIONAL([THRIFT_GEN_xsd], [test "$ax_thrift_gen_xsd" = "yes"]) |
David Reiss | dc0aada | 2008-10-21 00:09:23 +0000 | [diff] [blame] | 199 | AX_THRIFT_GEN(html, [HTML], yes) |
| 200 | AM_CONDITIONAL([THRIFT_GEN_html], [test "$ax_thrift_gen_html" = "yes"]) |
David Reiss | 2258573 | 2008-02-27 01:55:33 +0000 | [diff] [blame] | 201 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 202 | AC_CONFIG_HEADERS(config.h:config.hin) |
| 203 | |
| 204 | AC_CONFIG_FILES([ |
| 205 | Makefile |
| 206 | compiler/cpp/Makefile |
| 207 | lib/Makefile |
| 208 | lib/cpp/Makefile |
| 209 | lib/cpp/thrift.pc |
| 210 | lib/cpp/thrift-nb.pc |
| 211 | lib/cpp/thrift-z.pc |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 212 | lib/csharp/Makefile |
David Reiss | f8dcf03 | 2008-02-23 22:07:39 +0000 | [diff] [blame] | 213 | lib/java/Makefile |
T Jake Luciani | 1952e54 | 2009-02-01 04:47:30 +0000 | [diff] [blame] | 214 | lib/perl/Makefile |
| 215 | lib/perl/test/Makefile |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 216 | lib/py/Makefile |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 217 | lib/rb/Makefile |
David Reiss | 8180c0c | 2008-02-04 21:14:14 +0000 | [diff] [blame] | 218 | test/Makefile |
David Reiss | 9ff3b9d | 2008-02-15 01:10:23 +0000 | [diff] [blame] | 219 | test/py/Makefile |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 220 | test/rb/Makefile |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 221 | ]) |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 222 | |
| 223 | AC_OUTPUT |