Skip to content

Commit f773f27

Browse files
petksodabrew
authored andcommittedSep 1, 2018
Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE (#403)
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 58b299e commit f773f27

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed
 

‎config.m4

+19-24
Original file line numberDiff line numberDiff line change
@@ -259,17 +259,15 @@ if test "$PHP_MEMCACHED" != "no"; then
259259
dnl # Always check if libmemcached was built with SASL support,
260260
dnl # because it will require sasl.h even if not used here.
261261
AC_CACHE_CHECK([for libmemcached sasl.h requirement], ac_cv_memc_sasl_support, [
262-
AC_TRY_COMPILE(
263-
[ #include <libmemcached/memcached.h> ],
264-
[
262+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libmemcached/memcached.h>]], [[
265263
#if LIBMEMCACHED_WITH_SASL_SUPPORT
266264
/* yes */
267265
#else
268266
# error "no sasl support"
269267
#endif
270-
],
271-
[ ac_cv_memc_sasl_support="yes" ],
272-
[ ac_cv_memc_sasl_support="no" ]
268+
]])],
269+
[ac_cv_memc_sasl_support="yes"],
270+
[ac_cv_memc_sasl_support="no"]
273271
)
274272
])
275273

@@ -303,12 +301,11 @@ if test "$PHP_MEMCACHED" != "no"; then
303301
LIBS="$LIBS $PHP_LIBMEMCACHED_LIBS"
304302

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

314311
CFLAGS="$ORIG_CFLAGS"
@@ -322,12 +319,11 @@ if test "$PHP_MEMCACHED" != "no"; then
322319
fi
323320

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

333329
CFLAGS="$ORIG_CFLAGS"
@@ -359,13 +355,12 @@ if test "$PHP_MEMCACHED" != "no"; then
359355
AC_MSG_RESULT([enabled])
360356

361357
AC_CACHE_CHECK([whether libmemcachedprotocol is usable], ac_cv_have_libmemcachedprotocol, [
362-
AC_TRY_COMPILE(
363-
[ #include <libmemcachedprotocol-0.0/handler.h> ],
364-
[ memcached_binary_protocol_callback_st s_test_impl;
358+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libmemcachedprotocol-0.0/handler.h>]],
359+
[[memcached_binary_protocol_callback_st s_test_impl;
365360
s_test_impl.interface.v1.delete_object = 0;
366-
],
367-
[ ac_cv_have_libmemcachedprotocol="yes" ],
368-
[ ac_cv_have_libmemcachedprotocol="no" ]
361+
]])],
362+
[ac_cv_have_libmemcachedprotocol="yes"],
363+
[ac_cv_have_libmemcachedprotocol="no"]
369364
)
370365
])
371366

0 commit comments

Comments
 (0)
Please sign in to comment.