Skip to content

Commit 79215c0

Browse files
authored
Autotools: Sync CS for PHP_EBCDIC and PHP_C_BIGENDIAN (#14923)
- Over-quoted arguments reduced - CS synced a bit - AS_VAR_IF used instead of raw shell "if test"
1 parent 58a3ab9 commit 79215c0

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

build/php.m4

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,22 +1238,18 @@ AC_CHECK_DECL([strtok_r],,
12381238
dnl
12391239
dnl PHP_EBCDIC
12401240
dnl
1241-
AC_DEFUN([PHP_EBCDIC], [
1242-
AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[
1243-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1241+
AC_DEFUN([PHP_EBCDIC],
1242+
[AC_CACHE_CHECK([whether system uses EBCDIC], [ac_cv_ebcdic],
1243+
[AC_RUN_IFELSE([AC_LANG_SOURCE([
12441244
int main(void) {
12451245
return (unsigned char)'A' != (unsigned char)0xC1;
12461246
}
1247-
]])],[
1248-
ac_cv_ebcdic=yes
1249-
],[
1250-
ac_cv_ebcdic=no
1251-
],[
1252-
ac_cv_ebcdic=no
1253-
])])
1254-
if test "$ac_cv_ebcdic" = "yes"; then
1255-
AC_MSG_ERROR([PHP does not support EBCDIC targets])
1256-
fi
1247+
])],
1248+
[ac_cv_ebcdic=yes],
1249+
[ac_cv_ebcdic=no],
1250+
[ac_cv_ebcdic=no])])
1251+
AS_VAR_IF([ac_cv_ebcdic], [yes],
1252+
[AC_MSG_ERROR([PHP does not support EBCDIC targets.])])
12571253
])
12581254

12591255
dnl
@@ -1546,26 +1542,26 @@ dnl
15461542
dnl Replacement macro for AC_C_BIGENDIAN.
15471543
dnl
15481544
AC_DEFUN([PHP_C_BIGENDIAN],
1549-
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
1550-
[
1551-
ac_cv_c_bigendian_php=unknown
1552-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1545+
[AC_CACHE_CHECK([whether byte ordering is bigendian], [ac_cv_c_bigendian_php],
1546+
[AC_RUN_IFELSE([AC_LANG_SOURCE([
15531547
int main(void)
15541548
{
15551549
short one = 1;
15561550
char *cp = (char *)&one;
15571551
15581552
if (*cp == 0) {
1559-
return(0);
1560-
} else {
1561-
return(1);
1553+
return 0;
15621554
}
1555+
1556+
return 1;
15631557
}
1564-
]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
1565-
])
1566-
if test $ac_cv_c_bigendian_php = yes; then
1567-
AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
1568-
fi
1558+
])],
1559+
[ac_cv_c_bigendian_php=yes],
1560+
[ac_cv_c_bigendian_php=no],
1561+
[ac_cv_c_bigendian_php=unknown])])
1562+
AS_VAR_IF([ac_cv_c_bigendian_php], [yes],
1563+
[AC_DEFINE([WORDS_BIGENDIAN], [],
1564+
[Define if processor uses big-endian word.])])
15691565
])
15701566

15711567
dnl ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)