blob: 69e292c5f945c9c38bd5c5510f423ce865491644 [file] [log] [blame]
Marc Slemkob09f5882006-08-23 22:03:34 +00001AC_PREREQ(2.59)
2
David Reiss10a22bf2008-04-21 18:08:07 +00003AC_INIT([thrift], [20080411])
Marc Slemkob09f5882006-08-23 22:03:34 +00004
5AC_CONFIG_AUX_DIR([.])
6
7AM_INIT_AUTOMAKE
8
David Reissd6832192007-09-05 00:47:32 +00009AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules.
10 (Normal --prefix is ignored for Python because
11 Python has different conventions.)
12 Default = "/usr"])
David Reisscdd6f3c2008-03-04 21:10:29 +000013AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"])
David Reissd6832192007-09-05 00:47:32 +000014
David Reissf0c21a72008-07-11 01:26:16 +000015AC_ARG_VAR([JAVA_PREFIX], [Prefix for installing the Java lib jar.
16 (Normal --prefix is ignored for Java because
17 Java has different conevntions.)
18 Default = "/usr/local/lib"])
19AS_IF([test "x$JAVA_PREFIX" = x], [JAVA_PREFIX="/usr/local/lib"])
David Reiss832b2622007-12-28 18:25:33 +000020
21AC_PROG_CC
22AC_PROG_CPP
23AC_PROG_CXX
24AC_PROG_INSTALL
25AC_PROG_LIBTOOL
26AC_PROG_MAKE_SET
27AC_PROG_YACC
28AC_PROG_LEX
29AM_PROG_LEX
David Reiss7ed4b982008-02-11 23:24:47 +000030AC_PROG_LN_S
31AC_PROG_MKDIR_P
David Reiss832b2622007-12-28 18:25:33 +000032
33AC_LANG([C++])
34AX_BOOST_BASE([1.33.1])
35
36AX_LIB_EVENT([1.0])
37AM_CONDITIONAL([AMX_HAVE_LIBEVENT], [test "$success" = "yes"])
38
39AX_LIB_ZLIB([1.2.3])
40AM_CONDITIONAL([AMX_HAVE_ZLIB], [test "$success" = "yes"])
41
David Reiss520b5ee2008-03-02 07:00:26 +000042AX_THRIFT_LIB(csharp, [C#], yes)
43if test "$with_csharp" = "yes"; then
David Reissd831a212009-02-13 03:09:52 +000044 PKG_CHECK_MODULES(MONO, mono >= 2.0.0, net_3_5=yes, net_3_5=no)
45 PKG_CHECK_MODULES(MONO, mono >= 1.2.4, have_mono=yes, have_mono=no)
David Reiss520b5ee2008-03-02 07:00:26 +000046fi
David Reiss82c1bab2008-06-11 01:16:53 +000047AM_CONDITIONAL(WITH_MONO, [test "$have_mono" = "yes"])
David Reissd831a212009-02-13 03:09:52 +000048AM_CONDITIONAL(NET_2_0, [test "$net_3_5" = "no"])
David Reiss1fdb5922008-02-06 22:10:12 +000049
David Reiss62d39812008-03-02 07:00:22 +000050AX_THRIFT_LIB(java, [Java], yes)
51if test "$with_java" = "yes"; then
52 AC_PATH_PROG([ANT], [ant])
53 AX_PROG_JAVAC
54 AX_PROG_JAVA
55fi
David Reiss82c1bab2008-06-11 01:16:53 +000056AM_CONDITIONAL([WITH_JAVA],
David Reissf8dcf032008-02-23 22:07:39 +000057 [test -n "$ANT" -a -n "$JAVA" -a -n "$JAVAC"])
David Reiss1fdb5922008-02-06 22:10:12 +000058
Christopher Pirob6f18c22008-03-04 07:09:12 +000059AX_THRIFT_LIB(erlang, [Erlang], yes)
60if test "$with_erlang" = "yes"; then
61 AC_PATH_PROG([ERLC], [erlc])
62fi
David Reiss82c1bab2008-06-11 01:16:53 +000063AM_CONDITIONAL(WITH_ERLANG, [test -n "$ERLC"])
Christopher Pirob6f18c22008-03-04 07:09:12 +000064
David Reiss1a140912008-06-11 01:16:37 +000065AX_THRIFT_LIB(py, [Python], yes)
66if test "$with_py" = "yes"; then
67 AM_PATH_PYTHON(2.4,, :)
68fi
David Reiss82c1bab2008-06-11 01:16:53 +000069AM_CONDITIONAL(WITH_PYTHON, [test -n "$PYTHON" -a "$PYTHON" != ":"])
David Reiss1a140912008-06-11 01:16:37 +000070
T Jake Luciani1952e542009-02-01 04:47:30 +000071AX_THRIFT_LIB(perl, [Perl], yes)
72if test "$with_perl" = "yes"; then
73 AC_PATH_PROG([PERL], [perl])
74fi
75AM_CONDITIONAL(WITH_PERL, [test -n "$PERL"])
76
Kevin Clark4bd89162008-07-08 00:47:49 +000077AX_THRIFT_LIB(ruby, [Ruby], yes)
78if test "$with_ruby" = "yes"; then
79 AC_PATH_PROG([RUBY], [ruby])
80fi
David Reiss8d07e1d2008-07-11 08:04:12 +000081AM_CONDITIONAL(WITH_RUBY, [test -n "$RUBY"])
Kevin Clark4bd89162008-07-08 00:47:49 +000082
David Reiss832b2622007-12-28 18:25:33 +000083AC_C_CONST
84AC_C_INLINE
85AC_C_VOLATILE
86
87AC_HEADER_STDBOOL
88AC_HEADER_STDC
89AC_HEADER_TIME
90AC_CHECK_HEADERS([arpa/inet.h])
91AC_CHECK_HEADERS([endian.h])
92AC_CHECK_HEADERS([fcntl.h])
93AC_CHECK_HEADERS([inttypes.h])
David Reiss7ed4b982008-02-11 23:24:47 +000094AC_CHECK_HEADERS([limits.h])
David Reiss832b2622007-12-28 18:25:33 +000095AC_CHECK_HEADERS([netdb.h])
96AC_CHECK_HEADERS([netinet/in.h])
97AC_CHECK_HEADERS([pthread.h])
98AC_CHECK_HEADERS([stddef.h])
David Reissd7a16f42008-02-19 22:47:29 +000099AC_CHECK_HEADERS([stdlib.h])
David Reiss832b2622007-12-28 18:25:33 +0000100AC_CHECK_HEADERS([sys/socket.h])
101AC_CHECK_HEADERS([sys/time.h])
102AC_CHECK_HEADERS([unistd.h])
103AC_CHECK_HEADERS([libintl.h])
104AC_CHECK_HEADERS([malloc.h])
105
106AC_CHECK_LIB(pthread, pthread_create)
107AC_CHECK_LIB(rt, sched_get_priority_min)
108
109AC_TYPE_INT16_T
110AC_TYPE_INT32_T
111AC_TYPE_INT64_T
112AC_TYPE_INT8_T
113AC_TYPE_MODE_T
114AC_TYPE_OFF_T
115AC_TYPE_SIZE_T
David Reiss847a2942008-04-21 18:07:43 +0000116AC_TYPE_SSIZE_T
David Reiss832b2622007-12-28 18:25:33 +0000117AC_TYPE_UINT16_T
118AC_TYPE_UINT32_T
119AC_TYPE_UINT64_T
120AC_TYPE_UINT8_T
David Reiss33fc5ad2008-05-09 07:17:34 +0000121AC_CHECK_TYPES([ptrdiff_t], [], [exit 1])
David Reiss832b2622007-12-28 18:25:33 +0000122
David Reiss7ed4b982008-02-11 23:24:47 +0000123AC_STRUCT_TM
124
David Reiss832b2622007-12-28 18:25:33 +0000125AC_FUNC_ALLOCA
126AC_FUNC_MALLOC
David Reiss7ed4b982008-02-11 23:24:47 +0000127AC_FUNC_MEMCMP
David Reiss832b2622007-12-28 18:25:33 +0000128AC_FUNC_REALLOC
129AC_FUNC_SELECT_ARGTYPES
130AC_FUNC_STAT
131AC_FUNC_STRERROR_R
David Reiss7ed4b982008-02-11 23:24:47 +0000132AC_FUNC_STRFTIME
David Reiss832b2622007-12-28 18:25:33 +0000133AC_FUNC_VPRINTF
134AC_CHECK_FUNCS([strtoul])
135AC_CHECK_FUNCS([bzero])
136AC_CHECK_FUNCS([clock_gettime])
David Reiss7ed4b982008-02-11 23:24:47 +0000137AC_CHECK_FUNCS([ftruncate])
David Reiss832b2622007-12-28 18:25:33 +0000138AC_CHECK_FUNCS([gethostbyname])
139AC_CHECK_FUNCS([gettimeofday])
140AC_CHECK_FUNCS([memmove])
141AC_CHECK_FUNCS([memset])
142AC_CHECK_FUNCS([mkdir])
143AC_CHECK_FUNCS([realpath])
144AC_CHECK_FUNCS([select])
145AC_CHECK_FUNCS([socket])
146AC_CHECK_FUNCS([strchr])
147AC_CHECK_FUNCS([strdup])
David Reiss7ed4b982008-02-11 23:24:47 +0000148AC_CHECK_FUNCS([strerror])
David Reiss832b2622007-12-28 18:25:33 +0000149AC_CHECK_FUNCS([strstr])
150AC_CHECK_FUNCS([strtol])
151AC_CHECK_FUNCS([sqrt])
152
David Reiss22585732008-02-27 01:55:33 +0000153AX_THRIFT_GEN(cpp, [C++], yes)
154AM_CONDITIONAL([THRIFT_GEN_cpp], [test "$ax_thrift_gen_cpp" = "yes"])
David Reisse8a87de2008-02-27 02:39:25 +0000155AX_THRIFT_GEN(java, [Java], yes)
156AM_CONDITIONAL([THRIFT_GEN_java], [test "$ax_thrift_gen_java" = "yes"])
David Reissce4f4f02008-03-27 21:41:31 +0000157AX_THRIFT_GEN(csharp, [C#], yes)
158AM_CONDITIONAL([THRIFT_GEN_csharp], [test "$ax_thrift_gen_csharp" = "yes"])
David Reissbfd26dc2008-03-27 21:41:49 +0000159AX_THRIFT_GEN(py, [Python], yes)
160AM_CONDITIONAL([THRIFT_GEN_py], [test "$ax_thrift_gen_py" = "yes"])
David Reissae253582008-03-27 21:42:11 +0000161AX_THRIFT_GEN(rb, [Ruby], yes)
162AM_CONDITIONAL([THRIFT_GEN_rb], [test "$ax_thrift_gen_rb" = "yes"])
David Reissfdc21aa2008-03-27 21:42:34 +0000163AX_THRIFT_GEN(perl, [Perl], yes)
164AM_CONDITIONAL([THRIFT_GEN_perl], [test "$ax_thrift_gen_perl" = "yes"])
David Reissf3b0db32009-02-17 20:28:01 +0000165AX_THRIFT_GEN(erl, [Erlang], yes)
166AM_CONDITIONAL([THRIFT_GEN_erl], [test "$ax_thrift_gen_erl" = "yes"])
David Reiss4b349aa2008-03-27 21:41:02 +0000167AX_THRIFT_GEN(cocoa, [Cocoa], yes)
168AM_CONDITIONAL([THRIFT_GEN_cocoa], [test "$ax_thrift_gen_cocoa" = "yes"])
David Reissb3ac8a62008-03-27 21:40:42 +0000169AX_THRIFT_GEN(st, [Smalltalk], yes)
170AM_CONDITIONAL([THRIFT_GEN_st], [test "$ax_thrift_gen_st" = "yes"])
David Reiss3d671b52008-03-27 21:40:11 +0000171AX_THRIFT_GEN(ocaml, [OCaml], yes)
172AM_CONDITIONAL([THRIFT_GEN_ocaml], [test "$ax_thrift_gen_ocaml" = "yes"])
David Reiss22812f82008-03-27 21:40:26 +0000173AX_THRIFT_GEN(hs, [Haskell], yes)
174AM_CONDITIONAL([THRIFT_GEN_hs], [test "$ax_thrift_gen_hs" = "yes"])
David Reiss782cb672009-02-17 20:28:13 +0000175AX_THRIFT_GEN(xsd, [XSD], yes)
176AM_CONDITIONAL([THRIFT_GEN_xsd], [test "$ax_thrift_gen_xsd" = "yes"])
David Reissdc0aada2008-10-21 00:09:23 +0000177AX_THRIFT_GEN(html, [HTML], yes)
178AM_CONDITIONAL([THRIFT_GEN_html], [test "$ax_thrift_gen_html" = "yes"])
David Reiss22585732008-02-27 01:55:33 +0000179
David Reiss832b2622007-12-28 18:25:33 +0000180AC_CONFIG_HEADERS(config.h:config.hin)
181
182AC_CONFIG_FILES([
183 Makefile
184 compiler/cpp/Makefile
185 lib/Makefile
186 lib/cpp/Makefile
187 lib/cpp/thrift.pc
188 lib/cpp/thrift-nb.pc
189 lib/cpp/thrift-z.pc
David Reiss1fdb5922008-02-06 22:10:12 +0000190 lib/csharp/Makefile
David Reissf8dcf032008-02-23 22:07:39 +0000191 lib/java/Makefile
T Jake Luciani1952e542009-02-01 04:47:30 +0000192 lib/perl/Makefile
193 lib/perl/test/Makefile
David Reiss832b2622007-12-28 18:25:33 +0000194 lib/py/Makefile
Kevin Clark4bd89162008-07-08 00:47:49 +0000195 lib/rb/Makefile
David Reiss8180c0c2008-02-04 21:14:14 +0000196 test/Makefile
David Reiss9ff3b9d2008-02-15 01:10:23 +0000197 test/py/Makefile
Kevin Clark4bd89162008-07-08 00:47:49 +0000198 test/rb/Makefile
David Reiss832b2622007-12-28 18:25:33 +0000199])
Marc Slemkob09f5882006-08-23 22:03:34 +0000200
201AC_OUTPUT