summaryrefslogtreecommitdiffstats
path: root/lib/ccan/wscript
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ccan/wscript')
-rw-r--r--lib/ccan/wscript55
1 files changed, 0 insertions, 55 deletions
diff --git a/lib/ccan/wscript b/lib/ccan/wscript
index 1c5f337ee44..0e540dbf088 100644
--- a/lib/ccan/wscript
+++ b/lib/ccan/wscript
@@ -25,61 +25,6 @@ def configure(conf):
conf.CHECK_CODE('int __attribute__((used)) func(int x) { return x; }',
addmain=False, link=False, cflags=conf.env['WERROR_CFLAGS'],
define='HAVE_ATTRIBUTE_USED')
- # We try to use headers for a compile-time test.
- conf.CHECK_CODE(code = """#ifdef __BYTE_ORDER
- #define B __BYTE_ORDER
- #elif defined(BYTE_ORDER)
- #define B BYTE_ORDER
- #endif
-
- #ifdef __LITTLE_ENDIAN
- #define LITTLE __LITTLE_ENDIAN
- #elif defined(LITTLE_ENDIAN)
- #define LITTLE LITTLE_ENDIAN
- #endif
-
- #if !defined(LITTLE) || !defined(B) || LITTLE != B
- #error Not little endian.
- #endif""",
- headers="endian.h sys/endian.h",
- define="HAVE_LITTLE_ENDIAN")
- conf.CHECK_CODE(code = """#ifdef __BYTE_ORDER
- #define B __BYTE_ORDER
- #elif defined(BYTE_ORDER)
- #define B BYTE_ORDER
- #endif
-
- #ifdef __BIG_ENDIAN
- #define BIG __BIG_ENDIAN
- #elif defined(BIG_ENDIAN)
- #define BIG BIG_ENDIAN
- #endif
-
- #if !defined(BIG) || !defined(B) || BIG != B
- #error Not big endian.
- #endif""",
- headers="endian.h sys/endian.h",
- define="HAVE_BIG_ENDIAN")
-
- if not conf.CONFIG_SET("HAVE_BIG_ENDIAN") and not conf.CONFIG_SET("HAVE_LITTLE_ENDIAN"):
- # That didn't work! Do runtime test.
- conf.CHECK_CODE("""union { int i; char c[sizeof(int)]; } u;
- u.i = 0x01020304;
- return u.c[0] == 0x04 && u.c[1] == 0x03 && u.c[2] == 0x02 && u.c[3] == 0x01 ? 0 : 1;""",
- addmain=True, execute=True,
- define='HAVE_LITTLE_ENDIAN',
- msg="Checking for HAVE_LITTLE_ENDIAN - runtime")
- conf.CHECK_CODE("""union { int i; char c[sizeof(int)]; } u;
- u.i = 0x01020304;
- return u.c[0] == 0x01 && u.c[1] == 0x02 && u.c[2] == 0x03 && u.c[3] == 0x04 ? 0 : 1;""",
- addmain=True, execute=True,
- define='HAVE_BIG_ENDIAN',
- msg="Checking for HAVE_BIG_ENDIAN - runtime")
-
- # Extra sanity check.
- if conf.CONFIG_SET("HAVE_BIG_ENDIAN") == conf.CONFIG_SET("HAVE_LITTLE_ENDIAN"):
- Logs.error("Failed endian determination. The PDP-11 is back?")
- sys.exit(1)
conf.CHECK_CODE('return __builtin_choose_expr(1, 0, "garbage");',
link=True,