Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace obsolete macros AC_TRY_FOO with AC_FOO_IFELSE #403

Merged
merged 1 commit into from
Sep 1, 2018

Conversation

petk
Copy link
Contributor

@petk petk commented Jul 2, 2018

Hello, Autoconf made several macros obsolete in several versions behind very long time ago, including the AC_TRY_COMPILE which should be replaced with current AC_COMPILE_IFELSE instead.

Refs:

This patch has been done with the help of autoupdate script:

autoupdate config.m4

Thanks for considering checking this out or merging it.

@petk petk changed the title Replace obsolete macro AC_TRY_COMPILE with AC_COMPILE_IFELSE Replace obsolete macros AC_TRY_FOO with AC_FOO_IFELSE Jul 20, 2018
@petk
Copy link
Contributor Author

petk commented Jul 20, 2018

Redacted: I've now replaced all obsolete AC_TRY_FOO macros since they can be replaced with the AC_FOO_IFELSE.

See commit message for more info...

config.m4 Outdated
[ ac_cv_memc_sasl_support="yes" ],
[ ac_cv_memc_sasl_support="no" ]
)
]])],[ac_cv_memc_sasl_support="yes"],[ac_cv_memc_sasl_support="no"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: keep the same line split.

config.m4 Outdated
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: split long line.

config.m4 Outdated
[ ac_cv_have_libmemcachedprotocol="yes" ],
[ ac_cv_have_libmemcachedprotocol="no" ]
)
]])],[ac_cv_have_libmemcachedprotocol="yes"],[ac_cv_have_libmemcachedprotocol="no"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

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
@petk
Copy link
Contributor Author

petk commented Jul 21, 2018

Longer lines have been split as suggested. Yes, I'm not much familiar with any coding style for the M4 files, so feel free to refactor or suggest if there is something missing here.

This is mostly done as autoupdate has done it automatically and what is in the manual...

@sodabrew sodabrew merged commit f773f27 into php-memcached-dev:master Sep 1, 2018
@sodabrew sodabrew added this to the 3.1.0 milestone Sep 1, 2018
@petk petk deleted the patch-configure-1 branch September 1, 2018 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants