From a1a822c94775e93dc3d3678c9fe0288b72dc1e01 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 2 Jul 2018 18:16:16 +0200 Subject: [PATCH] Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE Autoconf made several macros obsolete including the AC_TRY_COMPILE and AC_TRY_LINK in 2000 and since Autoconf 2.50: http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2 These macros should be replaced with the current AC_FOO_IFELSE instead. It is fairly safe to upgrade and take the recommendation advice of autoconf upgrade manual since the upgrade should be compatible at least with PHP versions 5.4 and up, on some systems even with PHP 5.3. PHP versions from 5.4 to 7.1 require Autoconf 2.59+ and PHP 7.2+ require Autoconf 2.64+. This patch was created with the help of autoupdate script. Reference docs: - https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html - https://www.gnu.org/software/autoconf/manual/autoconf-2.59/autoconf.pdf --- config.m4 | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/config.m4 b/config.m4 index f086d492..82b5080e 100644 --- a/config.m4 +++ b/config.m4 @@ -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 ], - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ #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 @@ -304,12 +299,11 @@ if test "$PHP_MEMCACHED" != "no"; then LIBS="$LIBS $PHP_LIBMEMCACHED_LIBS" AC_CACHE_CHECK([whether memcached_exist is defined], ac_cv_have_memcached_exist, [ - AC_TRY_LINK( - [ #include ], - [ memcached_exist (NULL, NULL, 0); ], - [ ac_cv_have_memcached_exist="yes" ], - [ ac_cv_have_memcached_exist="no" ] - ) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[memcached_exist (NULL, NULL, 0);]])], + [ac_cv_have_memcached_exist="yes"], + [ac_cv_have_memcached_exist="no"]) ]) CFLAGS="$ORIG_CFLAGS" @@ -323,12 +317,11 @@ if test "$PHP_MEMCACHED" != "no"; then fi AC_CACHE_CHECK([whether memcached_set_encoding_key is defined], ac_cv_have_memcached_set_encoding_key, [ - AC_TRY_LINK( - [ #include ], - [ memcached_set_encoding_key (NULL, NULL, 0); ], - [ ac_cv_have_memcached_set_encoding_key="yes" ], - [ ac_cv_have_memcached_set_encoding_key="no" ] - ) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[memcached_set_encoding_key (NULL, NULL, 0);]])], + [ac_cv_have_memcached_set_encoding_key="yes"], + [ac_cv_have_memcached_set_encoding_key="no"]) ]) CFLAGS="$ORIG_CFLAGS" @@ -360,14 +353,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 ], - [ memcached_binary_protocol_callback_st s_test_impl; + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[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