Skip to content

Commit

Permalink
Replace obsolete macro AC_TRY_COMPILE with AC_COMPILE_IFELSE
Browse files Browse the repository at this point in the history
Autoconf made several macros obsolete in several versions behind
including the AC_TRY_COMPILE which should be replaced with current
AC_COMPILE_IFELSE instead.
  • Loading branch information
petk committed Jul 2, 2018
1 parent f5f84c5 commit 17eea87
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,13 @@ if test "$PHP_MEMCACHED" != "no"; then
dnl # Always check if libmemcached was built with SASL support,
dnl # because it will require sasl.h even if not used here.
AC_CACHE_CHECK([for libmemcached sasl.h requirement], ac_cv_memc_sasl_support, [
AC_TRY_COMPILE(
[ #include <libmemcached/memcached.h> ],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libmemcached/memcached.h>]], [[
#if LIBMEMCACHED_WITH_SASL_SUPPORT
/* yes */
#else
# error "no sasl support"
#endif
],
[ ac_cv_memc_sasl_support="yes" ],
[ ac_cv_memc_sasl_support="no" ]
)
]])],[ac_cv_memc_sasl_support="yes"],[ac_cv_memc_sasl_support="no"])
])

if test "$ac_cv_memc_sasl_support" = "yes"; then
Expand Down Expand Up @@ -360,14 +355,9 @@ if test "$PHP_MEMCACHED" != "no"; then
AC_MSG_RESULT([enabled])

AC_CACHE_CHECK([whether libmemcachedprotocol is usable], ac_cv_have_libmemcachedprotocol, [
AC_TRY_COMPILE(
[ #include <libmemcachedprotocol-0.0/handler.h> ],
[ memcached_binary_protocol_callback_st s_test_impl;
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libmemcachedprotocol-0.0/handler.h>]], [[memcached_binary_protocol_callback_st s_test_impl;
s_test_impl.interface.v1.delete_object = 0;
],
[ ac_cv_have_libmemcachedprotocol="yes" ],
[ ac_cv_have_libmemcachedprotocol="no" ]
)
]])],[ac_cv_have_libmemcachedprotocol="yes"],[ac_cv_have_libmemcachedprotocol="no"])
])

if test "$ac_cv_have_libmemcachedprotocol" != "yes"; then
Expand Down

0 comments on commit 17eea87

Please sign in to comment.