Module Name:    src
Committed By:   jdc
Date:           Mon May 28 17:28:54 UTC 2012

Modified Files:
        src/external/public-domain/xz: prepare-import.sh
        src/external/public-domain/xz/include: config.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/public-domain/xz/prepare-import.sh
cvs rdiff -u -r1.1 -r1.2 src/external/public-domain/xz/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/public-domain/xz/prepare-import.sh
diff -u src/external/public-domain/xz/prepare-import.sh:1.2 src/external/public-domain/xz/prepare-import.sh:1.3
--- src/external/public-domain/xz/prepare-import.sh:1.2	Tue Feb 28 14:22:21 2012
+++ src/external/public-domain/xz/prepare-import.sh	Mon May 28 17:28:53 2012
@@ -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 @@ done
 # 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

Index: src/external/public-domain/xz/include/config.h
diff -u src/external/public-domain/xz/include/config.h:1.1 src/external/public-domain/xz/include/config.h:1.2
--- src/external/public-domain/xz/include/config.h:1.1	Tue Nov  2 16:34:36 2010
+++ src/external/public-domain/xz/include/config.h	Mon May 28 17:28:54 2012
@@ -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. */

Reply via email to