blob: df5c2294bb4e80c4f5fe4eed722c1586a309369f [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 Reiss832b2622007-12-28 18:25:33 +000015
16AC_PROG_CC
17AC_PROG_CPP
18AC_PROG_CXX
19AC_PROG_INSTALL
20AC_PROG_LIBTOOL
21AC_PROG_MAKE_SET
22AC_PROG_YACC
23AC_PROG_LEX
24AM_PROG_LEX
David Reiss7ed4b982008-02-11 23:24:47 +000025AC_PROG_LN_S
26AC_PROG_MKDIR_P
David Reiss832b2622007-12-28 18:25:33 +000027
28AC_LANG([C++])
29AX_BOOST_BASE([1.33.1])
30
31AX_LIB_EVENT([1.0])
32AM_CONDITIONAL([AMX_HAVE_LIBEVENT], [test "$success" = "yes"])
33
34AX_LIB_ZLIB([1.2.3])
35AM_CONDITIONAL([AMX_HAVE_ZLIB], [test "$success" = "yes"])
36
David Reiss520b5ee2008-03-02 07:00:26 +000037AX_THRIFT_LIB(csharp, [C#], yes)
38if test "$with_csharp" = "yes"; then
39 PKG_CHECK_MODULES(MONO, mono >= 1.2.6, have_mono=yes, have_mono=no)
40fi
David Reiss82c1bab2008-06-11 01:16:53 +000041AM_CONDITIONAL(WITH_MONO, [test "$have_mono" = "yes"])
David Reiss1fdb5922008-02-06 22:10:12 +000042
David Reiss62d39812008-03-02 07:00:22 +000043AX_THRIFT_LIB(java, [Java], yes)
44if test "$with_java" = "yes"; then
45 AC_PATH_PROG([ANT], [ant])
46 AX_PROG_JAVAC
47 AX_PROG_JAVA
48fi
David Reiss82c1bab2008-06-11 01:16:53 +000049AM_CONDITIONAL([WITH_JAVA],
David Reissf8dcf032008-02-23 22:07:39 +000050 [test -n "$ANT" -a -n "$JAVA" -a -n "$JAVAC"])
David Reiss1fdb5922008-02-06 22:10:12 +000051
Christopher Pirob6f18c22008-03-04 07:09:12 +000052AX_THRIFT_LIB(erlang, [Erlang], yes)
53if test "$with_erlang" = "yes"; then
54 AC_PATH_PROG([ERLC], [erlc])
55fi
David Reiss82c1bab2008-06-11 01:16:53 +000056AM_CONDITIONAL(WITH_ERLANG, [test -n "$ERLC"])
Christopher Pirob6f18c22008-03-04 07:09:12 +000057
David Reiss1a140912008-06-11 01:16:37 +000058AX_THRIFT_LIB(py, [Python], yes)
59if test "$with_py" = "yes"; then
60 AM_PATH_PYTHON(2.4,, :)
61fi
David Reiss82c1bab2008-06-11 01:16:53 +000062AM_CONDITIONAL(WITH_PYTHON, [test -n "$PYTHON" -a "$PYTHON" != ":"])
David Reiss1a140912008-06-11 01:16:37 +000063
David Reiss832b2622007-12-28 18:25:33 +000064AC_C_CONST
65AC_C_INLINE
66AC_C_VOLATILE
67
68AC_HEADER_STDBOOL
69AC_HEADER_STDC
70AC_HEADER_TIME
71AC_CHECK_HEADERS([arpa/inet.h])
72AC_CHECK_HEADERS([endian.h])
73AC_CHECK_HEADERS([fcntl.h])
74AC_CHECK_HEADERS([inttypes.h])
David Reiss7ed4b982008-02-11 23:24:47 +000075AC_CHECK_HEADERS([limits.h])
David Reiss832b2622007-12-28 18:25:33 +000076AC_CHECK_HEADERS([netdb.h])
77AC_CHECK_HEADERS([netinet/in.h])
78AC_CHECK_HEADERS([pthread.h])
79AC_CHECK_HEADERS([stddef.h])
David Reissd7a16f42008-02-19 22:47:29 +000080AC_CHECK_HEADERS([stdlib.h])
David Reiss832b2622007-12-28 18:25:33 +000081AC_CHECK_HEADERS([sys/socket.h])
82AC_CHECK_HEADERS([sys/time.h])
83AC_CHECK_HEADERS([unistd.h])
84AC_CHECK_HEADERS([libintl.h])
85AC_CHECK_HEADERS([malloc.h])
86
87AC_CHECK_LIB(pthread, pthread_create)
88AC_CHECK_LIB(rt, sched_get_priority_min)
89
90AC_TYPE_INT16_T
91AC_TYPE_INT32_T
92AC_TYPE_INT64_T
93AC_TYPE_INT8_T
94AC_TYPE_MODE_T
95AC_TYPE_OFF_T
96AC_TYPE_SIZE_T
David Reiss847a2942008-04-21 18:07:43 +000097AC_TYPE_SSIZE_T
David Reiss832b2622007-12-28 18:25:33 +000098AC_TYPE_UINT16_T
99AC_TYPE_UINT32_T
100AC_TYPE_UINT64_T
101AC_TYPE_UINT8_T
David Reiss33fc5ad2008-05-09 07:17:34 +0000102AC_CHECK_TYPES([ptrdiff_t], [], [exit 1])
David Reiss832b2622007-12-28 18:25:33 +0000103
David Reiss7ed4b982008-02-11 23:24:47 +0000104AC_STRUCT_TM
105
David Reiss832b2622007-12-28 18:25:33 +0000106AC_FUNC_ALLOCA
107AC_FUNC_MALLOC
David Reiss7ed4b982008-02-11 23:24:47 +0000108AC_FUNC_MEMCMP
David Reiss832b2622007-12-28 18:25:33 +0000109AC_FUNC_REALLOC
110AC_FUNC_SELECT_ARGTYPES
111AC_FUNC_STAT
112AC_FUNC_STRERROR_R
David Reiss7ed4b982008-02-11 23:24:47 +0000113AC_FUNC_STRFTIME
David Reiss832b2622007-12-28 18:25:33 +0000114AC_FUNC_VPRINTF
115AC_CHECK_FUNCS([strtoul])
116AC_CHECK_FUNCS([bzero])
117AC_CHECK_FUNCS([clock_gettime])
David Reiss7ed4b982008-02-11 23:24:47 +0000118AC_CHECK_FUNCS([ftruncate])
David Reiss832b2622007-12-28 18:25:33 +0000119AC_CHECK_FUNCS([gethostbyname])
120AC_CHECK_FUNCS([gettimeofday])
121AC_CHECK_FUNCS([memmove])
122AC_CHECK_FUNCS([memset])
123AC_CHECK_FUNCS([mkdir])
124AC_CHECK_FUNCS([realpath])
125AC_CHECK_FUNCS([select])
126AC_CHECK_FUNCS([socket])
127AC_CHECK_FUNCS([strchr])
128AC_CHECK_FUNCS([strdup])
David Reiss7ed4b982008-02-11 23:24:47 +0000129AC_CHECK_FUNCS([strerror])
David Reiss832b2622007-12-28 18:25:33 +0000130AC_CHECK_FUNCS([strstr])
131AC_CHECK_FUNCS([strtol])
132AC_CHECK_FUNCS([sqrt])
133
David Reiss22585732008-02-27 01:55:33 +0000134AX_THRIFT_GEN(cpp, [C++], yes)
135AM_CONDITIONAL([THRIFT_GEN_cpp], [test "$ax_thrift_gen_cpp" = "yes"])
David Reisse8a87de2008-02-27 02:39:25 +0000136AX_THRIFT_GEN(java, [Java], yes)
137AM_CONDITIONAL([THRIFT_GEN_java], [test "$ax_thrift_gen_java" = "yes"])
David Reissce4f4f02008-03-27 21:41:31 +0000138AX_THRIFT_GEN(csharp, [C#], yes)
139AM_CONDITIONAL([THRIFT_GEN_csharp], [test "$ax_thrift_gen_csharp" = "yes"])
David Reissbfd26dc2008-03-27 21:41:49 +0000140AX_THRIFT_GEN(py, [Python], yes)
141AM_CONDITIONAL([THRIFT_GEN_py], [test "$ax_thrift_gen_py" = "yes"])
David Reissae253582008-03-27 21:42:11 +0000142AX_THRIFT_GEN(rb, [Ruby], yes)
143AM_CONDITIONAL([THRIFT_GEN_rb], [test "$ax_thrift_gen_rb" = "yes"])
David Reissfdc21aa2008-03-27 21:42:34 +0000144AX_THRIFT_GEN(perl, [Perl], yes)
145AM_CONDITIONAL([THRIFT_GEN_perl], [test "$ax_thrift_gen_perl" = "yes"])
David Reiss4b349aa2008-03-27 21:41:02 +0000146AX_THRIFT_GEN(cocoa, [Cocoa], yes)
147AM_CONDITIONAL([THRIFT_GEN_cocoa], [test "$ax_thrift_gen_cocoa" = "yes"])
David Reissb3ac8a62008-03-27 21:40:42 +0000148AX_THRIFT_GEN(st, [Smalltalk], yes)
149AM_CONDITIONAL([THRIFT_GEN_st], [test "$ax_thrift_gen_st" = "yes"])
David Reiss3d671b52008-03-27 21:40:11 +0000150AX_THRIFT_GEN(ocaml, [OCaml], yes)
151AM_CONDITIONAL([THRIFT_GEN_ocaml], [test "$ax_thrift_gen_ocaml" = "yes"])
David Reiss22812f82008-03-27 21:40:26 +0000152AX_THRIFT_GEN(hs, [Haskell], yes)
153AM_CONDITIONAL([THRIFT_GEN_hs], [test "$ax_thrift_gen_hs" = "yes"])
David Reiss22585732008-02-27 01:55:33 +0000154
David Reiss832b2622007-12-28 18:25:33 +0000155AC_CONFIG_HEADERS(config.h:config.hin)
156
157AC_CONFIG_FILES([
158 Makefile
159 compiler/cpp/Makefile
160 lib/Makefile
161 lib/cpp/Makefile
162 lib/cpp/thrift.pc
163 lib/cpp/thrift-nb.pc
164 lib/cpp/thrift-z.pc
David Reiss1fdb5922008-02-06 22:10:12 +0000165 lib/csharp/Makefile
David Reissf8dcf032008-02-23 22:07:39 +0000166 lib/java/Makefile
David Reiss832b2622007-12-28 18:25:33 +0000167 lib/py/Makefile
168 if/Makefile
David Reiss8180c0c2008-02-04 21:14:14 +0000169 test/Makefile
David Reiss9ff3b9d2008-02-15 01:10:23 +0000170 test/py/Makefile
David Reissff50f282008-02-23 22:07:46 +0000171 test/java/Makefile
David Reiss832b2622007-12-28 18:25:33 +0000172])
Marc Slemkob09f5882006-08-23 22:03:34 +0000173
174AC_OUTPUT