From: foobar Date: Mon, 20 Dec 2004 20:38:18 +0000 (+0000) Subject: MFH: endian compile problem fix X-Git-Tag: php-4.3.11RC1~244 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0b9d42d2512e621a7d492b312b7feebdc7b26c7;p=php MFH: endian compile problem fix --- diff --git a/acinclude.m4 b/acinclude.m4 index 0b7507616a..a43e828209 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1862,3 +1862,30 @@ IFS="- /. APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6` ]) +dnl +dnl PHP_C_BIGENDIAN +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_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) + fi + ]) +]) diff --git a/configure.in b/configure.in index 9c694b953c..1713cd89da 100644 --- a/configure.in +++ b/configure.in @@ -170,6 +170,10 @@ else AC_MSG_WARN(You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers.) fi +dnl Check whether byte ordering is bigendian +PHP_C_BIGENDIAN + + dnl Platform-specific compile settings. dnl ------------------------------------------------------------------------- diff --git a/ext/xml/config.m4 b/ext/xml/config.m4 index e72e0828ff..98713c5181 100644 --- a/ext/xml/config.m4 +++ b/ext/xml/config.m4 @@ -2,9 +2,9 @@ dnl dnl $Id$ dnl -AC_C_BIGENDIAN +PHP_C_BIGENDIAN -if test "$ac_cv_c_bigendian" = "yes"; then +if test "$ac_cv_c_bigendian_php" = "yes"; then order=4321 else order=1234