blob: 16e053c29b96ae7855e91e97c3760e920b0907ee [file] [log] [blame]
Marc Slemkob09f5882006-08-23 22:03:34 +00001AC_PREREQ(2.59)
2
David Reissb72d19f2007-09-18 19:46:00 +00003AC_INIT([thrift], [20070917])
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"])
13AS_IF([test "x$PY_PREFIX" == x], [PY_PREFIX="/usr"])
14
David Reiss832b2622007-12-28 18:25:33 +000015AM_PATH_PYTHON(2.4,, :)
Marc Slemkob09f5882006-08-23 22:03:34 +000016
David Reiss832b2622007-12-28 18:25:33 +000017
18AC_PROG_CC
19AC_PROG_CPP
20AC_PROG_CXX
21AC_PROG_INSTALL
22AC_PROG_LIBTOOL
23AC_PROG_MAKE_SET
24AC_PROG_YACC
25AC_PROG_LEX
26AM_PROG_LEX
David Reiss7ed4b982008-02-11 23:24:47 +000027AC_PROG_LN_S
28AC_PROG_MKDIR_P
David Reiss832b2622007-12-28 18:25:33 +000029
30AC_LANG([C++])
31AX_BOOST_BASE([1.33.1])
32
33AX_LIB_EVENT([1.0])
34AM_CONDITIONAL([AMX_HAVE_LIBEVENT], [test "$success" = "yes"])
35
36AX_LIB_ZLIB([1.2.3])
37AM_CONDITIONAL([AMX_HAVE_ZLIB], [test "$success" = "yes"])
38
David Reiss520b5ee2008-03-02 07:00:26 +000039AX_THRIFT_LIB(csharp, [C#], yes)
40if test "$with_csharp" = "yes"; then
41 PKG_CHECK_MODULES(MONO, mono >= 1.2.6, have_mono=yes, have_mono=no)
42fi
David Reiss1fdb5922008-02-06 22:10:12 +000043AM_CONDITIONAL(ENABLE_MONO, [test "$have_mono" = "yes"])
44
David Reiss62d39812008-03-02 07:00:22 +000045AX_THRIFT_LIB(java, [Java], yes)
46if test "$with_java" = "yes"; then
47 AC_PATH_PROG([ANT], [ant])
48 AX_PROG_JAVAC
49 AX_PROG_JAVA
50fi
David Reissf8dcf032008-02-23 22:07:39 +000051AM_CONDITIONAL([ENABLE_JAVA],
52 [test -n "$ANT" -a -n "$JAVA" -a -n "$JAVAC"])
David Reiss1fdb5922008-02-06 22:10:12 +000053
Christopher Pirob6f18c22008-03-04 07:09:12 +000054AX_THRIFT_LIB(erlang, [Erlang], yes)
55if test "$with_erlang" = "yes"; then
56 AC_PATH_PROG([ERLC], [erlc])
57fi
58
59AM_CONDITIONAL(ENABLE_ERLANG, [test -n "$ERLC"])
60
David Reiss832b2622007-12-28 18:25:33 +000061AC_C_CONST
62AC_C_INLINE
63AC_C_VOLATILE
64
65AC_HEADER_STDBOOL
66AC_HEADER_STDC
67AC_HEADER_TIME
68AC_CHECK_HEADERS([arpa/inet.h])
69AC_CHECK_HEADERS([endian.h])
70AC_CHECK_HEADERS([fcntl.h])
71AC_CHECK_HEADERS([inttypes.h])
David Reiss7ed4b982008-02-11 23:24:47 +000072AC_CHECK_HEADERS([limits.h])
David Reiss832b2622007-12-28 18:25:33 +000073AC_CHECK_HEADERS([netdb.h])
74AC_CHECK_HEADERS([netinet/in.h])
75AC_CHECK_HEADERS([pthread.h])
76AC_CHECK_HEADERS([stddef.h])
David Reissd7a16f42008-02-19 22:47:29 +000077AC_CHECK_HEADERS([stdlib.h])
David Reiss832b2622007-12-28 18:25:33 +000078AC_CHECK_HEADERS([sys/socket.h])
79AC_CHECK_HEADERS([sys/time.h])
80AC_CHECK_HEADERS([unistd.h])
81AC_CHECK_HEADERS([libintl.h])
82AC_CHECK_HEADERS([malloc.h])
83
84AC_CHECK_LIB(pthread, pthread_create)
85AC_CHECK_LIB(rt, sched_get_priority_min)
86
87AC_TYPE_INT16_T
88AC_TYPE_INT32_T
89AC_TYPE_INT64_T
90AC_TYPE_INT8_T
91AC_TYPE_MODE_T
92AC_TYPE_OFF_T
93AC_TYPE_SIZE_T
94AC_TYPE_UINT16_T
95AC_TYPE_UINT32_T
96AC_TYPE_UINT64_T
97AC_TYPE_UINT8_T
98
David Reiss7ed4b982008-02-11 23:24:47 +000099AC_STRUCT_TM
100
David Reiss832b2622007-12-28 18:25:33 +0000101AC_FUNC_ALLOCA
102AC_FUNC_MALLOC
David Reiss7ed4b982008-02-11 23:24:47 +0000103AC_FUNC_MEMCMP
David Reiss832b2622007-12-28 18:25:33 +0000104AC_FUNC_REALLOC
105AC_FUNC_SELECT_ARGTYPES
106AC_FUNC_STAT
107AC_FUNC_STRERROR_R
David Reiss7ed4b982008-02-11 23:24:47 +0000108AC_FUNC_STRFTIME
David Reiss832b2622007-12-28 18:25:33 +0000109AC_FUNC_VPRINTF
110AC_CHECK_FUNCS([strtoul])
111AC_CHECK_FUNCS([bzero])
112AC_CHECK_FUNCS([clock_gettime])
David Reiss7ed4b982008-02-11 23:24:47 +0000113AC_CHECK_FUNCS([ftruncate])
David Reiss832b2622007-12-28 18:25:33 +0000114AC_CHECK_FUNCS([gethostbyname])
115AC_CHECK_FUNCS([gettimeofday])
116AC_CHECK_FUNCS([memmove])
117AC_CHECK_FUNCS([memset])
118AC_CHECK_FUNCS([mkdir])
119AC_CHECK_FUNCS([realpath])
120AC_CHECK_FUNCS([select])
121AC_CHECK_FUNCS([socket])
122AC_CHECK_FUNCS([strchr])
123AC_CHECK_FUNCS([strdup])
David Reiss7ed4b982008-02-11 23:24:47 +0000124AC_CHECK_FUNCS([strerror])
David Reiss832b2622007-12-28 18:25:33 +0000125AC_CHECK_FUNCS([strstr])
126AC_CHECK_FUNCS([strtol])
127AC_CHECK_FUNCS([sqrt])
128
David Reiss22585732008-02-27 01:55:33 +0000129AX_THRIFT_GEN(cpp, [C++], yes)
130AM_CONDITIONAL([THRIFT_GEN_cpp], [test "$ax_thrift_gen_cpp" = "yes"])
David Reisse8a87de2008-02-27 02:39:25 +0000131AX_THRIFT_GEN(java, [Java], yes)
132AM_CONDITIONAL([THRIFT_GEN_java], [test "$ax_thrift_gen_java" = "yes"])
David Reiss22585732008-02-27 01:55:33 +0000133
David Reiss832b2622007-12-28 18:25:33 +0000134AC_CONFIG_HEADERS(config.h:config.hin)
135
136AC_CONFIG_FILES([
137 Makefile
138 compiler/cpp/Makefile
139 lib/Makefile
140 lib/cpp/Makefile
141 lib/cpp/thrift.pc
142 lib/cpp/thrift-nb.pc
143 lib/cpp/thrift-z.pc
David Reiss1fdb5922008-02-06 22:10:12 +0000144 lib/csharp/Makefile
David Reissf8dcf032008-02-23 22:07:39 +0000145 lib/java/Makefile
David Reiss832b2622007-12-28 18:25:33 +0000146 lib/py/Makefile
147 if/Makefile
David Reiss8180c0c2008-02-04 21:14:14 +0000148 test/Makefile
David Reiss9ff3b9d2008-02-15 01:10:23 +0000149 test/py/Makefile
David Reissff50f282008-02-23 22:07:46 +0000150 test/java/Makefile
David Reiss832b2622007-12-28 18:25:33 +0000151])
Marc Slemkob09f5882006-08-23 22:03:34 +0000152
153AC_OUTPUT