Skip to content
Browse files

- Added AC_ZEND_C_BIGENDIAN macro (as requested by Andi)

  • Loading branch information...
1 parent 9318106 commit 4589cef5e1205fb94f8ad49ac7ba12e7060dc11d foobar committed Jan 10, 2005
Showing with 29 additions and 1 deletion.
  1. +28 −1 Zend/acinclude.m4
  2. +1 −0 Zend/configure.in
View
29 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'
])
-
View
1 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

0 comments on commit 4589cef

Please sign in to comment.
Something went wrong with that request. Please try again.