]> granicus.if.org Git - php/commitdiff
MFH: endian compile problem fix
authorfoobar <sniper@php.net>
Mon, 20 Dec 2004 20:38:18 +0000 (20:38 +0000)
committerfoobar <sniper@php.net>
Mon, 20 Dec 2004 20:38:18 +0000 (20:38 +0000)
acinclude.m4
configure.in
ext/xml/config.m4

index 0b7507616acb10ab35266d07012c67c54aeb0d50..a43e8282092b5090368d9ae2e6638014d0319dcc 100644 (file)
@@ -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
+ ])
+])
index 9c694b953cce9522e34320f610bff1bef588b32b..1713cd89da783452804cc10011048a2be3995b62 100644 (file)
@@ -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 -------------------------------------------------------------------------
 
index e72e0828ff0b115cd290da41404de8adf8d28b46..98713c5181bed3c058d81c608e2da698c9bf1786 100644 (file)
@@ -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