Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 1 | AC_PREREQ(2.59) |
| 2 | |
David Reiss | b72d19f | 2007-09-18 19:46:00 +0000 | [diff] [blame] | 3 | AC_INIT([thrift], [20070917]) |
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"]) |
| 13 | AS_IF([test "x$PY_PREFIX" == x], [PY_PREFIX="/usr"]) |
| 14 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 15 | AM_PATH_PYTHON(2.4,, :) |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 16 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 17 | |
| 18 | AC_PROG_CC |
| 19 | AC_PROG_CPP |
| 20 | AC_PROG_CXX |
| 21 | AC_PROG_INSTALL |
| 22 | AC_PROG_LIBTOOL |
| 23 | AC_PROG_MAKE_SET |
| 24 | AC_PROG_YACC |
| 25 | AC_PROG_LEX |
| 26 | AM_PROG_LEX |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 27 | AC_PROG_LN_S |
| 28 | AC_PROG_MKDIR_P |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 29 | |
| 30 | AC_LANG([C++]) |
| 31 | AX_BOOST_BASE([1.33.1]) |
| 32 | |
| 33 | AX_LIB_EVENT([1.0]) |
| 34 | AM_CONDITIONAL([AMX_HAVE_LIBEVENT], [test "$success" = "yes"]) |
| 35 | |
| 36 | AX_LIB_ZLIB([1.2.3]) |
| 37 | AM_CONDITIONAL([AMX_HAVE_ZLIB], [test "$success" = "yes"]) |
| 38 | |
David Reiss | 520b5ee | 2008-03-02 07:00:26 +0000 | [diff] [blame] | 39 | AX_THRIFT_LIB(csharp, [C#], yes) |
| 40 | if test "$with_csharp" = "yes"; then |
| 41 | PKG_CHECK_MODULES(MONO, mono >= 1.2.6, have_mono=yes, have_mono=no) |
| 42 | fi |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 43 | AM_CONDITIONAL(ENABLE_MONO, [test "$have_mono" = "yes"]) |
| 44 | |
David Reiss | 62d3981 | 2008-03-02 07:00:22 +0000 | [diff] [blame] | 45 | AX_THRIFT_LIB(java, [Java], yes) |
| 46 | if test "$with_java" = "yes"; then |
| 47 | AC_PATH_PROG([ANT], [ant]) |
| 48 | AX_PROG_JAVAC |
| 49 | AX_PROG_JAVA |
| 50 | fi |
David Reiss | f8dcf03 | 2008-02-23 22:07:39 +0000 | [diff] [blame] | 51 | AM_CONDITIONAL([ENABLE_JAVA], |
| 52 | [test -n "$ANT" -a -n "$JAVA" -a -n "$JAVAC"]) |
David Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 53 | |
Christopher Piro | b6f18c2 | 2008-03-04 07:09:12 +0000 | [diff] [blame^] | 54 | AX_THRIFT_LIB(erlang, [Erlang], yes) |
| 55 | if test "$with_erlang" = "yes"; then |
| 56 | AC_PATH_PROG([ERLC], [erlc]) |
| 57 | fi |
| 58 | |
| 59 | AM_CONDITIONAL(ENABLE_ERLANG, [test -n "$ERLC"]) |
| 60 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 61 | AC_C_CONST |
| 62 | AC_C_INLINE |
| 63 | AC_C_VOLATILE |
| 64 | |
| 65 | AC_HEADER_STDBOOL |
| 66 | AC_HEADER_STDC |
| 67 | AC_HEADER_TIME |
| 68 | AC_CHECK_HEADERS([arpa/inet.h]) |
| 69 | AC_CHECK_HEADERS([endian.h]) |
| 70 | AC_CHECK_HEADERS([fcntl.h]) |
| 71 | AC_CHECK_HEADERS([inttypes.h]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 72 | AC_CHECK_HEADERS([limits.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 73 | AC_CHECK_HEADERS([netdb.h]) |
| 74 | AC_CHECK_HEADERS([netinet/in.h]) |
| 75 | AC_CHECK_HEADERS([pthread.h]) |
| 76 | AC_CHECK_HEADERS([stddef.h]) |
David Reiss | d7a16f4 | 2008-02-19 22:47:29 +0000 | [diff] [blame] | 77 | AC_CHECK_HEADERS([stdlib.h]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 78 | AC_CHECK_HEADERS([sys/socket.h]) |
| 79 | AC_CHECK_HEADERS([sys/time.h]) |
| 80 | AC_CHECK_HEADERS([unistd.h]) |
| 81 | AC_CHECK_HEADERS([libintl.h]) |
| 82 | AC_CHECK_HEADERS([malloc.h]) |
| 83 | |
| 84 | AC_CHECK_LIB(pthread, pthread_create) |
| 85 | AC_CHECK_LIB(rt, sched_get_priority_min) |
| 86 | |
| 87 | AC_TYPE_INT16_T |
| 88 | AC_TYPE_INT32_T |
| 89 | AC_TYPE_INT64_T |
| 90 | AC_TYPE_INT8_T |
| 91 | AC_TYPE_MODE_T |
| 92 | AC_TYPE_OFF_T |
| 93 | AC_TYPE_SIZE_T |
| 94 | AC_TYPE_UINT16_T |
| 95 | AC_TYPE_UINT32_T |
| 96 | AC_TYPE_UINT64_T |
| 97 | AC_TYPE_UINT8_T |
| 98 | |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 99 | AC_STRUCT_TM |
| 100 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 101 | AC_FUNC_ALLOCA |
| 102 | AC_FUNC_MALLOC |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 103 | AC_FUNC_MEMCMP |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 104 | AC_FUNC_REALLOC |
| 105 | AC_FUNC_SELECT_ARGTYPES |
| 106 | AC_FUNC_STAT |
| 107 | AC_FUNC_STRERROR_R |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 108 | AC_FUNC_STRFTIME |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 109 | AC_FUNC_VPRINTF |
| 110 | AC_CHECK_FUNCS([strtoul]) |
| 111 | AC_CHECK_FUNCS([bzero]) |
| 112 | AC_CHECK_FUNCS([clock_gettime]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 113 | AC_CHECK_FUNCS([ftruncate]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 114 | AC_CHECK_FUNCS([gethostbyname]) |
| 115 | AC_CHECK_FUNCS([gettimeofday]) |
| 116 | AC_CHECK_FUNCS([memmove]) |
| 117 | AC_CHECK_FUNCS([memset]) |
| 118 | AC_CHECK_FUNCS([mkdir]) |
| 119 | AC_CHECK_FUNCS([realpath]) |
| 120 | AC_CHECK_FUNCS([select]) |
| 121 | AC_CHECK_FUNCS([socket]) |
| 122 | AC_CHECK_FUNCS([strchr]) |
| 123 | AC_CHECK_FUNCS([strdup]) |
David Reiss | 7ed4b98 | 2008-02-11 23:24:47 +0000 | [diff] [blame] | 124 | AC_CHECK_FUNCS([strerror]) |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 125 | AC_CHECK_FUNCS([strstr]) |
| 126 | AC_CHECK_FUNCS([strtol]) |
| 127 | AC_CHECK_FUNCS([sqrt]) |
| 128 | |
David Reiss | 2258573 | 2008-02-27 01:55:33 +0000 | [diff] [blame] | 129 | AX_THRIFT_GEN(cpp, [C++], yes) |
| 130 | AM_CONDITIONAL([THRIFT_GEN_cpp], [test "$ax_thrift_gen_cpp" = "yes"]) |
David Reiss | e8a87de | 2008-02-27 02:39:25 +0000 | [diff] [blame] | 131 | AX_THRIFT_GEN(java, [Java], yes) |
| 132 | AM_CONDITIONAL([THRIFT_GEN_java], [test "$ax_thrift_gen_java" = "yes"]) |
David Reiss | 2258573 | 2008-02-27 01:55:33 +0000 | [diff] [blame] | 133 | |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 134 | AC_CONFIG_HEADERS(config.h:config.hin) |
| 135 | |
| 136 | AC_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 Reiss | 1fdb592 | 2008-02-06 22:10:12 +0000 | [diff] [blame] | 144 | lib/csharp/Makefile |
David Reiss | f8dcf03 | 2008-02-23 22:07:39 +0000 | [diff] [blame] | 145 | lib/java/Makefile |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 146 | lib/py/Makefile |
| 147 | if/Makefile |
David Reiss | 8180c0c | 2008-02-04 21:14:14 +0000 | [diff] [blame] | 148 | test/Makefile |
David Reiss | 9ff3b9d | 2008-02-15 01:10:23 +0000 | [diff] [blame] | 149 | test/py/Makefile |
David Reiss | ff50f28 | 2008-02-23 22:07:46 +0000 | [diff] [blame] | 150 | test/java/Makefile |
David Reiss | 832b262 | 2007-12-28 18:25:33 +0000 | [diff] [blame] | 151 | ]) |
Marc Slemko | b09f588 | 2006-08-23 22:03:34 +0000 | [diff] [blame] | 152 | |
| 153 | AC_OUTPUT |