@@ -26,6 +26,9 @@ PHP_ARG_ENABLE(memcached-sasl, whether to enable memcached sasl support,
26
26
PHP_ARG_ENABLE(memcached-protocol, whether to enable memcached protocol support,
27
27
[ --enable-memcached-protocol Enable memcached protocoll support] , no, no)
28
28
29
+ PHP_ARG_WITH(system-fastlz, wheter to use system FastLZ bibrary,
30
+ [ --with-system-fastlz Use system FastLZ bibrary] , no, no)
31
+
29
32
if test -z "$PHP_ZLIB_DIR"; then
30
33
PHP_ARG_WITH(zlib-dir, for ZLIB,
31
34
[ --with-zlib-dir[ =DIR] Set the path to ZLIB install prefix.] , no)
@@ -336,7 +339,17 @@ if test "$PHP_MEMCACHED" != "no"; then
336
339
AC_MSG_RESULT ( [ no] )
337
340
fi
338
341
339
- PHP_MEMCACHED_FILES="php_memcached.c php_libmemcached_compat.c fastlz/fastlz.c g_fmt.c"
342
+ PHP_MEMCACHED_FILES="php_memcached.c php_libmemcached_compat.c g_fmt.c"
343
+
344
+ if test "$PHP_SYSTEM_FASTLZ" != "no"; then
345
+ AC_CHECK_HEADERS ( [ fastlz.h] , [ ac_cv_have_fastlz="yes"] , [ ac_cv_have_fastlz="no"] )
346
+ PHP_CHECK_LIBRARY(fastlz, fastlz_compress,
347
+ [ PHP_ADD_LIBRARY(fastlz, 1, MEMCACHED_SHARED_LIBADD)] ,
348
+ [ AC_MSG_ERROR ( FastLZ library not found ) ] )
349
+ else
350
+ ac_cv_have_fastlz="no"
351
+ PHP_MEMCACHED_FILES="${PHP_MEMCACHED_FILES} fastlz/fastlz.c"
352
+ fi
340
353
341
354
if test "$PHP_MEMCACHED_SESSION" != "no"; then
342
355
PHP_MEMCACHED_FILES="${PHP_MEMCACHED_FILES} php_memcached_session.c"
@@ -390,8 +403,10 @@ if test "$PHP_MEMCACHED" != "no"; then
390
403
PHP_SUBST(MEMCACHED_SHARED_LIBADD)
391
404
392
405
PHP_NEW_EXTENSION(memcached, $PHP_MEMCACHED_FILES, $ext_shared,,$SESSION_INCLUDES $IGBINARY_INCLUDES $LIBEVENT_INCLUDES $MSGPACK_INCLUDES)
393
- PHP_ADD_BUILD_DIR($ext_builddir/fastlz, 1)
394
-
406
+ if test "ac_cv_have_fastlz" != "yes"; then
407
+ PHP_ADD_BUILD_DIR($ext_builddir/fastlz, 1)
408
+ fi
409
+
395
410
ifdef ( [ PHP_ADD_EXTENSION_DEP] ,
396
411
[
397
412
PHP_ADD_EXTENSION_DEP(memcached, spl, true)
0 commit comments