blob: b4c50b4a08df96bd813d92f42b9dbc553216845c [file] [log] [blame]
David Reissfeab7732009-03-30 22:52:44 +00001#
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 Slemkob09f5882006-08-23 22:03:34 +000020AC_PREREQ(2.59)
21
David Reiss10a22bf2008-04-21 18:08:07 +000022AC_INIT([thrift], [20080411])
Marc Slemkob09f5882006-08-23 22:03:34 +000023
24AC_CONFIG_AUX_DIR([.])
25
26AM_INIT_AUTOMAKE
27
David Reissd6832192007-09-05 00:47:32 +000028AC_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 Reisscdd6f3c2008-03-04 21:10:29 +000032AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"])
David Reissd6832192007-09-05 00:47:32 +000033
David Reissf0c21a72008-07-11 01:26:16 +000034AC_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"])
38AS_IF([test "x$JAVA_PREFIX" = x], [JAVA_PREFIX="/usr/local/lib"])
David Reiss832b2622007-12-28 18:25:33 +000039
40AC_PROG_CC
41AC_PROG_CPP
42AC_PROG_CXX
43AC_PROG_INSTALL
44AC_PROG_LIBTOOL
45AC_PROG_MAKE_SET
46AC_PROG_YACC
47AC_PROG_LEX
48AM_PROG_LEX
David Reiss7ed4b982008-02-11 23:24:47 +000049AC_PROG_LN_S
50AC_PROG_MKDIR_P
David Reiss832b2622007-12-28 18:25:33 +000051
52AC_LANG([C++])
53AX_BOOST_BASE([1.33.1])
54
55AX_LIB_EVENT([1.0])
56AM_CONDITIONAL([AMX_HAVE_LIBEVENT], [test "$success" = "yes"])
57
58AX_LIB_ZLIB([1.2.3])
59AM_CONDITIONAL([AMX_HAVE_ZLIB], [test "$success" = "yes"])
60
David Reiss520b5ee2008-03-02 07:00:26 +000061AX_THRIFT_LIB(csharp, [C#], yes)
62if test "$with_csharp" = "yes"; then
David Reissd831a212009-02-13 03:09:52 +000063 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 Reiss520b5ee2008-03-02 07:00:26 +000065fi
David Reiss82c1bab2008-06-11 01:16:53 +000066AM_CONDITIONAL(WITH_MONO, [test "$have_mono" = "yes"])
David Reissd831a212009-02-13 03:09:52 +000067AM_CONDITIONAL(NET_2_0, [test "$net_3_5" = "no"])
David Reiss1fdb5922008-02-06 22:10:12 +000068
David Reiss62d39812008-03-02 07:00:22 +000069AX_THRIFT_LIB(java, [Java], yes)
70if test "$with_java" = "yes"; then
David Reissd9cdf422009-03-13 21:25:29 +000071 AX_JAVAC_AND_JAVA
David Reiss62d39812008-03-02 07:00:22 +000072 AC_PATH_PROG([ANT], [ant])
David Reiss62d39812008-03-02 07:00:22 +000073fi
David Reiss82c1bab2008-06-11 01:16:53 +000074AM_CONDITIONAL([WITH_JAVA],
David Reissf8dcf032008-02-23 22:07:39 +000075 [test -n "$ANT" -a -n "$JAVA" -a -n "$JAVAC"])
David Reiss1fdb5922008-02-06 22:10:12 +000076
Christopher Pirob6f18c22008-03-04 07:09:12 +000077AX_THRIFT_LIB(erlang, [Erlang], yes)
78if test "$with_erlang" = "yes"; then
79 AC_PATH_PROG([ERLC], [erlc])
80fi
David Reiss82c1bab2008-06-11 01:16:53 +000081AM_CONDITIONAL(WITH_ERLANG, [test -n "$ERLC"])
Christopher Pirob6f18c22008-03-04 07:09:12 +000082
David Reiss1a140912008-06-11 01:16:37 +000083AX_THRIFT_LIB(py, [Python], yes)
84if test "$with_py" = "yes"; then
85 AM_PATH_PYTHON(2.4,, :)
86fi
David Reiss82c1bab2008-06-11 01:16:53 +000087AM_CONDITIONAL(WITH_PYTHON, [test -n "$PYTHON" -a "$PYTHON" != ":"])
David Reiss1a140912008-06-11 01:16:37 +000088
T Jake Luciani1952e542009-02-01 04:47:30 +000089AX_THRIFT_LIB(perl, [Perl], yes)
90if test "$with_perl" = "yes"; then
91 AC_PATH_PROG([PERL], [perl])
92fi
93AM_CONDITIONAL(WITH_PERL, [test -n "$PERL"])
94
Kevin Clark4bd89162008-07-08 00:47:49 +000095AX_THRIFT_LIB(ruby, [Ruby], yes)
96if test "$with_ruby" = "yes"; then
97 AC_PATH_PROG([RUBY], [ruby])
Bryan Duxburyec473582009-04-07 16:31:04 +000098 AC_PATH_PROG([RSPEC], [spec])
Kevin Clark4bd89162008-07-08 00:47:49 +000099fi
David Reiss8d07e1d2008-07-11 08:04:12 +0000100AM_CONDITIONAL(WITH_RUBY, [test -n "$RUBY"])
Bryan Duxburyec473582009-04-07 16:31:04 +0000101AM_CONDITIONAL(HAVE_RSPEC, [test -n "$RSPEC"])
102
Kevin Clark4bd89162008-07-08 00:47:49 +0000103
David Reiss832b2622007-12-28 18:25:33 +0000104AC_C_CONST
105AC_C_INLINE
106AC_C_VOLATILE
107
108AC_HEADER_STDBOOL
109AC_HEADER_STDC
110AC_HEADER_TIME
111AC_CHECK_HEADERS([arpa/inet.h])
112AC_CHECK_HEADERS([endian.h])
113AC_CHECK_HEADERS([fcntl.h])
114AC_CHECK_HEADERS([inttypes.h])
David Reiss7ed4b982008-02-11 23:24:47 +0000115AC_CHECK_HEADERS([limits.h])
David Reiss832b2622007-12-28 18:25:33 +0000116AC_CHECK_HEADERS([netdb.h])
117AC_CHECK_HEADERS([netinet/in.h])
118AC_CHECK_HEADERS([pthread.h])
119AC_CHECK_HEADERS([stddef.h])
David Reissd7a16f42008-02-19 22:47:29 +0000120AC_CHECK_HEADERS([stdlib.h])
David Reiss832b2622007-12-28 18:25:33 +0000121AC_CHECK_HEADERS([sys/socket.h])
122AC_CHECK_HEADERS([sys/time.h])
123AC_CHECK_HEADERS([unistd.h])
124AC_CHECK_HEADERS([libintl.h])
125AC_CHECK_HEADERS([malloc.h])
126
127AC_CHECK_LIB(pthread, pthread_create)
128AC_CHECK_LIB(rt, sched_get_priority_min)
129
130AC_TYPE_INT16_T
131AC_TYPE_INT32_T
132AC_TYPE_INT64_T
133AC_TYPE_INT8_T
134AC_TYPE_MODE_T
135AC_TYPE_OFF_T
136AC_TYPE_SIZE_T
David Reiss847a2942008-04-21 18:07:43 +0000137AC_TYPE_SSIZE_T
David Reiss832b2622007-12-28 18:25:33 +0000138AC_TYPE_UINT16_T
139AC_TYPE_UINT32_T
140AC_TYPE_UINT64_T
141AC_TYPE_UINT8_T
David Reiss33fc5ad2008-05-09 07:17:34 +0000142AC_CHECK_TYPES([ptrdiff_t], [], [exit 1])
David Reiss832b2622007-12-28 18:25:33 +0000143
David Reiss7ed4b982008-02-11 23:24:47 +0000144AC_STRUCT_TM
145
David Reiss832b2622007-12-28 18:25:33 +0000146AC_FUNC_ALLOCA
147AC_FUNC_MALLOC
David Reiss7ed4b982008-02-11 23:24:47 +0000148AC_FUNC_MEMCMP
David Reiss832b2622007-12-28 18:25:33 +0000149AC_FUNC_REALLOC
150AC_FUNC_SELECT_ARGTYPES
151AC_FUNC_STAT
152AC_FUNC_STRERROR_R
David Reiss7ed4b982008-02-11 23:24:47 +0000153AC_FUNC_STRFTIME
David Reiss832b2622007-12-28 18:25:33 +0000154AC_FUNC_VPRINTF
155AC_CHECK_FUNCS([strtoul])
156AC_CHECK_FUNCS([bzero])
157AC_CHECK_FUNCS([clock_gettime])
David Reiss7ed4b982008-02-11 23:24:47 +0000158AC_CHECK_FUNCS([ftruncate])
David Reiss832b2622007-12-28 18:25:33 +0000159AC_CHECK_FUNCS([gethostbyname])
160AC_CHECK_FUNCS([gettimeofday])
161AC_CHECK_FUNCS([memmove])
162AC_CHECK_FUNCS([memset])
163AC_CHECK_FUNCS([mkdir])
164AC_CHECK_FUNCS([realpath])
165AC_CHECK_FUNCS([select])
166AC_CHECK_FUNCS([socket])
167AC_CHECK_FUNCS([strchr])
168AC_CHECK_FUNCS([strdup])
David Reiss7ed4b982008-02-11 23:24:47 +0000169AC_CHECK_FUNCS([strerror])
David Reiss832b2622007-12-28 18:25:33 +0000170AC_CHECK_FUNCS([strstr])
171AC_CHECK_FUNCS([strtol])
172AC_CHECK_FUNCS([sqrt])
173
David Reisse4d4ea02009-04-02 21:37:17 +0000174AX_SIGNED_RIGHT_SHIFT
175
David Reiss22585732008-02-27 01:55:33 +0000176AX_THRIFT_GEN(cpp, [C++], yes)
177AM_CONDITIONAL([THRIFT_GEN_cpp], [test "$ax_thrift_gen_cpp" = "yes"])
David Reisse8a87de2008-02-27 02:39:25 +0000178AX_THRIFT_GEN(java, [Java], yes)
179AM_CONDITIONAL([THRIFT_GEN_java], [test "$ax_thrift_gen_java" = "yes"])
David Reissce4f4f02008-03-27 21:41:31 +0000180AX_THRIFT_GEN(csharp, [C#], yes)
181AM_CONDITIONAL([THRIFT_GEN_csharp], [test "$ax_thrift_gen_csharp" = "yes"])
David Reissbfd26dc2008-03-27 21:41:49 +0000182AX_THRIFT_GEN(py, [Python], yes)
183AM_CONDITIONAL([THRIFT_GEN_py], [test "$ax_thrift_gen_py" = "yes"])
David Reissae253582008-03-27 21:42:11 +0000184AX_THRIFT_GEN(rb, [Ruby], yes)
185AM_CONDITIONAL([THRIFT_GEN_rb], [test "$ax_thrift_gen_rb" = "yes"])
David Reissfdc21aa2008-03-27 21:42:34 +0000186AX_THRIFT_GEN(perl, [Perl], yes)
187AM_CONDITIONAL([THRIFT_GEN_perl], [test "$ax_thrift_gen_perl" = "yes"])
David Reiss32272d92009-02-17 20:28:30 +0000188AX_THRIFT_GEN(php, [PHP], yes)
189AM_CONDITIONAL([THRIFT_GEN_php], [test "$ax_thrift_gen_php" = "yes"])
David Reissf3b0db32009-02-17 20:28:01 +0000190AX_THRIFT_GEN(erl, [Erlang], yes)
191AM_CONDITIONAL([THRIFT_GEN_erl], [test "$ax_thrift_gen_erl" = "yes"])
David Reiss4b349aa2008-03-27 21:41:02 +0000192AX_THRIFT_GEN(cocoa, [Cocoa], yes)
193AM_CONDITIONAL([THRIFT_GEN_cocoa], [test "$ax_thrift_gen_cocoa" = "yes"])
David Reissb3ac8a62008-03-27 21:40:42 +0000194AX_THRIFT_GEN(st, [Smalltalk], yes)
195AM_CONDITIONAL([THRIFT_GEN_st], [test "$ax_thrift_gen_st" = "yes"])
David Reiss3d671b52008-03-27 21:40:11 +0000196AX_THRIFT_GEN(ocaml, [OCaml], yes)
197AM_CONDITIONAL([THRIFT_GEN_ocaml], [test "$ax_thrift_gen_ocaml" = "yes"])
David Reiss22812f82008-03-27 21:40:26 +0000198AX_THRIFT_GEN(hs, [Haskell], yes)
199AM_CONDITIONAL([THRIFT_GEN_hs], [test "$ax_thrift_gen_hs" = "yes"])
David Reiss782cb672009-02-17 20:28:13 +0000200AX_THRIFT_GEN(xsd, [XSD], yes)
201AM_CONDITIONAL([THRIFT_GEN_xsd], [test "$ax_thrift_gen_xsd" = "yes"])
David Reissdc0aada2008-10-21 00:09:23 +0000202AX_THRIFT_GEN(html, [HTML], yes)
203AM_CONDITIONAL([THRIFT_GEN_html], [test "$ax_thrift_gen_html" = "yes"])
David Reiss22585732008-02-27 01:55:33 +0000204
David Reiss832b2622007-12-28 18:25:33 +0000205AC_CONFIG_HEADERS(config.h:config.hin)
206
207AC_CONFIG_FILES([
208 Makefile
209 compiler/cpp/Makefile
210 lib/Makefile
211 lib/cpp/Makefile
212 lib/cpp/thrift.pc
213 lib/cpp/thrift-nb.pc
214 lib/cpp/thrift-z.pc
David Reiss1fdb5922008-02-06 22:10:12 +0000215 lib/csharp/Makefile
David Reissf8dcf032008-02-23 22:07:39 +0000216 lib/java/Makefile
T Jake Luciani1952e542009-02-01 04:47:30 +0000217 lib/perl/Makefile
218 lib/perl/test/Makefile
David Reiss832b2622007-12-28 18:25:33 +0000219 lib/py/Makefile
Kevin Clark4bd89162008-07-08 00:47:49 +0000220 lib/rb/Makefile
David Reiss8180c0c2008-02-04 21:14:14 +0000221 test/Makefile
David Reiss9ff3b9d2008-02-15 01:10:23 +0000222 test/py/Makefile
Kevin Clark4bd89162008-07-08 00:47:49 +0000223 test/rb/Makefile
David Reiss832b2622007-12-28 18:25:33 +0000224])
Marc Slemkob09f5882006-08-23 22:03:34 +0000225
226AC_OUTPUT