aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2011-10-09 19:05:20 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2011-10-14 23:04:29 +0100
commit69295f04a92ba99d4c2b210c77e80ab48e4be621 (patch)
tree678280f0f15eb3cd856133da19c05a1e28fe4f56
parentb2fe0588bb37e5777575296a209b1a210968392e (diff)
downloadpaludis-69295f04a92ba99d4c2b210c77e80ab48e4be621.tar.gz
paludis-69295f04a92ba99d4c2b210c77e80ab48e4be621.tar.xz
Define a PALUDIS_ constant for big-endianness
This allows it to be referenced from headers, as we don't install config.h
-rw-r--r--configure.ac4
-rw-r--r--paludis/util/elf.cc2
-rw-r--r--paludis/util/sha1.cc2
3 files changed, 6 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index f6edefb..3eaaa89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,6 +86,10 @@ dnl }}}
dnl {{{ check for byte order
AC_C_BIGENDIAN
+if test "x$ac_cv_c_bigendian" = "xyes"; then
+ PALUDIS_CXXFLAGS="${PALUDIS_CXXFLAGS} -DPALUDIS_BIG_ENDIAN=1"
+ PALUDIS_PC_CFLAGS="${PALUDIS_PC_CFLAGS} -DPALUDIS_BIG_ENDIAN=1"
+fi
dnl }}}
need_xml_check=
diff --git a/paludis/util/elf.cc b/paludis/util/elf.cc
index 9936e25..760fe4f 100644
--- a/paludis/util/elf.cc
+++ b/paludis/util/elf.cc
@@ -59,7 +59,7 @@ namespace paludis
enum {
native_byte_order =
-#if WORDS_BIGENDIAN
+#ifdef PALUDIS_BIG_ENDIAN
ELFDATA2MSB
#else
ELFDATA2LSB
diff --git a/paludis/util/sha1.cc b/paludis/util/sha1.cc
index 7092017..135f111 100644
--- a/paludis/util/sha1.cc
+++ b/paludis/util/sha1.cc
@@ -35,7 +35,7 @@ using namespace paludis;
namespace
{
-#if WORDS_BIGENDIAN
+#ifdef PALUDIS_BIG_ENDIAN
inline uint32_t from_bigendian(uint32_t x)
{
return x;