Subversion Repositories SmartDukaan

Rev

Rev 30 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
30 ashish 1
#
2
# Licensed to the Apache Software Foundation (ASF) under one
3
# or more contributor license agreements. See the NOTICE file
4
# distributed with this work for additional information
5
# regarding copyright ownership. The ASF licenses this file
6
# to you under the Apache License, Version 2.0 (the
7
# "License"); you may not use this file except in compliance
8
# with the License. You may obtain a copy of the License at
9
#
10
#   http://www.apache.org/licenses/LICENSE-2.0
11
#
12
# Unless required by applicable law or agreed to in writing,
13
# software distributed under the License is distributed on an
14
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
# KIND, either express or implied. See the License for the
16
# specific language governing permissions and limitations
17
# under the License.
18
#
19
 
20
AC_PREREQ(2.59)
21
 
22
AC_INIT([thrift], [0.2.0])
23
 
24
AC_CONFIG_AUX_DIR([.])
25
 
26
AM_INIT_AUTOMAKE
27
 
28
AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules.
29
                         (Normal --prefix is ignored for Python because
30
                         Python has different conventions.)
31
                         Default = "/usr"])
32
AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"])
33
 
34
AC_ARG_VAR([JAVA_PREFIX], [Prefix for installing the Java lib jar.
35
                           (Normal --prefix is ignored for Java because
36
                           Java has different conevntions.)
37
                           Default = "/usr/local/lib"])
38
AS_IF([test "x$JAVA_PREFIX" = x], [JAVA_PREFIX="/usr/local/lib"])
39
 
40
AC_PROG_CC
41
AC_PROG_CPP
42
AC_PROG_CXX
43
AC_PROG_INSTALL
44
AC_PROG_LIBTOOL
45
AC_PROG_MAKE_SET
46
AC_PROG_YACC
47
AC_PROG_LEX
48
AM_PROG_LEX
49
AC_PROG_LN_S
50
AC_PROG_MKDIR_P
51
 
52
AC_LANG([C++])
53
AX_BOOST_BASE([1.33.1])
54
 
55
AX_LIB_EVENT([1.0])
56
AM_CONDITIONAL([AMX_HAVE_LIBEVENT], [test "$success" = "yes"])
57
 
58
AX_LIB_ZLIB([1.2.3])
59
AM_CONDITIONAL([AMX_HAVE_ZLIB], [test "$success" = "yes"])
60
 
61
AX_THRIFT_LIB(csharp, [C#], yes)
62
if test "$with_csharp" = "yes";  then
63
  PKG_CHECK_MODULES(MONO, mono >= 2.0.0, net_3_5=yes, net_3_5=no)
64
  PKG_CHECK_MODULES(MONO, mono >= 1.2.4, have_mono=yes, have_mono=no)
65
fi
66
AM_CONDITIONAL(WITH_MONO, [test "$have_mono" = "yes"])
67
AM_CONDITIONAL(NET_2_0, [test "$net_3_5" = "no"])
68
 
69
AX_THRIFT_LIB(java, [Java], yes)
70
if test "$with_java" = "yes";  then
71
  AX_JAVAC_AND_JAVA
72
  AC_PATH_PROG([ANT], [ant])
73
  AX_CHECK_JAVA_CLASS(org.slf4j.Logger)
74
  have_slf4j="$success"
75
  AX_CHECK_JAVA_CLASS(org.slf4j.impl.SimpleLogger)
76
  have_slf4j_simple="$success"
77
  AX_CHECK_JAVA_CLASS(org.apache.commons.lang.builder.HashCodeBuilder)
78
  have_hashcode="$success"
79
  if test "x$have_slf4j_simple" = "xyes" && test "x$have_slf4j" = "xyes" && test "x$have_hashcode" = "xyes" ; then
80
    ANT_FLAGS="$ANT_FLAGS -Dnoivy="
81
  fi
82
  AC_SUBST(CLASSPATH)
83
  AC_SUBST(ANT_FLAGS)
84
fi
85
AM_CONDITIONAL([WITH_JAVA],
86
               [test -n "$ANT" -a -n "$JAVA" -a -n "$JAVAC"])
87
 
88
AX_THRIFT_LIB(erlang, [Erlang], yes)
89
if test "$with_erlang" = "yes";  then
90
  AC_PATH_PROG([ERLC], [erlc])
91
fi
92
AM_CONDITIONAL(WITH_ERLANG, [test -n "$ERLC"])
93
 
94
AX_THRIFT_LIB(py, [Python], yes)
95
if test "$with_py" = "yes";  then
96
  AM_PATH_PYTHON(2.4,, :)
97
fi
98
AM_CONDITIONAL(WITH_PYTHON, [test -n "$PYTHON" -a "$PYTHON" != ":"])
99
 
100
AX_THRIFT_LIB(perl, [Perl], yes)
101
if test "$with_perl" = "yes"; then
102
  AC_PATH_PROG([PERL], [perl])
103
fi
104
AM_CONDITIONAL(WITH_PERL, [test -n "$PERL"])
105
 
106
AX_THRIFT_LIB(ruby, [Ruby], yes)
107
if test "$with_ruby" = "yes"; then
108
  AC_PATH_PROG([RUBY], [ruby])
109
  AC_PATH_PROG([RSPEC], [spec])
110
fi
111
AM_CONDITIONAL(WITH_RUBY, [test -n "$RUBY"])
112
AM_CONDITIONAL(HAVE_RSPEC, [test -n "$RSPEC"])
113
 
114
 
115
AC_C_CONST
116
AC_C_INLINE
117
AC_C_VOLATILE
118
 
119
AC_HEADER_STDBOOL
120
AC_HEADER_STDC
121
AC_HEADER_TIME
122
AC_CHECK_HEADERS([arpa/inet.h])
123
AC_CHECK_HEADERS([endian.h])
124
AC_CHECK_HEADERS([fcntl.h])
125
AC_CHECK_HEADERS([inttypes.h])
126
AC_CHECK_HEADERS([limits.h])
127
AC_CHECK_HEADERS([netdb.h])
128
AC_CHECK_HEADERS([netinet/in.h])
129
AC_CHECK_HEADERS([pthread.h])
130
AC_CHECK_HEADERS([stddef.h])
131
AC_CHECK_HEADERS([stdlib.h])
132
AC_CHECK_HEADERS([sys/socket.h])
133
AC_CHECK_HEADERS([sys/time.h])
134
AC_CHECK_HEADERS([unistd.h])
135
AC_CHECK_HEADERS([libintl.h])
136
AC_CHECK_HEADERS([malloc.h])
137
 
138
AC_CHECK_LIB(pthread, pthread_create)
139
dnl NOTE(dreiss): I haven't been able to find any really solid docs
140
dnl on what librt is and how it fits into various Unix systems.
141
dnl My best guess is that it is where glibc stashes its implementation
142
dnl of the POSIX Real-Time Extensions.  This seems necessary on Linux,
143
dnl and we haven't yet found a system where this is a problem.
144
AC_CHECK_LIB(rt, clock_gettime)
145
AC_CHECK_LIB(socket, setsockopt)
146
 
147
AC_TYPE_INT16_T
148
AC_TYPE_INT32_T
149
AC_TYPE_INT64_T
150
AC_TYPE_INT8_T
151
AC_TYPE_MODE_T
152
AC_TYPE_OFF_T
153
AC_TYPE_SIZE_T
154
AC_TYPE_SSIZE_T
155
AC_TYPE_UINT16_T
156
AC_TYPE_UINT32_T
157
AC_TYPE_UINT64_T
158
AC_TYPE_UINT8_T
159
AC_CHECK_TYPES([ptrdiff_t], [], [exit 1])
160
 
161
AC_STRUCT_TM
162
 
163
dnl NOTE(dreiss): AI_ADDRCONFIG is not defined on OpenBSD.
164
AC_CHECK_DECL([AI_ADDRCONFIG], [],
165
              [AC_DEFINE([AI_ADDRCONFIG], 0,
166
                         [Define if the AI_ADDRCONFIG symbol is unavailable])],
167
              [
168
  #include <sys/types.h>
169
  #include <sys/socket.h>
170
  #include <netdb.h>
171
])
172
 
173
AC_FUNC_ALLOCA
174
AC_FUNC_MALLOC
175
AC_FUNC_MEMCMP
176
AC_FUNC_REALLOC
177
AC_FUNC_SELECT_ARGTYPES
178
AC_FUNC_STAT
179
AC_FUNC_STRERROR_R
180
AC_FUNC_STRFTIME
181
AC_FUNC_VPRINTF
182
AC_CHECK_FUNCS([strtoul])
183
AC_CHECK_FUNCS([bzero])
184
AC_CHECK_FUNCS([ftruncate])
185
AC_CHECK_FUNCS([gethostbyname])
186
AC_CHECK_FUNCS([gettimeofday])
187
AC_CHECK_FUNCS([memmove])
188
AC_CHECK_FUNCS([memset])
189
AC_CHECK_FUNCS([mkdir])
190
AC_CHECK_FUNCS([realpath])
191
AC_CHECK_FUNCS([select])
192
AC_CHECK_FUNCS([socket])
193
AC_CHECK_FUNCS([strchr])
194
AC_CHECK_FUNCS([strdup])
195
AC_CHECK_FUNCS([strerror])
196
AC_CHECK_FUNCS([strstr])
197
AC_CHECK_FUNCS([strtol])
198
AC_CHECK_FUNCS([sqrt])
199
dnl The following functions are optional.
200
AC_CHECK_FUNCS([clock_gettime])
201
AC_CHECK_FUNCS([sched_get_priority_min])
202
AC_CHECK_FUNCS([sched_get_priority_max])
203
 
204
AX_SIGNED_RIGHT_SHIFT
205
 
206
AX_THRIFT_GEN(cpp, [C++], yes)
207
AM_CONDITIONAL([THRIFT_GEN_cpp], [test "$ax_thrift_gen_cpp" = "yes"])
208
AX_THRIFT_GEN(java, [Java], yes)
209
AM_CONDITIONAL([THRIFT_GEN_java], [test "$ax_thrift_gen_java" = "yes"])
210
AX_THRIFT_GEN(csharp, [C#], yes)
211
AM_CONDITIONAL([THRIFT_GEN_csharp], [test "$ax_thrift_gen_csharp" = "yes"])
212
AX_THRIFT_GEN(py, [Python], yes)
213
AM_CONDITIONAL([THRIFT_GEN_py], [test "$ax_thrift_gen_py" = "yes"])
214
AX_THRIFT_GEN(rb, [Ruby], yes)
215
AM_CONDITIONAL([THRIFT_GEN_rb], [test "$ax_thrift_gen_rb" = "yes"])
216
AX_THRIFT_GEN(perl, [Perl], yes)
217
AM_CONDITIONAL([THRIFT_GEN_perl], [test "$ax_thrift_gen_perl" = "yes"])
218
AX_THRIFT_GEN(php, [PHP], yes)
219
AM_CONDITIONAL([THRIFT_GEN_php], [test "$ax_thrift_gen_php" = "yes"])
220
AX_THRIFT_GEN(erl, [Erlang], yes)
221
AM_CONDITIONAL([THRIFT_GEN_erl], [test "$ax_thrift_gen_erl" = "yes"])
222
AX_THRIFT_GEN(cocoa, [Cocoa], yes)
223
AM_CONDITIONAL([THRIFT_GEN_cocoa], [test "$ax_thrift_gen_cocoa" = "yes"])
224
AX_THRIFT_GEN(st, [Smalltalk], yes)
225
AM_CONDITIONAL([THRIFT_GEN_st], [test "$ax_thrift_gen_st" = "yes"])
226
AX_THRIFT_GEN(ocaml, [OCaml], yes)
227
AM_CONDITIONAL([THRIFT_GEN_ocaml], [test "$ax_thrift_gen_ocaml" = "yes"])
228
AX_THRIFT_GEN(hs, [Haskell], yes)
229
AM_CONDITIONAL([THRIFT_GEN_hs], [test "$ax_thrift_gen_hs" = "yes"])
230
AX_THRIFT_GEN(xsd, [XSD], yes)
231
AM_CONDITIONAL([THRIFT_GEN_xsd], [test "$ax_thrift_gen_xsd" = "yes"])
232
AX_THRIFT_GEN(html, [HTML], yes)
233
AM_CONDITIONAL([THRIFT_GEN_html], [test "$ax_thrift_gen_html" = "yes"])
234
 
235
AC_CONFIG_HEADERS(config.h:config.hin)
236
 
237
AC_CONFIG_FILES([
238
  Makefile
239
  compiler/cpp/Makefile
240
  lib/Makefile
241
  lib/cpp/Makefile
242
  lib/cpp/thrift.pc
243
  lib/cpp/thrift-nb.pc
244
  lib/cpp/thrift-z.pc
245
  lib/csharp/Makefile
246
  lib/java/Makefile
247
  lib/perl/Makefile
248
  lib/perl/test/Makefile
249
  lib/py/Makefile
250
  lib/rb/Makefile
251
  test/Makefile
252
  test/py/Makefile
253
  test/rb/Makefile
254
])
255
 
256
AC_OUTPUT