Commit bd73598e authored by Chow Loong Jin's avatar Chow Loong Jin Committed by Nikias Bassen

Fix endian detection in configure.ac

On debian-mips, neither __LITTLE_ENDIAN__ nor __BIG_ENDIAN__ are defined
anywhere, so PLIST_BYTE_ORDER defaults to PLIST_LITTLE_ENDIAN when it should
really be PLIST_BIG_ENDIAN on this architecture.

This fixes issue #13.
parent c44a2566
......@@ -49,16 +49,9 @@ AC_TYPE_UINT8_T
AC_CHECK_FUNCS([asprintf strcasecmp strdup strerror strndup stpcpy vasprintf])
AC_CHECK_HEADER(endian.h, [ac_cv_have_endian_h="yes"], [ac_cv_have_endian_h="no"])
if test "x$ac_cv_have_endian_h" = "xno"; then
AC_DEFINE(__LITTLE_ENDIAN,1234,[little endian])
AC_DEFINE(__BIG_ENDIAN,4321,[big endian])
AC_C_BIGENDIAN([ac_cv_c_bigendian="yes"], [ac_cv_c_bigendian="no"], [], [])
if test "x$ac_cv_c_bigendian" = "xyes"; then
AC_DEFINE(__BYTE_ORDER,4321,[big endian byte order])
else
AC_DEFINE(__BYTE_ORDER,1234,[little endian byte order])
fi
fi
AC_C_BIGENDIAN([AC_DEFINE([__BIG_ENDIAN__], [1], [big endian])],
[AC_DEFINE([__LITTLE_ENDIAN__], [1], [little endian])])
# Check for operating system
AC_MSG_CHECKING([whether to enable WIN32 build settings])
......
#ifndef COMMON_H
#define COMMON_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#define PLIST_LITTLE_ENDIAN 0
#define PLIST_BIG_ENDIAN 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment