forked from yukai2014/oceanbase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
285 lines (259 loc) · 9.23 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
AC_INIT([OceanBase],
[0.4.2.9],
[oceanbase],
[http://oceanbase.taobao.org/])
obapi_version="1.0.0"
AC_SUBST(obapi_version)
AC_PROG_LIBTOOL
AC_PROG_RANLIB
AM_INIT_AUTOMAKE(oceanbase, 0.4.2.9)
ac_default_prefix=${HOME}/oceanbase_bin# for convenience
AC_PROG_CXX
AC_LANG([C++])
AC_PROG_CC
AC_MSG_CHECKING([drc-root])
AC_ARG_WITH([drc-root],
AS_HELP_STRING([--with-drc-root],
[drc installation path]),
DRC_ROOT=${withval})
if ! test -d "${DRC_ROOT}"; then
AC_MSG_ERROR([DRC_ROOT have not been set])
exit 1;
fi
AC_MSG_RESULT([${DRC_ROOT}])
dnl drc include path supplied
AC_SUBST([DRC_ROOT])
AC_MSG_CHECKING([tblib-root])
AC_ARG_WITH([tblib-root],
AS_HELP_STRING([--with-tblib-root],
[tbnet installation path]),
TBLIB_ROOT=${withval})
if ! test -d "${TBLIB_ROOT}/include"; then
AC_MSG_ERROR([TBLIB_ROOT have not been set])
exit 1;
fi
AC_MSG_RESULT([${TBLIB_ROOT}])
dnl tblib include path supplied
AC_SUBST([TBLIB_ROOT])
AC_MSG_CHECKING([easy-root])
AC_ARG_WITH([easy-root],
AS_HELP_STRING([--with-easy-root],
[libeasy installation path]),
EASY_ROOT=${withval})
if ! test -d "${EASY_ROOT}/include"; then
AC_MSG_ERROR([EASY_ROOT have not been set, ${EASY_ROOT}/include])
exit 1;
fi
AC_MSG_RESULT([${EASY_ROOT}])
dnl libeasy include path supplied
AC_SUBST([EASY_ROOT])
AC_MSG_CHECKING([easy-lib-path])
AC_ARG_WITH([easy-lib-path],
AS_HELP_STRING([--with-easy-lib-path],
[libeasy.a path]),
EASY_LIB_PATH=${withval})
if test -z ${EASY_LIB_PATH};
then
EASY_LIB_PATH=${EASY_ROOT}/lib
fi
if ! test -d "${EASY_LIB_PATH}"; then
AC_MSG_ERROR([EASY_LIB_PATH ${EASY_LIB_PATH} does not exist])
exit 1;
fi
AC_MSG_RESULT([${EASY_LIB_PATH}])
dnl libeasy include path supplied
AC_SUBST([EASY_LIB_PATH])
AC_ARG_WITH([release],
AS_HELP_STRING([--with-release],
[use optimize (default is NO)]),
[
if test "$withval" = "yes"; then
AM_CXXFLAGS="-g -O2 -D_OB_VERSION=400 -D_NO_EXCEPTION -finline-functions \
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG\
-Wall -Werror -Wextra -Wunused-parameter -Wformat -fno-strict-aliasing \
-Wconversion -Wno-deprecated -D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64 \
-D_LARGE_FILE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" #-lprofiler
AM_CFLAGS="-g -O2 -D_OB_VERSION=400 -DCOMPATIBLE -D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64\
-D_LARGE_FILE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNDEBUG\
-finline-functions -fno-strict-aliasing -Werror -Wall"
fi
],
[ AM_CXXFLAGS="-D__STDC_LIMIT_MACROS -D_OB_VERSION=400 -D__STDC_CONSTANT_MACROS -D_NO_EXCEPTION \
-Wall -Werror -Wextra -Wunused-parameter \
-Wformat -Wconversion -Wno-deprecated -fno-strict-aliasing -g" #-D__OB_MTRACE__ -rdynamic
AM_CFLAGS="-g -D_OB_VERSION=400 -DCOMPATIBLE -D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64\
-D_LARGE_FILE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Werror -Wall"
]
)
#check gcc version, add -Wno-ignored-qualifiers flag for gcc version greater than 4.3.0
GCC_VERSION=`$CC -dumpversion`
if test $? -eq 0; then
major=`echo $GCC_VERSION | cut -d. -f1`
minor=`echo $GCC_VERSION | cut -d. -f2`
fi
if test $major -eq 4 -a $minor -ge 3 ; then
AM_CXXFLAGS="${AM_CXXFLAGS} -Wno-ignored-qualifiers"
fi
AC_ARG_WITH([test_case],
AS_HELP_STRING([--with-test-case],
[with test case (default is YES)]),
[
if test "$withval" = "no"; then
test_case=no
fi
],
[ test_case=yes ]
)
AC_ARG_WITH([perf],
AS_HELP_STRING([--with-perf],
[with perf (default is NO)]),
[
if test "$withval" = "yes"; then
test_perf=yes
AM_CXXFLAGS="${AM_CXXFLAGS} -D__NEED_PERF__"
AM_LDFLAGS="${AM_LDFLAGS} -lprofiler"
fi
],
[with_perf=no]
)
AC_ARG_WITH([preload],
AS_HELP_STRING([--with-preload],
[with preload (default is NO)]),
[
if test "$withval" = "yes"; then
with_preload=yes
AM_CXXFLAGS="${AM_CXXFLAGS} -D__ENABLE_PRELOAD__"
fi
],
[
with_preload=no
]
)
AC_ARG_WITH([coverage],
AS_HELP_STRING([--with-coverage],
[with coverage (default is NO)]),
[
if test "$withval" = "yes"; then
coverage=yes
fi
],
[coverage=no]
)
AC_ARG_VAR([RELEASEID], [release number when building in Taobao ABS])
AC_DEFINE_UNQUOTED([RELEASEID], "$RELEASEID")
AM_CONDITIONAL([WITH_TEST_CASE], test x$test_case = xyes )
AM_CONDITIONAL([COVERAGE], test x$coverage = xyes )
dnl see whether subversion is installed
AC_PATH_PROG(svnversioncommand, svnversion)
dnl use svnversion to record the current repository revision only if
dnl subversion is installed and we are in a working copy
if test "X$svnversioncommand" = "X" || test `$svnversioncommand -n '.'` = "exported"; then
mysvnversion="cat \$(top_srcdir)/svn_dist_version"
AM_CONDITIONAL([HAVESVNWC], false)
else
mysvnversion="svnversion -n '.'"
AM_CONDITIONAL([HAVESVNWC], true)
fi
AC_SUBST(mysvnversion)
AC_ARG_WITH([mem-trace],
AS_HELP_STRING([--with-mem-trace],
[with memory trace (default is NO)]),
[
if test "$withval" = "yes"; then
memtrace=yes
fi
],
[memtrace=no]
)
if test $memtrace = "yes"
then
AM_CXXFLAGS="${AM_CXXFLAGS} -D__OB_MTRACE__ -rdynamic"
fi
AM_CONDITIONAL([MEMTRACE], test x$memtrace = xyes )
AC_ARG_WITH([mem-debug],
AS_HELP_STRING([--with-mem-debug],
[with memory debug features (default is NO)]),
[
if test "$withval" = "yes"; then
memdebug=yes
fi
],
[memdebug=no]
)
if test $memdebug = "yes"
then
AM_CXXFLAGS="${AM_CXXFLAGS} -D__OB_MDEBUG__"
fi
AM_CONDITIONAL([MEMDEBUG], test x$memdebug = xyes )
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_LDFLAGS])
if test "X${CXXFLAGS}" = "X-g -O2"; then
CXXFLAGS=""
fi
AC_SUBST([CXXFLAGS])
AC_MSG_RESULT([CXXFLAGS=${CXXFLAGS}])
AC_ARG_WITH([mysqltest],
AS_HELP_STRING([--with-mysqltest],
[whether to build mysqltest (default is NO)]),
[],
[with_mysqltest="no"])
AM_CONDITIONAL([WITH_MYSQLTEST], test x$with_mysqltest = xyes)
AC_CONFIG_FILES([\
Makefile \
script/Makefile \
script/supervisor/Makefile \
tools/Makefile \
tools/syschecker/Makefile \
tools/syschecker/client/Makefile \
tools/dump/Makefile \
src/Makefile \
src/common/Makefile \
src/common/compress/Makefile \
src/common/btree/Makefile \
src/common/btree/test/Makefile \
src/common/roottable/Makefile \
src/rootserver/Makefile \
src/chunkserver/Makefile \
src/proxyserver/Makefile \
src/updateserver/Makefile \
src/mergeserver/Makefile \
src/importserver/Makefile \
src/sstable/Makefile \
src/mrsstable/Makefile \
src/lsync/Makefile \
src/compactsstable/Makefile \
src/compactsstablev2/Makefile \
src/sql/Makefile \
src/obmysql/Makefile \
src/client/Makefile \
src/client/obsql/Makefile \
src/client/obsql/src/Makefile \
src/client/obsql/demo/Makefile \
src/client/obsql/test/Makefile \
src/common/timezone/Makefile \
tests/Makefile \
tests/chunkserver/Makefile \
tests/common/Makefile \
tests/common/compress/Makefile \
tests/common/hash/Makefile \
tests/rootserver/Makefile \
tests/updateserver/Makefile \
tests/updateserver/stress_test/Makefile \
tests/mergeserver/Makefile \
tests/sql/Makefile \
tests/obmysql/Makefile \
tests/sstable/Makefile \
tests/compactsstablev2/Makefile \
tests/lsync/Makefile \
tools/log_tool/Makefile \
tools/mixed_test/Makefile \
tools/newsqltest/Makefile \
tools/sstable_builder/Makefile \
tools/compactsstablev2/Makefile \
tools/getquerytest/Makefile \
tools/liboblog/Makefile \
tools/mysqltest/Makefile
])
AC_OUTPUT