@@ -291,15 +291,12 @@ if test "$PHP_MEMCACHED" != "no"; then
291
291
PHP_EVAL_LIBLINE($PHP_LIBMEMCACHED_LIBS, MEMCACHED_SHARED_LIBADD)
292
292
PHP_EVAL_INCLINE($PHP_LIBMEMCACHED_INCLUDES)
293
293
294
- ORIG_CFLAGS="$CFLAGS"
295
- ORIG_LIBS="$LIBS"
296
-
297
- CFLAGS="$CFLAGS $PHP_LIBMEMCACHED_INCLUDES"
298
-
299
294
#
300
295
# Added -lpthread here because AC_TRY_LINK tests on CentOS 6 seem to fail with undefined reference to pthread_once
301
296
#
302
- LIBS="$LIBS -lpthread $PHP_LIBMEMCACHED_LIBS"
297
+ LIBS="$LIBS -lpthread"
298
+ ORIG_CFLAGS="$CFLAGS"
299
+ CFLAGS="$CFLAGS $INCLUDES"
303
300
304
301
AC_CACHE_CHECK ( [ whether memcached_instance_st is defined] , ac_cv_have_memcached_instance_st , [
305
302
AC_TRY_COMPILE (
@@ -358,7 +355,6 @@ if test "$PHP_MEMCACHED" != "no"; then
358
355
AC_MSG_CHECKING ( [ whether to enable sasl support] )
359
356
if test "$PHP_MEMCACHED_SASL" != "no"; then
360
357
AC_MSG_RESULT ( yes )
361
-
362
358
AC_CHECK_HEADERS ( [ sasl/sasl.h] , [ ac_cv_have_memc_sasl_h="yes"] , [ ac_cv_have_memc_sasl_h="no"] )
363
359
364
360
if test "$ac_cv_have_memc_sasl_h" = "yes"; then
@@ -379,6 +375,7 @@ if test "$PHP_MEMCACHED" != "no"; then
379
375
] )
380
376
381
377
if test "$ac_cv_memc_sasl_support" = "yes"; then
378
+ PHP_CHECK_LIBRARY(sasl2, sasl_client_init, [ PHP_ADD_LIBRARY(sasl2, 1, MEMCACHED_SHARED_LIBADD)] )
382
379
AC_DEFINE ( HAVE_MEMCACHED_SASL , 1 , [ Have SASL support] )
383
380
else
384
381
AC_MSG_ERROR ( [ no, libmemcached sasl support is not enabled. Run configure with --disable-memcached-sasl to disable this check] )
@@ -390,9 +387,6 @@ if test "$PHP_MEMCACHED" != "no"; then
390
387
AC_MSG_RESULT ( [ no] )
391
388
fi
392
389
393
- CFLAGS="$ORIG_CFLAGS"
394
- LIBS="$ORIG_LIBS"
395
-
396
390
if test "$ac_cv_have_memcached_instance_st" = "yes"; then
397
391
AC_DEFINE ( HAVE_MEMCACHED_INSTANCE_ST , [ 1] , [ Whether memcached_instance_st is defined] )
398
392
fi
@@ -428,9 +422,6 @@ if test "$PHP_MEMCACHED" != "no"; then
428
422
if test "$PHP_MEMCACHED_PROTOCOL" != "no"; then
429
423
AC_MSG_RESULT ( [ enabled] )
430
424
431
- ORIG_CFLAGS="$CFLAGS"
432
- CFLAGS="$CFLAGS $PHP_LIBMEMCACHED_INCLUDES"
433
-
434
425
AC_CACHE_CHECK ( [ whether libmemcachedprotocol is usable] , ac_cv_have_libmemcachedprotocol , [
435
426
AC_TRY_COMPILE (
436
427
[ #include <libmemcachedprotocol-0.0/handler.h> ] ,
@@ -441,7 +432,6 @@ if test "$PHP_MEMCACHED" != "no"; then
441
432
[ ac_cv_have_libmemcachedprotocol="no" ]
442
433
)
443
434
] )
444
- CFLAGS="$ORIG_CFLAGS"
445
435
446
436
if test "$ac_cv_have_libmemcachedprotocol" != "yes"; then
447
437
AC_MSG_ERROR ( [ Cannot enable libmemcached protocol] )
@@ -469,6 +459,8 @@ if test "$PHP_MEMCACHED" != "no"; then
469
459
AC_MSG_RESULT ( [ disabled] )
470
460
fi
471
461
462
+ CFLAGS="$ORIG_CFLAGS"
463
+
472
464
export PKG_CONFIG_PATH="$ORIG_PKG_CONFIG_PATH"
473
465
PHP_SUBST(MEMCACHED_SHARED_LIBADD)
474
466
0 commit comments