diff options
author | foobar <sniper@php.net> | 2005-01-10 01:33:29 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2005-01-10 01:33:29 +0000 |
commit | 4589cef5e1205fb94f8ad49ac7ba12e7060dc11d (patch) | |
tree | 41d4c1f77bb3dfbbd02702856195ef64dea90d7d | |
parent | 931810629c140955104306fe5b9867e4d738421c (diff) | |
download | php-git-4589cef5e1205fb94f8ad49ac7ba12e7060dc11d.tar.gz |
- Added AC_ZEND_C_BIGENDIAN macro (as requested by Andi)
-rw-r--r-- | Zend/acinclude.m4 | 29 | ||||
-rw-r--r-- | Zend/configure.in | 1 |
2 files changed, 29 insertions, 1 deletions
diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4 index c5d9503a6d..480e24e0b1 100644 --- a/Zend/acinclude.m4 +++ b/Zend/acinclude.m4 @@ -41,7 +41,34 @@ AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[ AC_DEFINE_UNQUOTED(ZEND_BROKEN_SPRINTF, $ac_result, [Whether sprintf is broken]) ]) +dnl +dnl AC_ZEND_C_BIGENDIAN +dnl Replacement macro for AC_C_BIGENDIAN +dnl +AC_DEFUN([AC_ZEND_C_BIGENDIAN], +[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php, + [ + ac_cv_c_bigendian_php=unknown + AC_TRY_RUN( + [ +int main(void) +{ + short one = 1; + char *cp = (char *)&one; + + if (*cp == 0) { + return(0); + } else { + 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_DEFUN([AM_SET_LIBTOOL_VARIABLE],[ LIBTOOL='$(SHELL) $(top_builddir)/libtool $1' ]) - diff --git a/Zend/configure.in b/Zend/configure.in index fd13fd9800..67d3598663 100644 --- a/Zend/configure.in +++ b/Zend/configure.in @@ -10,6 +10,7 @@ AC_PROG_CC AM_PROG_LEX AM_PROG_CC_STDC ZEND_VERSION=$VERSION +AC_ZEND_C_BIGENDIAN dnl We want this one before the checks, so the checks can modify CFLAGS. test -z "$CFLAGS" && auto_cflags=1 |