From 83a2f02a78cd01aaf31b9b4ae8a217a1ecea6a49 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 19 Sep 2011 08:02:17 +0000 Subject: cleanup endian handling - define __BIG_ENDIAN__ or __LITTLE_ENDIAN__ with cmake & scons. - ENDIAN_ORDER is now a define rather than a global short. - replace checks like this with single ifdef: #if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__) - remove BKE_endian.h which isn't used --- build_files/scons/tools/btools.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'build_files/scons') diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index be059241727..caa83ea41be 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -63,9 +63,27 @@ def get_revision(): return 'r' + build_rev + +# copied from: http://www.scons.org/wiki/AutoconfRecipes +def checkEndian(): + import struct + array = struct.pack('cccc', '\x01', '\x02', '\x03', '\x04') + i = struct.unpack('i', array) + # Little Endian + if i == struct.unpack('i', array): + return "big" + else: + raise Exception("cant find endian") + + # This is used in creating the local config directories VERSION, VERSION_DISPLAY = get_version() REVISION = get_revision() +ENDIAN = checkEndian() + def print_arguments(args, bc): if len(args): -- cgit v1.2.3