Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/public-domain/xz Determine WORDS_BIGENDIAN at build...



details:   https://anonhg.NetBSD.org/src/rev/50b7ca762701
branches:  trunk
changeset: 779446:50b7ca762701
user:      jdc <jdc%NetBSD.org@localhost>
date:      Mon May 28 17:28:53 2012 +0000

description:
Determine WORDS_BIGENDIAN at build time, rather than hardcoding it to 0.
Makes liblzma work on sparc64 (and probably other big endian hosts too).
Add a note to the import script.

diffstat:

 external/public-domain/xz/include/config.h  |   9 ++-------
 external/public-domain/xz/prepare-import.sh |  11 ++++++++++-
 2 files changed, 12 insertions(+), 8 deletions(-)

diffs (43 lines):

diff -r 25235458c423 -r 50b7ca762701 external/public-domain/xz/include/config.h
--- a/external/public-domain/xz/include/config.h        Mon May 28 14:19:10 2012 +0000
+++ b/external/public-domain/xz/include/config.h        Mon May 28 17:28:53 2012 +0000
@@ -286,14 +286,9 @@
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
+#include <sys/endian.h>
+#if BYTE_ORDER == BIG_ENDIAN
 #  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-/* #  undef WORDS_BIGENDIAN */
-# endif
 #endif
 
 /* Number of bits in a file offset, on hosts where this is settable. */
diff -r 25235458c423 -r 50b7ca762701 external/public-domain/xz/prepare-import.sh
--- a/external/public-domain/xz/prepare-import.sh       Mon May 28 14:19:10 2012 +0000
+++ b/external/public-domain/xz/prepare-import.sh       Mon May 28 17:28:53 2012 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: prepare-import.sh,v 1.2 2012/02/28 14:22:21 joerg Exp $
+# $NetBSD: prepare-import.sh,v 1.3 2012/05/28 17:28:53 jdc Exp $
 
 set -e
 
@@ -31,3 +31,12 @@
 # build-aux/* from autoconf
 # lib/*
 # m4/*
+
+# Changes to config.h
+echo Add build-time endian test to include/config.h:
+cat << EOE
+#include <sys/endian.h>
+#if BYTE_ORDER == BIG_ENDIAN
+#  define WORDS_BIGENDIAN 1
+#endif
+EOE



Home | Main Index | Thread Index | Old Index