Skip to content

Commit 4371945

Browse files
committed
Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE
Autoconf 2.50 released in 2001 made several macros obsolete including the AC_TRY_RUN, AC_TRY_COMPILE and AC_TRY_LINK: http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2 These macros should be replaced with the current AC_FOO_IFELSE instead: - AC_TRY_RUN with AC_RUN_IFELSE and AC_LANG_SOURCE - AC_TRY_LINK with AC_LINK_IFELSE and AC_LANG_PROGRAM - AC_TRY_COMPILE with AC_COMPILE_IFELSE and AC_LANG_PROGRAM PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require 2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which are all greater than above mentioned 2.50 version therefore systems should be well supported by now. This patch was created with the help of autoupdate script: autoupdate <file> 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 aac5cdc commit 4371945

File tree

21 files changed

+320
-347
lines changed

21 files changed

+320
-347
lines changed

Zend/Zend.m4

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ dnl
44

55
AC_DEFUN([LIBZEND_CHECK_INT_TYPE],[
66
AC_MSG_CHECKING(for $1)
7-
AC_TRY_COMPILE([
7+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
88
#if HAVE_SYS_TYPES_H
99
#include <sys/types.h>
1010
#endif
1111
#if HAVE_INTTYPES_H
1212
#include <inttypes.h>
1313
#elif HAVE_STDINT_H
1414
#include <stdint.h>
15-
#endif],
16-
[if (($1 *) 0)
15+
#endif]],
16+
[[if (($1 *) 0)
1717
return 0;
1818
if (sizeof ($1))
1919
return 0;
20-
],[
20+
]])],[
2121
AC_DEFINE_UNQUOTED([HAVE_]translit($1,a-z_-,A-Z__), 1,[Define if $1 type is present. ])
2222
AC_MSG_RESULT(yes)
23-
], AC_MSG_RESULT(no)
24-
)dnl
23+
], [AC_MSG_RESULT(no)
24+
])dnl
2525
])
2626

2727
AC_DEFUN([LIBZEND_BASIC_CHECKS],[
@@ -106,7 +106,7 @@ ZEND_CHECK_FLOAT_PRECISION
106106
dnl test whether double cast to long preserves least significant bits
107107
AC_MSG_CHECKING(whether double cast to long preserves least significant bits)
108108
109-
AC_TRY_RUN([
109+
AC_RUN_IFELSE([AC_LANG_SOURCE([[
110110
#include <limits.h>
111111
112112
int main()
@@ -126,7 +126,7 @@ int main()
126126
}
127127
exit(1);
128128
}
129-
], [
129+
]])], [
130130
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
131131
AC_MSG_RESULT(yes)
132132
], [
@@ -219,7 +219,7 @@ dnl test and set the alignment define for ZEND_MM
219219
dnl this also does the logarithmic test for ZEND_MM.
220220
AC_MSG_CHECKING(for MM alignment and log values)
221221
222-
AC_TRY_RUN([
222+
AC_RUN_IFELSE([AC_LANG_SOURCE([[
223223
#include <stdio.h>
224224
225225
typedef union _mm_align_test {
@@ -251,7 +251,7 @@ int main()
251251
252252
exit(0);
253253
}
254-
], [
254+
]])], [
255255
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
256256
LIBZEND_MM_ALIGN_LOG2=`cat conftest.zend | cut -d ' ' -f 2`
257257
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT, $LIBZEND_MM_ALIGN, [ ])
@@ -266,7 +266,7 @@ AC_MSG_RESULT(done)
266266
dnl test for memory allocation using mmap(MAP_ANON)
267267
AC_MSG_CHECKING(for memory allocation using mmap(MAP_ANON))
268268
269-
AC_TRY_RUN([
269+
AC_RUN_IFELSE([AC_LANG_SOURCE([[
270270
#include <sys/types.h>
271271
#include <sys/stat.h>
272272
#include <fcntl.h>
@@ -298,7 +298,7 @@ int main()
298298
}
299299
return 0;
300300
}
301-
], [
301+
]])], [
302302
AC_DEFINE([HAVE_MEM_MMAP_ANON], 1, [Define if the target system has support for memory allocation using mmap(MAP_ANON)])
303303
AC_MSG_RESULT(yes)
304304
], [
@@ -311,7 +311,7 @@ int main()
311311
dnl test for memory allocation using mmap("/dev/zero")
312312
AC_MSG_CHECKING(for memory allocation using mmap("/dev/zero"))
313313
314-
AC_TRY_RUN([
314+
AC_RUN_IFELSE([AC_LANG_SOURCE([[
315315
#include <sys/types.h>
316316
#include <sys/stat.h>
317317
#include <fcntl.h>
@@ -353,7 +353,7 @@ int main()
353353
}
354354
return 0;
355355
}
356-
], [
356+
]])], [
357357
AC_DEFINE([HAVE_MEM_MMAP_ZERO], 1, [Define if the target system has support for memory allocation using mmap("/dev/zero")])
358358
AC_MSG_RESULT(yes)
359359
], [
@@ -417,7 +417,7 @@ AC_ARG_ENABLE(gcc-global-regs,
417417
])
418418
AC_MSG_CHECKING(for global register variables support)
419419
if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
420-
AC_TRY_COMPILE([
420+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
421421
#if defined(__GNUC__)
422422
# define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
423423
#else
@@ -450,8 +450,8 @@ int emu(const opcode_handler_t *ip, void *fp) {
450450
FP = orig_fp;
451451
IP = orig_ip;
452452
}
453-
], [
454-
], [
453+
]], [[
454+
]])], [
455455
ZEND_GCC_GLOBAL_REGS=yes
456456
], [
457457
ZEND_GCC_GLOBAL_REGS=no
@@ -468,7 +468,7 @@ dnl
468468
dnl Check if atof() accepts NAN
469469
dnl
470470
AC_CACHE_CHECK(whether atof() accepts NAN, ac_cv_atof_accept_nan,[
471-
AC_TRY_RUN([
471+
AC_RUN_IFELSE([AC_LANG_SOURCE([[
472472
#include <math.h>
473473
#include <stdlib.h>
474474
@@ -484,7 +484,7 @@ int main(int argc, char** argv)
484484
{
485485
return zend_isnan(atof("NAN")) ? 0 : 1;
486486
}
487-
],[
487+
]])],[
488488
ac_cv_atof_accept_nan=yes
489489
],[
490490
ac_cv_atof_accept_nan=no
@@ -499,7 +499,7 @@ dnl
499499
dnl Check if atof() accepts INF
500500
dnl
501501
AC_CACHE_CHECK(whether atof() accepts INF, ac_cv_atof_accept_inf,[
502-
AC_TRY_RUN([
502+
AC_RUN_IFELSE([AC_LANG_SOURCE([[
503503
#include <math.h>
504504
#include <stdlib.h>
505505
@@ -518,7 +518,7 @@ int main(int argc, char** argv)
518518
{
519519
return zend_isinf(atof("INF")) && zend_isinf(atof("-INF")) ? 0 : 1;
520520
}
521-
],[
521+
]])],[
522522
ac_cv_atof_accept_inf=yes
523523
],[
524524
ac_cv_atof_accept_inf=no
@@ -533,7 +533,7 @@ dnl
533533
dnl Check if HUGE_VAL == INF
534534
dnl
535535
AC_CACHE_CHECK(whether HUGE_VAL == INF, ac_cv_huge_val_inf,[
536-
AC_TRY_RUN([
536+
AC_RUN_IFELSE([AC_LANG_SOURCE([[
537537
#include <math.h>
538538
#include <stdlib.h>
539539
@@ -552,7 +552,7 @@ int main(int argc, char** argv)
552552
{
553553
return zend_isinf(HUGE_VAL) ? 0 : 1;
554554
}
555-
],[
555+
]])],[
556556
ac_cv_huge_val_inf=yes
557557
],[
558558
ac_cv_huge_val_inf=no
@@ -568,7 +568,7 @@ dnl
568568
dnl Check if HUGE_VAL + -HUGEVAL == NAN
569569
dnl
570570
AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
571-
AC_TRY_RUN([
571+
AC_RUN_IFELSE([AC_LANG_SOURCE([[
572572
#include <math.h>
573573
#include <stdlib.h>
574574
@@ -589,7 +589,7 @@ int main(int argc, char** argv)
589589
return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
590590
#endif
591591
}
592-
],[
592+
]])],[
593593
ac_cv_huge_val_nan=yes
594594
],[
595595
ac_cv_huge_val_nan=no

Zend/acinclude.m4

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,14 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
4444

4545
AC_DEFUN([ZEND_FP_EXCEPT],[
4646
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
47-
AC_TRY_COMPILE([
47+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4848
#include <floatingpoint.h>
49-
],[
49+
]],[[
5050
fp_except x = (fp_except) 0;
51-
],[
51+
]])],[
5252
ac_cv_type_fp_except=yes
5353
],[
5454
ac_cv_type_fp_except=no
55-
],[
56-
ac_cv_type_fp_except=no
5755
])])
5856
if test "$ac_cv_type_fp_except" = "yes"; then
5957
AC_DEFINE(HAVE_FP_EXCEPT, 1, [whether floatingpoint.h defines fp_except])
@@ -65,7 +63,7 @@ dnl Check for broken sprintf()
6563
dnl
6664
AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[
6765
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
68-
AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
66+
AC_RUN_IFELSE([AC_LANG_SOURCE([[main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[
6967
ac_cv_broken_sprintf=no
7068
],[
7169
ac_cv_broken_sprintf=yes
@@ -89,8 +87,7 @@ AC_DEFUN([AC_ZEND_C_BIGENDIAN],
8987
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
9088
[
9189
ac_cv_c_bigendian_php=unknown
92-
AC_TRY_RUN(
93-
[
90+
AC_RUN_IFELSE([AC_LANG_SOURCE([[
9491
int main(void)
9592
{
9693
short one = 1;
@@ -102,7 +99,7 @@ int main(void)
10299
return(1);
103100
}
104101
}
105-
], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
102+
]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
106103
])
107104
if test $ac_cv_c_bigendian_php = yes; then
108105
AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if processor uses big-endian word])
@@ -117,9 +114,9 @@ dnl x87 floating point internal precision control checks
117114
dnl See: http://wiki.php.net/rfc/rounding
118115
AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
119116
AC_MSG_CHECKING([for usable _FPU_SETCW])
120-
AC_TRY_LINK([
117+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
121118
#include <fpu_control.h>
122-
],[
119+
]],[[
123120
fpu_control_t fpu_oldcw, fpu_cw;
124121
volatile double result;
125122
double a = 2877.0;
@@ -130,7 +127,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
130127
_FPU_SETCW(fpu_cw);
131128
result = a / b;
132129
_FPU_SETCW(fpu_oldcw);
133-
], [ac_cfp_have__fpu_setcw=yes], [ac_cfp_have__fpu_setcw=no])
130+
]])],[ac_cfp_have__fpu_setcw=yes],[ac_cfp_have__fpu_setcw=no])
134131
if test "$ac_cfp_have__fpu_setcw" = "yes" ; then
135132
AC_DEFINE(HAVE__FPU_SETCW, 1, [whether _FPU_SETCW is present and usable])
136133
AC_MSG_RESULT(yes)
@@ -139,9 +136,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
139136
fi
140137
141138
AC_MSG_CHECKING([for usable fpsetprec])
142-
AC_TRY_LINK([
139+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
143140
#include <machine/ieeefp.h>
144-
],[
141+
]],[[
145142
fp_prec_t fpu_oldprec;
146143
volatile double result;
147144
double a = 2877.0;
@@ -151,7 +148,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
151148
fpsetprec(FP_PD);
152149
result = a / b;
153150
fpsetprec(fpu_oldprec);
154-
], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
151+
]])], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
155152
if test "$ac_cfp_have_fpsetprec" = "yes" ; then
156153
AC_DEFINE(HAVE_FPSETPREC, 1, [whether fpsetprec is present and usable])
157154
AC_MSG_RESULT(yes)
@@ -160,9 +157,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
160157
fi
161158
162159
AC_MSG_CHECKING([for usable _controlfp])
163-
AC_TRY_LINK([
160+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
164161
#include <float.h>
165-
],[
162+
]],[[
166163
unsigned int fpu_oldcw;
167164
volatile double result;
168165
double a = 2877.0;
@@ -172,7 +169,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
172169
_controlfp(_PC_53, _MCW_PC);
173170
result = a / b;
174171
_controlfp(fpu_oldcw, _MCW_PC);
175-
], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
172+
]])], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
176173
if test "$ac_cfp_have__controlfp" = "yes" ; then
177174
AC_DEFINE(HAVE__CONTROLFP, 1, [whether _controlfp is present usable])
178175
AC_MSG_RESULT(yes)
@@ -181,9 +178,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
181178
fi
182179
183180
AC_MSG_CHECKING([for usable _controlfp_s])
184-
AC_TRY_LINK([
181+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
185182
#include <float.h>
186-
],[
183+
]],[[
187184
unsigned int fpu_oldcw, fpu_cw;
188185
volatile double result;
189186
double a = 2877.0;
@@ -194,7 +191,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
194191
_controlfp_s(&fpu_cw, _PC_53, _MCW_PC);
195192
result = a / b;
196193
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
197-
], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
194+
]])], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
198195
if test "$ac_cfp_have__controlfp_s" = "yes" ; then
199196
AC_DEFINE(HAVE__CONTROLFP_S, 1, [whether _controlfp_s is present and usable])
200197
AC_MSG_RESULT(yes)
@@ -203,9 +200,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
203200
fi
204201
205202
AC_MSG_CHECKING([whether FPU control word can be manipulated by inline assembler])
206-
AC_TRY_LINK([
203+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
207204
/* nothing */
208-
],[
205+
]],[[
209206
unsigned int oldcw, cw;
210207
volatile double result;
211208
double a = 2877.0;
@@ -218,7 +215,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
218215
result = a / b;
219216
220217
__asm__ __volatile__ ("fldcw %0" : : "m" (*&oldcw));
221-
], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
218+
]])], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
222219
if test "$ac_cfp_have_fpu_inline_asm_x86" = "yes" ; then
223220
AC_DEFINE(HAVE_FPU_INLINE_ASM_X86, 1, [whether FPU control word can be manipulated by inline assembler])
224221
AC_MSG_RESULT(yes)

0 commit comments

Comments
 (0)