Skip to content

Commit a1a822c

Browse files
committed
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
1 parent f5f84c5 commit a1a822c

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

Diff for: config.m4

+14-26
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,13 @@ if test "$PHP_MEMCACHED" != "no"; then
260260
dnl # Always check if libmemcached was built with SASL support,
261261
dnl # because it will require sasl.h even if not used here.
262262
AC_CACHE_CHECK([for libmemcached sasl.h requirement], ac_cv_memc_sasl_support, [
263-
AC_TRY_COMPILE(
264-
[ #include <libmemcached/memcached.h> ],
265-
[
263+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libmemcached/memcached.h>]], [[
266264
#if LIBMEMCACHED_WITH_SASL_SUPPORT
267265
/* yes */
268266
#else
269267
# error "no sasl support"
270268
#endif
271-
],
272-
[ ac_cv_memc_sasl_support="yes" ],
273-
[ ac_cv_memc_sasl_support="no" ]
274-
)
269+
]])],[ac_cv_memc_sasl_support="yes"],[ac_cv_memc_sasl_support="no"])
275270
])
276271

277272
if test "$ac_cv_memc_sasl_support" = "yes"; then
@@ -304,12 +299,11 @@ if test "$PHP_MEMCACHED" != "no"; then
304299
LIBS="$LIBS $PHP_LIBMEMCACHED_LIBS"
305300

306301
AC_CACHE_CHECK([whether memcached_exist is defined], ac_cv_have_memcached_exist, [
307-
AC_TRY_LINK(
308-
[ #include <libmemcached/memcached.h> ],
309-
[ memcached_exist (NULL, NULL, 0); ],
310-
[ ac_cv_have_memcached_exist="yes" ],
311-
[ ac_cv_have_memcached_exist="no" ]
312-
)
302+
AC_LINK_IFELSE(
303+
[AC_LANG_PROGRAM([[#include <libmemcached/memcached.h>]],
304+
[[memcached_exist (NULL, NULL, 0);]])],
305+
[ac_cv_have_memcached_exist="yes"],
306+
[ac_cv_have_memcached_exist="no"])
313307
])
314308

315309
CFLAGS="$ORIG_CFLAGS"
@@ -323,12 +317,11 @@ if test "$PHP_MEMCACHED" != "no"; then
323317
fi
324318

325319
AC_CACHE_CHECK([whether memcached_set_encoding_key is defined], ac_cv_have_memcached_set_encoding_key, [
326-
AC_TRY_LINK(
327-
[ #include <libmemcached/memcached.h> ],
328-
[ memcached_set_encoding_key (NULL, NULL, 0); ],
329-
[ ac_cv_have_memcached_set_encoding_key="yes" ],
330-
[ ac_cv_have_memcached_set_encoding_key="no" ]
331-
)
320+
AC_LINK_IFELSE(
321+
[AC_LANG_PROGRAM([[#include <libmemcached/memcached.h>]],
322+
[[memcached_set_encoding_key (NULL, NULL, 0);]])],
323+
[ac_cv_have_memcached_set_encoding_key="yes"],
324+
[ac_cv_have_memcached_set_encoding_key="no"])
332325
])
333326

334327
CFLAGS="$ORIG_CFLAGS"
@@ -360,14 +353,9 @@ if test "$PHP_MEMCACHED" != "no"; then
360353
AC_MSG_RESULT([enabled])
361354

362355
AC_CACHE_CHECK([whether libmemcachedprotocol is usable], ac_cv_have_libmemcachedprotocol, [
363-
AC_TRY_COMPILE(
364-
[ #include <libmemcachedprotocol-0.0/handler.h> ],
365-
[ memcached_binary_protocol_callback_st s_test_impl;
356+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libmemcachedprotocol-0.0/handler.h>]], [[memcached_binary_protocol_callback_st s_test_impl;
366357
s_test_impl.interface.v1.delete_object = 0;
367-
],
368-
[ ac_cv_have_libmemcachedprotocol="yes" ],
369-
[ ac_cv_have_libmemcachedprotocol="no" ]
370-
)
358+
]])],[ac_cv_have_libmemcachedprotocol="yes"],[ac_cv_have_libmemcachedprotocol="no"])
371359
])
372360

373361
if test "$ac_cv_have_libmemcachedprotocol" != "yes"; then

0 commit comments

Comments
 (0)