Skip to content

Commit 59c2aaa

Browse files
committed
Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE
Autoconf made several macros obsolete including the AC_TRY_RUN 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 the autoupdate script: autoupdate config.m4 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 18b79d9 commit 59c2aaa

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

config.m4

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if test "$PHP_V8JS" != "no"; then
4343
old_CPPFLAGS=$CPPFLAGS
4444
AC_LANG_PUSH([C++])
4545
CPPFLAGS="-std="$ac_cv_v8_cstd
46-
AC_TRY_RUN([int main() { return 0; }],[],[ac_cv_v8_cstd="c++0x"],[])
46+
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],[],[ac_cv_v8_cstd="c++0x"],[])
4747
AC_LANG_POP([C++])
4848
CPPFLAGS=$old_CPPFLAGS
4949
]);
@@ -53,27 +53,27 @@ if test "$PHP_V8JS" != "no"; then
5353
old_CXXFLAGS=$CXXFLAGS
5454
AC_LANG_PUSH([C++])
5555
CXXFLAGS="-std="$ac_cv_v8_cstd
56-
AC_TRY_RUN([int main() {
56+
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() {
5757
struct { unsigned int x; } foo = {-1};
5858
(void) foo;
5959
return 0;
60-
}], [ ac_cv_v8_narrowing="" ], [
60+
}]])],[ac_cv_v8_narrowing=""],[
6161
CXXFLAGS="-Wno-c++11-narrowing -std="$ac_cv_v8_cstd
62-
AC_TRY_RUN([int main() {
62+
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() {
6363
struct { unsigned int x; } foo = {-1};
6464
(void) foo;
6565
return 0;
66-
}], [ ac_cv_v8_narrowing="-Wno-c++11-narrowing" ], [
66+
}]])],[ac_cv_v8_narrowing="-Wno-c++11-narrowing"],[
6767
CXXFLAGS="-Wno-narrowing -std="$ac_cv_v8_cstd
68-
AC_TRY_RUN([int main() {
68+
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() {
6969
struct { unsigned int x; } foo = {-1};
7070
(void) foo;
7171
return 0;
72-
}], [ ac_cv_v8_narrowing="-Wno-narrowing" ], [
72+
}]])],[ac_cv_v8_narrowing="-Wno-narrowing"],[
7373
AC_MSG_ERROR([cannot compile with narrowing])
74-
], [])
75-
], [])
76-
], [])
74+
],[])
75+
],[])
76+
],[])
7777
AC_LANG_POP([C++])
7878
CXXFLAGS=$old_CXXFLAGS
7979
]);
@@ -117,7 +117,7 @@ if test "$PHP_V8JS" != "no"; then
117117
dnl
118118
LIBS="$LIBS $V8JS_SHARED_LIBADD"
119119
AC_CACHE_CHECK(for V8 version, ac_cv_v8_version, [
120-
AC_TRY_RUN([#include <v8.h>
120+
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <v8.h>
121121
#include <iostream>
122122
#include <fstream>
123123
using namespace std;
@@ -132,7 +132,7 @@ int main ()
132132
return 0;
133133
}
134134
return 1;
135-
}], [ac_cv_v8_version=`cat ./conftestval|awk '{print $1}'`], [ac_cv_v8_version=NONE], [ac_cv_v8_version=NONE])
135+
}]])],[ac_cv_v8_version=`cat ./conftestval|awk '{print $1}'`],[ac_cv_v8_version=NONE],[ac_cv_v8_version=NONE])
136136
])
137137

138138
if test "$ac_cv_v8_version" != "NONE"; then

0 commit comments

Comments
 (0)