forked from couchbase/php-couchbase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.m4
169 lines (155 loc) · 6.25 KB
/
config.m4
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
PHP_ARG_WITH(couchbase, whether to enable Couchbase support,
[ --with-couchbase Include Couchbase support])
PHP_ARG_WITH(system-fastlz, wheter to use system FastLZ bibrary,
[ --with-system-fastlz Use system FastLZ bibrary], no, no)
if test "$PHP_COUCHBASE" != "no"; then
if test -r $PHP_COUCHBASE/include/libcouchbase/couchbase.h; then
LIBCOUCHBASE_DIR=$PHP_COUCHBASE
else
AC_MSG_CHECKING(for libcouchbase in default path)
for i in /usr/local /usr; do
if test -r $i/include/libcouchbase/couchbase.h; then
LIBCOUCHBASE_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi
if test -z "$LIBCOUCHBASE_DIR"; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Please reinstall the libcouchbase distribution -
libcouchbase.h should be <libcouchbase-dir>/include and
libcouchbase.a should be in <libcouchbase-dir>/lib)
fi
AC_MSG_CHECKING([for libcouchbase version >= 2.8.0])
LCB_VERSION=$($EGREP "define LCB_VERSION " $LIBCOUCHBASE_DIR/include/libcouchbase/configuration.h | $SED -e 's/[[^0-9x]]//g')
AC_MSG_RESULT([$LCB_VERSION])
if test "x$LCB_VERSION" = "x0x000000"; then
AC_MSG_ERROR([seems like libcouchbase is not installed from official tarball or git clone. Do not use github tags to download releases.])
fi
if test $(printf %d $LCB_VERSION) -lt $(printf %d 0x020800); then
AC_MSG_ERROR([libcouchbase greater or equal to 2.8.0 required])
fi
PHP_ADD_INCLUDE($LIBCOUCHBASE_DIR/include)
PHP_SUBST(COUCHBASE_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(couchbase, $LIBCOUCHBASE_DIR/$PHP_LIBDIR, COUCHBASE_SHARED_LIBADD)
AC_DEFINE(HAVE_COUCHBASE, 1, [Whether you have Couchbase])
ifdef([PHP_ADD_EXTENDION_DEP], [
PHP_ADD_EXTENSION_DEP(couchbase, json)
])
PHP_SUBST(COUCHBASE_SHARED_LIBADD)
COUCHBASE_FILES=" \
couchbase.c \
exception.c \
log.c \
opcookie.c \
paramparser.c \
src/couchbase/analytics_query.c \
src/couchbase/authenticator.c \
src/couchbase/classic_authenticator.c \
src/couchbase/password_authenticator.c \
src/couchbase/base36.c \
src/couchbase/pool.c \
src/couchbase/log_formatter.c \
src/couchbase/bucket.c \
src/couchbase/bucket/cbft.c \
src/couchbase/bucket/counter.c \
src/couchbase/bucket/durability.c \
src/couchbase/bucket/get.c \
src/couchbase/bucket/http.c \
src/couchbase/bucket/n1ql.c \
src/couchbase/bucket/remove.c \
src/couchbase/bucket/store.c \
src/couchbase/bucket/subdoc.c \
src/couchbase/bucket/touch.c \
src/couchbase/bucket/unlock.c \
src/couchbase/bucket/view.c \
src/couchbase/bucket_manager.c \
src/couchbase/bucket_manager/n1ix_create.c \
src/couchbase/bucket_manager/n1ix_drop.c \
src/couchbase/bucket_manager/n1ix_list.c \
src/couchbase/cluster.c \
src/couchbase/cluster_manager.c \
src/couchbase/cluster_manager/user_settings.c \
src/couchbase/document.c \
src/couchbase/document_fragment.c \
src/couchbase/lookup_in_builder.c \
src/couchbase/mutate_in_builder.c \
src/couchbase/mutation_state.c \
src/couchbase/mutation_token.c \
src/couchbase/n1ql_index.c \
src/couchbase/n1ql_query.c \
src/couchbase/search_query.c \
src/couchbase/search/query_part.c \
src/couchbase/search/boolean_field_query.c \
src/couchbase/search/boolean_query.c \
src/couchbase/search/conjunction_query.c \
src/couchbase/search/date_range_query.c \
src/couchbase/search/disjunction_query.c \
src/couchbase/search/doc_id_query.c \
src/couchbase/search/geo_bounding_box_query.c \
src/couchbase/search/geo_distance_query.c \
src/couchbase/search/match_all_query.c \
src/couchbase/search/match_none_query.c \
src/couchbase/search/match_phrase_query.c \
src/couchbase/search/match_query.c \
src/couchbase/search/numeric_range_query.c \
src/couchbase/search/phrase_query.c \
src/couchbase/search/prefix_query.c \
src/couchbase/search/query_string_query.c \
src/couchbase/search/regexp_query.c \
src/couchbase/search/term_query.c \
src/couchbase/search/term_range_query.c \
src/couchbase/search/wildcard_query.c \
src/couchbase/search/facet.c \
src/couchbase/search/term_facet.c \
src/couchbase/search/date_range_facet.c \
src/couchbase/search/numeric_range_facet.c \
src/couchbase/view_query.c \
src/couchbase/view_query_encodable.c \
src/couchbase/spatial_view_query.c \
transcoding.c \
"
AC_CHECK_HEADERS([zlib.h])
PHP_CHECK_LIBRARY(z, compress, [
AC_DEFINE(HAVE_COUCHBASE_ZLIB,1,[Whether zlib compressor is enabled])
PHP_ADD_LIBRARY(z, 1, COUCHBASE_SHARED_LIBADD)],
[AC_MSG_WARN(zlib library not found)])
if test "$PHP_SYSTEM_FASTLZ" != "no"; then
AC_CHECK_HEADERS([fastlz.h])
PHP_CHECK_LIBRARY(fastlz, fastlz_compress,
[PHP_ADD_LIBRARY(fastlz, 1, COUCHBASE_SHARED_LIBADD)],
[AC_MSG_ERROR(FastLZ library not found)])
else
COUCHBASE_FILES="${COUCHBASE_FILES} fastlz/fastlz.c"
fi
PHP_NEW_EXTENSION(couchbase, ${COUCHBASE_FILES}, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_BUILD_DIR($ext_builddir/fastlz, 1)
PHP_ADD_BUILD_DIR($ext_builddir/src/couchbase, 1)
PHP_ADD_BUILD_DIR($ext_builddir/src/couchbase/search, 1)
PHP_ADD_BUILD_DIR($ext_builddir/src/couchbase/bucket, 1)
PHP_ADD_BUILD_DIR($ext_builddir/src/couchbase/bucket_manager, 1)
PHP_ADD_BUILD_DIR($ext_builddir/src/couchbase/cluster_manager, 1)
PHP_ADD_EXTENSION_DEP(couchbase, json)
AC_MSG_CHECKING([for igbinary support])
igbinary_inc_path=""
if test -f "$abs_srcdir/include/php/ext/igbinary/igbinary.h"; then
igbinary_inc_path="$abs_srcdir/include/php"
elif test -f "$abs_srcdir/ext/igbinary/igbinary.h"; then
igbinary_inc_path="$abs_srcdir"
elif test -f "$phpincludedir/ext/session/igbinary.h"; then
igbinary_inc_path="$phpincludedir"
elif test -f "$phpincludedir/ext/igbinary/igbinary.h"; then
igbinary_inc_path="$phpincludedir"
fi
if test "$igbinary_inc_path" = ""; then
AC_MSG_WARN([Cannot find igbinary.h])
else
AC_DEFINE(HAVE_COUCHBASE_IGBINARY,1,[Whether igbinary serializer is enabled])
IGBINARY_INCLUDES="-I$igbinary_inc_path"
ifdef([PHP_ADD_EXTENSION_DEP],
[
PHP_ADD_EXTENSION_DEP(couchbase, igbinary)
])
AC_MSG_RESULT([$igbinary_inc_path])
fi
fi