diff options
author | Didier Raboud <odyx@debian.org> | 2018-03-31 20:38:08 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2018-03-31 20:38:08 +0200 |
commit | 0865527175b57dba4454ba6a8c328ab357de36d0 (patch) | |
tree | 6e974fd739786d514e1c7f62c9cbdf866b7b8663 /SCons | |
parent | fffdba994c6f2c4a9aa1f369e779a166a4862089 (diff) |
Import Upstream version 2.12
Diffstat (limited to 'SCons')
-rwxr-xr-x | SCons/Config/gnu | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/SCons/Config/gnu b/SCons/Config/gnu index ad4c4ee..302e08a 100755 --- a/SCons/Config/gnu +++ b/SCons/Config/gnu @@ -210,6 +210,36 @@ if conf.CheckPThread(): makensis_env.Append(LINKFLAGS = '-pthread')
conf.Finish()
+#
+# GCC doesn't define __BIG_ENDIAN__ or __LITTLE_ENDIAN__, so manually check
+# for the endianess and define __BIG_ENDIAN__ if needed.
+#
+
+def check_big_endian(ctx):
+ ctx.Message('Checking for __BIG_ENDIAN__... ')
+
+ test = """
+ int main() {
+ #ifdef __BIG_ENDIAN__
+ // already defined, no need to define again
+ return 0;
+ #else
+ int i = 1;
+ char *c = (char *) &i;
+ return c[0] != 1;
+ #endif
+ }
+ """
+
+ result = not ctx.TryRun(test, '.c')[0]
+ ctx.Result(result)
+ return result
+
+conf = defenv.Configure(custom_tests = { 'CheckBigEndian' : check_big_endian })
+if conf.CheckBigEndian():
+ makensis_env.Append(CPPFLAGS = ['__BIG_ENDIAN__'])
+conf.Finish()
+
### return
Return('stub_env makensis_env plugin_env util_env cp_util_env')
|