Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 266 lines (231 sloc) 9.209 kB
79db1e4 First import
Andrei Zmievski authored
1 dnl
2 dnl $ Id: $
b24b82e Clean up scaffolding.
Andrei Zmievski authored
3 dnl vim:se ts=2 sw=2 et:
79db1e4 First import
Andrei Zmievski authored
4
b24b82e Clean up scaffolding.
Andrei Zmievski authored
5 PHP_ARG_ENABLE(memcached, whether to enable memcached support,
4d60d58 config.m4 changes
Oleg Grenrus authored
6 [ --enable-memcached Enable memcached support])
79db1e4 First import
Andrei Zmievski authored
7
b24b82e Clean up scaffolding.
Andrei Zmievski authored
8 PHP_ARG_WITH(libmemcached-dir, for libmemcached,
9 [ --with-libmemcached-dir[=DIR] Set the path to libmemcached install prefix.], yes)
79db1e4 First import
Andrei Zmievski authored
10
616c1c3 Add session ext dep.
Andrei Zmievski authored
11 PHP_ARG_ENABLE(memcached-session, whether to enable memcached session handler support,
12 [ --disable-memcached-session Disable memcached session handler support], yes, no)
13
79317c1 Fixed OPT_SERIALIZER values to be integers rather than strings.
Andrei Zmievski authored
14 PHP_ARG_ENABLE(memcached-igbinary, whether to enable memcached igbinary serializer support,
4d60d58 config.m4 changes
Oleg Grenrus authored
15 [ --enable-memcached-igbinary Enable memcached igbinary serializer support], no, no)
16
b0a67fd make the json serializer optional
Mikko Koppanen authored
17 PHP_ARG_ENABLE(memcached-json, whether to enable memcached json serializer support,
18 [ --enable-memcached-json Enable memcached json serializer support], no, no)
19
9c9e2cb fastlz changes
Mikko Koppanen authored
20 PHP_ARG_ENABLE(memcached-fastlz, whether to use FastLZ compression instead of zlib,
21 [ --enable-memcached-fastlz Enable FastLZ compression], no, no)
22
b24b82e Clean up scaffolding.
Andrei Zmievski authored
23 if test -z "$PHP_ZLIB_DIR"; then
24 PHP_ARG_WITH(zlib-dir, for ZLIB,
25 [ --with-zlib-dir[=DIR] Set the path to ZLIB install prefix.], no)
26 fi
79db1e4 First import
Andrei Zmievski authored
27
b24b82e Clean up scaffolding.
Andrei Zmievski authored
28 if test -z "$PHP_DEBUG"; then
29 AC_ARG_ENABLE(debug,
30 [ --enable-debug compile with debugging symbols],[
31 PHP_DEBUG=$enableval
32 ],[ PHP_DEBUG=no
33 ])
34 fi
79db1e4 First import
Andrei Zmievski authored
35
b24b82e Clean up scaffolding.
Andrei Zmievski authored
36 if test "$PHP_MEMCACHED" != "no"; then
37
9c9e2cb fastlz changes
Mikko Koppanen authored
38 if test "$PHP_MEMCACHED_FASTLZ" = "no"; then
39 dnl # zlib
40 if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then
41 if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then
42 PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
43 PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib"
44 elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then
45 PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
46 PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include"
47 else
48 AC_MSG_ERROR([Can't find ZLIB headers under "$PHP_ZLIB_DIR"])
49 fi
b24b82e Clean up scaffolding.
Andrei Zmievski authored
50 else
9c9e2cb fastlz changes
Mikko Koppanen authored
51 for i in /usr/local /usr; do
52 if test -f "$i/include/zlib/zlib.h"; then
53 PHP_ZLIB_DIR="$i"
54 PHP_ZLIB_INCDIR="$i/include/zlib"
55 elif test -f "$i/include/zlib.h"; then
56 PHP_ZLIB_DIR="$i"
57 PHP_ZLIB_INCDIR="$i/include"
58 fi
59 done
b24b82e Clean up scaffolding.
Andrei Zmievski authored
60 fi
79db1e4 First import
Andrei Zmievski authored
61
9c9e2cb fastlz changes
Mikko Koppanen authored
62 AC_MSG_CHECKING([for zlib location])
63 if test "$PHP_ZLIB_DIR" = "no"; then
64 AC_MSG_ERROR([memcached support requires ZLIB. Use --with-zlib-dir=<DIR> to specify the prefix where ZLIB headers and library are located])
65 else
66 AC_MSG_RESULT([$PHP_ZLIB_DIR])
67 PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/$PHP_LIBDIR, MEMCACHE_SHARED_LIBADD)
68 PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR)
69 fi
b24b82e Clean up scaffolding.
Andrei Zmievski authored
70 else
9c9e2cb fastlz changes
Mikko Koppanen authored
71 dnl FastLZ requested
d0bc8a8 Add fix for building outside source dir (Thanks to Ilia)
Mikko Koppanen authored
72 PHP_ADD_BUILD_DIR($ext_builddir/fastlz, 1)
9c9e2cb fastlz changes
Mikko Koppanen authored
73 AC_DEFINE(MEMCACHED_HAVE_FASTLZ, 1, [Whether to use FastLZ compression])
b24b82e Clean up scaffolding.
Andrei Zmievski authored
74 fi
79db1e4 First import
Andrei Zmievski authored
75
616c1c3 Add session ext dep.
Andrei Zmievski authored
76 if test "$PHP_MEMCACHED_SESSION" != "no"; then
77 AC_MSG_CHECKING([for session includes])
78 session_inc_path=""
79
80 if test -f "$abs_srcdir/include/php/ext/session/php_session.h"; then
81 session_inc_path="$abs_srcdir/include/php"
82 elif test -f "$abs_srcdir/ext/session/php_session.h"; then
83 session_inc_path="$abs_srcdir"
84 elif test -f "$phpincludedir/ext/session/php_session.h"; then
85 session_inc_path="$phpincludedir"
86 else
87 for i in php php4 php5 php6; do
88 if test -f "$prefix/include/$i/ext/session/php_session.h"; then
89 session_inc_path="$prefix/include/$i"
90 fi
91 done
92 fi
93
94 if test "$session_inc_path" = ""; then
95 AC_MSG_ERROR([Cannot find php_session.h])
96 else
97 AC_MSG_RESULT([$session_inc_path])
98 fi
99 fi
b0a67fd make the json serializer optional
Mikko Koppanen authored
100
101 if test "$PHP_MEMCACHED_JSON" != "no"; then
102 AC_MSG_CHECKING([for json includes])
103 json_inc_path=""
104
105 tmp_version=$PHP_VERSION
106 if test -z "$tmp_version"; then
107 if test -z "$PHP_CONFIG"; then
108 AC_MSG_ERROR([php-config not found])
109 fi
110 PHP_MEMCACHED_VERSION_ORIG=`$PHP_CONFIG --version`;
111 else
112 PHP_MEMCACHED_VERSION_ORIG=$tmp_version
113 fi
114
115 if test -z $PHP_MEMCACHED_VERSION_ORIG; then
116 AC_MSG_ERROR([failed to detect PHP version, please report])
117 fi
118
119 PHP_MEMCACHED_VERSION_MASK=`echo ${PHP_MEMCACHED_VERSION_ORIG} | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
120
121 if test $PHP_MEMCACHED_VERSION_MASK -ge 5002009; then
122 dnl Check JSON for PHP 5.2.9+
123 if test -f "$abs_srcdir/include/php/ext/json/php_json.h"; then
124 json_inc_path="$abs_srcdir/include/php"
125 elif test -f "$abs_srcdir/ext/json/php_json.h"; then
126 json_inc_path="$abs_srcdir"
127 elif test -f "$phpincludedir/ext/json/php_json.h"; then
128 json_inc_path="$phpincludedir"
129 else
130 for i in php php4 php5 php6; do
131 if test -f "$prefix/include/$i/ext/json/php_json.h"; then
132 json_inc_path="$prefix/include/$i"
133 fi
134 done
135 fi
136 if test "$json_inc_path" = ""; then
137 AC_MSG_ERROR([Cannot find php_json.h])
138 else
139 AC_DEFINE(HAVE_JSON_API,1,[Whether JSON API is available])
140 AC_DEFINE(HAVE_JSON_API_5_2,1,[Whether JSON API for PHP 5.2 is available])
141 AC_MSG_RESULT([$json_inc_path])
142 fi
143 elif test $PHP_MEMCACHED_VERSION_MASK -ge 5003000; then
144 if test -f "$abs_srcdir/include/php/ext/json/JSON_parser.h"; then
145 json_inc_path="$abs_srcdir/include/php"
146 elif test -f "$abs_srcdir/ext/json/JSON_parser.h"; then
147 json_inc_path="$abs_srcdir"
148 elif test -f "$phpincludedir/ext/json/JSON_parser.h"; then
149 json_inc_path="$phpincludedir"
150 else
151 for i in php php4 php5 php6; do
152 if test -f "$prefix/include/$i/ext/json/JSON_parser.h"; then
153 json_inc_path="$prefix/include/$i"
154 fi
155 done
156 fi
157 if test "$json_inc_path" = ""; then
158 AC_MSG_ERROR([Cannot find JSON_parser.h])
159 else
160 AC_DEFINE(HAVE_JSON_API,1,[Whether JSON API is available])
161 AC_DEFINE(HAVE_JSON_API_5_3,1,[Whether JSON API for PHP 5.3 is available])
162 AC_MSG_RESULT([$json_inc_path])
163 fi
164 else
165 AC_MSG_RESULT([the PHP version does not support JSON serialization API])
166 fi
167 fi
616c1c3 Add session ext dep.
Andrei Zmievski authored
168
4d60d58 config.m4 changes
Oleg Grenrus authored
169 if test "$PHP_MEMCACHED_IGBINARY" != "no"; then
170 AC_MSG_CHECKING([for igbinary includes])
171 igbinary_inc_path=""
172
173 if test -f "$abs_srcdir/include/php/ext/igbinary/igbinary.h"; then
174 igbinary_inc_path="$abs_srcdir/include/php"
175 elif test -f "$abs_srcdir/ext/igbinary/igbinary.h"; then
176 igbinary_inc_path="$abs_srcdir"
177 elif test -f "$phpincludedir/ext/session/igbinary.h"; then
178 igbinary_inc_path="$phpincludedir"
179 else
180 for i in php php4 php5 php6; do
181 if test -f "$prefix/include/$i/ext/igbinary/igbinary.h"; then
182 igbinary_inc_path="$prefix/include/$i"
183 fi
184 done
185 fi
186
187 if test "$igbinary_inc_path" = ""; then
188 AC_MSG_ERROR([Cannot find igbinary.h])
189 else
190 AC_MSG_RESULT([$igbinary_inc_path])
191 fi
192 fi
193
616c1c3 Add session ext dep.
Andrei Zmievski authored
194 AC_MSG_CHECKING([for memcached session support])
195 if test "$PHP_MEMCACHED_SESSION" != "no"; then
196 AC_MSG_RESULT([enabled])
197 AC_DEFINE(HAVE_MEMCACHED_SESSION,1,[Whether memcache session handler is enabled])
198 SESSION_INCLUDES="-I$session_inc_path"
199 ifdef([PHP_ADD_EXTENSION_DEP],
200 [
201 PHP_ADD_EXTENSION_DEP(memcached, session)
202 ])
203 else
204 SESSION_INCLUDES=""
205 AC_MSG_RESULT([disabled])
206 fi
207
4d60d58 config.m4 changes
Oleg Grenrus authored
208 AC_MSG_CHECKING([for memcached igbinary support])
209 if test "$PHP_MEMCACHED_IGBINARY" != "no"; then
210 AC_MSG_RESULT([enabled])
211 AC_DEFINE(HAVE_MEMCACHED_IGBINARY,1,[Whether memcache igbinary serializer is enabled])
212 IGBINARY_INCLUDES="-I$igbinary_inc_path"
213 ifdef([PHP_ADD_EXTENSION_DEP],
214 [
215 PHP_ADD_EXTENSION_DEP(memcached, igbinary)
216 ])
217 else
218 IGBINARY_INCLUDES=""
219 AC_MSG_RESULT([disabled])
220 fi
221
b24b82e Clean up scaffolding.
Andrei Zmievski authored
222 if test "$PHP_LIBMEMCACHED_DIR" != "no" && test "$PHP_LIBMEMCACHED_DIR" != "yes"; then
223 if test -r "$PHP_LIBMEMCACHED_DIR/include/libmemcached/memcached.h"; then
224 PHP_LIBMEMCACHED_DIR="$PHP_LIBMEMCACHED_DIR"
225 else
226 AC_MSG_ERROR([Can't find libmemcached headers under "$PHP_LIBMEMCACHED_DIR"])
227 fi
228 else
4727f48 Fix libmemcached dir detection.
Andrei Zmievski authored
229 PHP_LIBMEMCACHED_DIR="no"
b24b82e Clean up scaffolding.
Andrei Zmievski authored
230 for i in /usr /usr/local; do
231 if test -r "$i/include/libmemcached/memcached.h"; then
232 PHP_LIBMEMCACHED_DIR=$i
233 break
234 fi
235 done
236 fi
79db1e4 First import
Andrei Zmievski authored
237
b24b82e Clean up scaffolding.
Andrei Zmievski authored
238 AC_MSG_CHECKING([for libmemcached location])
239 if test "$PHP_LIBMEMCACHED_DIR" = "no"; then
240 AC_MSG_ERROR([memcached support requires libmemcached. Use --with-libmemcached-dir=<DIR> to specify the prefix where libmemcached headers and library are located])
241 else
242 AC_MSG_RESULT([$PHP_LIBMEMCACHED_DIR])
243 PHP_LIBMEMCACHED_INCDIR="$PHP_LIBMEMCACHED_DIR/include"
244 PHP_ADD_INCLUDE($PHP_LIBMEMCACHED_INCDIR)
245 PHP_ADD_LIBRARY_WITH_PATH(memcached, $PHP_LIBMEMCACHED_DIR/lib, MEMCACHED_SHARED_LIBADD)
79db1e4 First import
Andrei Zmievski authored
246
b24b82e Clean up scaffolding.
Andrei Zmievski authored
247 PHP_SUBST(MEMCACHED_SHARED_LIBADD)
7f88eca only compile in fastlz if it was requested
Mikko Koppanen authored
248
249 PHP_MEMCACHED_FILES="php_memcached.c"
250
251 if test "$PHP_MEMCACHED_FASTLZ" = "no"; then
252 PHP_MEMCACHED_FILES="${PHP_MEMCACHED_FILES} fastlz/fastlz.c"
253 fi
254
255 PHP_NEW_EXTENSION(memcached, $PHP_MEMCACHED_FILES, $ext_shared,,$SESSION_INCLUDES $IGBINARY_INCLUDES)
256
bd36747 Implement exception class.
Andrei Zmievski authored
257 ifdef([PHP_ADD_EXTENSION_DEP],
258 [
616c1c3 Add session ext dep.
Andrei Zmievski authored
259 PHP_ADD_EXTENSION_DEP(memcached, spl, true)
bd36747 Implement exception class.
Andrei Zmievski authored
260 ])
261
b24b82e Clean up scaffolding.
Andrei Zmievski authored
262 fi
79db1e4 First import
Andrei Zmievski authored
263
264 fi
265
Something went wrong with that request. Please try again.