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