forked from alibaba/tair
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
152 lines (137 loc) · 4.02 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
AC_INIT(tair, 2.3.2.1,[email protected])
AM_INIT_AUTOMAKE(tair, 2.3.2.1)
AC_PROG_CXX
AC_LANG([C++])
AC_PROG_LIBTOOL
m4_include([ax_boost.m4])
m4_include([tcmalloc.m4])
dnl attain svn info url, depending on `svn(1.4.2) info`'s output format.
dnl God bless SVN doesn't change its printf.'
svn_info="NONE"
if svn info &>/dev/null; then
info=`svn info`
svn_info=`echo "$info" | awk '/URL/{print $NF}'`"@r"`echo "$info" | awk '/Last Changed Rev/{print $NF}'`
fi
AC_ARG_WITH([release],
AS_HELP_STRING([--with-release],
[use optimize (default is NO)]),
[
if test "$withval" = "yes"; then
CXXFLAGS="-g -O2 -finline-functions -fno-strict-aliasing -Wall -DBOOST_SPIRIT_THREADSAFE -D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNDEBUG -DTAIR_SVN_INFO=\\\"${svn_info}\\\""
fi
],
[CXXFLAGS="-g -Wall -DBOOST_SPIRIT_THREADSAFE -D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DTAIR_DEBUG -DTAIR_SVN_INFO=\\\"${svn_info}\\\""]
)
GCOV_LIB=
AC_SUBST(GCOV_LIB)
AC_ARG_WITH([profile],
AS_HELP_STRING([--with-profile],
[enable code coverage(default is NO)]),
[
if test "$withval" = "yes"; then
CXXFLAGS="-g -fprofile-arcs -ftest-coverage ${CXXFLAGS}"
GCOV_LIB=-lgcov
fi
])
ac_default_prefix=${HOME}/tair_bin # for convenience
AC_MSG_CHECKING([variable TBLIB_ROOT])
if test "${TBLIB_ROOT+set}" = set; then
AC_MSG_RESULT([yes])
else
AC_MSG_ERROR([TBLIB_ROOT have not been set])
exit 1;
fi
AM_CONDITIONAL([TEST_OPT],[test "$build_test" = yes])
AC_ARG_WITH([compress],
AS_HELP_STRING([--with-compress],
[with compress (default is NO)]),
[
if test "$withval" = "yes"; then
with_compress=yes
AC_CHECK_HEADER(snappy.h, [],
[
AC_MSG_ERROR([snappy have not been installed])
exit 1;
])
AC_CHECK_LIB(snappy, _ZN6snappy11RawCompressEPKcmPcPm, [],
[
AC_MSG_ERROR([snappy have not been installed])
exit 1;
])
fi
],
[ with_compress=no ]
)
AS_IF([test x$with_compress = xyes],
[ CXXFLAGS="${CXXFLAGS} -DWITH_COMPRESS" ],)
AM_CONDITIONAL([WITH_COMPRESS],[test x$with_compress = xyes])
AC_ARG_WITH([kdb],
AS_HELP_STRING([--with-kdb],
[with kdb (default is yes)]),
[
if test "$withval" = "yes"; then
with_kdb=yes
fi
],
[ with_kdb=yes ]
)
AM_CONDITIONAL([WITH_KDB],[test x$with_kdb = xyes])
AC_ARG_WITH([ldb],
AS_HELP_STRING([--with-ldb],
[with ldb (default is YES)]), [
if test "$withval" = "yes"; then
with_ldb=yes
fi
],
[
with_ldb=yes
]
)
AS_IF([test x$with_ldb = xyes],
[
AC_MSG_NOTICE([ with ldb ])
# configure leveldb && snappy
m4_include([src/storage/ldb/leveldb/ax_port_leveldb.m4])
AC_CONFIG_HEADERS([src/storage/ldb/leveldb/snappy/config.h])
AC_CONFIG_FILES([src/storage/ldb/leveldb/snappy/snappy-stubs-public.h])
],
[AC_MSG_NOTICE([ without ldb ])])
AM_CONDITIONAL([WITH_LDB],[test x$with_ldb = xyes])
AX_BOOST([1.30.0],,exit 1)
AC_CHECK_LIB(readline, readline,
[
CXXFLAGS="${CXXFLAGS} -DHAVE_LIBREADLINE"
with_readline="yes"
],, -ltermcap)
AM_CONDITIONAL([WITH_READLINE], [test x$with_readline = xyes])
TS_CHECK_TCMALLOC
AC_CONFIG_FILES([\
Makefile \
src/Makefile \
src/common/Makefile \
src/plugin/Makefile \
src/storage/Makefile \
src/storage/fdb/Makefile \
src/storage/mdb/Makefile \
src/storage/kdb/Makefile \
src/storage/kdb/kyotocabinet/Makefile \
src/storage/ldb/Makefile \
src/storage/ldb/leveldb/Makefile \
src/packets/Makefile \
src/statserver/storage/Makefile \
src/statserver/Makefile \
src/statserver/include/Makefile \
src/configserver/Makefile \
src/dataserver/Makefile \
src/client/Makefile \
src/invalserver/Makefile \
src/tools/Makefile \
test/Makefile \
test/interface_test/Makefile \
test/unit_test/Makefile \
test/statistics_test/Makefile \
test/retry_all_test/Makefile \
scripts/Makefile \
share/Makefile
])
AC_OUTPUT