]> granicus.if.org Git - php/commitdiff
- Added AC_ZEND_C_BIGENDIAN macro (as requested by Andi)
authorfoobar <sniper@php.net>
Mon, 10 Jan 2005 01:33:29 +0000 (01:33 +0000)
committerfoobar <sniper@php.net>
Mon, 10 Jan 2005 01:33:29 +0000 (01:33 +0000)
Zend/acinclude.m4
Zend/configure.in

index c5d9503a6db225fc5823d1a1b92d1da0c3c4ebe8..480e24e0b11ed9bf5baeb25b2277c630ef8f4107 100644 (file)
@@ -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'
 ])
-
index fd13fd9800f3e4f3e5d0a94b3f72a0ea04671906..67d35986639094c76fe19f1c06dc8bf2a7254c45 100644 (file)
@@ -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