Skip to content

Commit

Permalink
Autotools: Sync CS for PHP_EBCDIC and PHP_C_BIGENDIAN (#14923)
Browse files Browse the repository at this point in the history
- Over-quoted arguments reduced
- CS synced a bit
- AS_VAR_IF used instead of raw shell "if test"
  • Loading branch information
petk committed Jul 12, 2024
1 parent 58a3ab9 commit 79215c0
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1238,22 +1238,18 @@ AC_CHECK_DECL([strtok_r],,
dnl
dnl PHP_EBCDIC
dnl
AC_DEFUN([PHP_EBCDIC], [
AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
AC_DEFUN([PHP_EBCDIC],
[AC_CACHE_CHECK([whether system uses EBCDIC], [ac_cv_ebcdic],
[AC_RUN_IFELSE([AC_LANG_SOURCE([
int main(void) {
return (unsigned char)'A' != (unsigned char)0xC1;
}
]])],[
ac_cv_ebcdic=yes
],[
ac_cv_ebcdic=no
],[
ac_cv_ebcdic=no
])])
if test "$ac_cv_ebcdic" = "yes"; then
AC_MSG_ERROR([PHP does not support EBCDIC targets])
fi
])],
[ac_cv_ebcdic=yes],
[ac_cv_ebcdic=no],
[ac_cv_ebcdic=no])])
AS_VAR_IF([ac_cv_ebcdic], [yes],
[AC_MSG_ERROR([PHP does not support EBCDIC targets.])])
])

dnl
Expand Down Expand Up @@ -1546,26 +1542,26 @@ dnl
dnl Replacement macro for AC_C_BIGENDIAN.
dnl
AC_DEFUN([PHP_C_BIGENDIAN],
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
[
ac_cv_c_bigendian_php=unknown
AC_RUN_IFELSE([AC_LANG_SOURCE([[
[AC_CACHE_CHECK([whether byte ordering is bigendian], [ac_cv_c_bigendian_php],
[AC_RUN_IFELSE([AC_LANG_SOURCE([
int main(void)
{
short one = 1;
char *cp = (char *)&one;
if (*cp == 0) {
return(0);
} else {
return(1);
return 0;
}
return 1;
}
]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
])
if test $ac_cv_c_bigendian_php = yes; then
AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
fi
])],
[ac_cv_c_bigendian_php=yes],
[ac_cv_c_bigendian_php=no],
[ac_cv_c_bigendian_php=unknown])])
AS_VAR_IF([ac_cv_c_bigendian_php], [yes],
[AC_DEFINE([WORDS_BIGENDIAN], [],
[Define if processor uses big-endian word.])])
])

dnl ----------------------------------------------------------------------------
Expand Down

0 comments on commit 79215c0

Please sign in to comment.