@@ -26,6 +26,9 @@ PHP_ARG_ENABLE(memcached-sasl, whether to enable memcached sasl support,
2626PHP_ARG_ENABLE(memcached-protocol, whether to enable memcached protocol support,
2727[ --enable-memcached-protocol Enable memcached protocoll support] , no, no)
2828
29+ PHP_ARG_WITH(system-fastlz, wheter to use system FastLZ bibrary,
30+ [ --with-system-fastlz Use system FastLZ bibrary] , no, no)
31+
2932if test -z "$PHP_ZLIB_DIR"; then
3033PHP_ARG_WITH(zlib-dir, for ZLIB,
3134[ --with-zlib-dir[ =DIR] Set the path to ZLIB install prefix.] , no)
@@ -336,7 +339,17 @@ if test "$PHP_MEMCACHED" != "no"; then
336339 AC_MSG_RESULT ( [ no] )
337340 fi
338341
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
340353
341354 if test "$PHP_MEMCACHED_SESSION" != "no"; then
342355 PHP_MEMCACHED_FILES="${PHP_MEMCACHED_FILES} php_memcached_session.c"
@@ -390,8 +403,10 @@ if test "$PHP_MEMCACHED" != "no"; then
390403 PHP_SUBST(MEMCACHED_SHARED_LIBADD)
391404
392405 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+
395410 ifdef ( [ PHP_ADD_EXTENSION_DEP] ,
396411 [
397412 PHP_ADD_EXTENSION_DEP(memcached, spl, true)
0 commit comments