diff options
author | Jason Hays <jason_hays22@mymail.eku.edu> | 2011-09-19 19:36:30 +0400 |
---|---|---|
committer | Jason Hays <jason_hays22@mymail.eku.edu> | 2011-09-19 19:36:30 +0400 |
commit | 2cbf475fb2c3c020029e1704c8e6cee04a267323 (patch) | |
tree | 5b09e590e1f6b0736cf5e7ec73d905f04c90a72a /build_files | |
parent | 94016ed285c351605057929139caf9b636b179b6 (diff) | |
parent | d78231734d6ccf224738ea76307c26f8c0d4dab4 (diff) |
Merged 40338-40364soc-2011-radish
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/scons/tools/btools.py | 18 |
1 files changed, 18 insertions, 0 deletions
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 "little" + # Big Endian + elif 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): |