From 5c676f789d9e896f4b8d88a977d4e0fcae3a9fc1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 25 May 2017 19:11:51 -0700 Subject: configure: detect endianness. * configure: New test for endianness of the compile target. Produces HAVE_LITTLE_ENDIAN in config.h with a value of either 1 or 0. --- configure | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'configure') diff --git a/configure b/configure index c80c8820..a441a7c4 100755 --- a/configure +++ b/configure @@ -1245,6 +1245,43 @@ fi printf "%d\n" "$lit_align" printf "#define LIT_ALIGN %d\n" "$lit_align" >> config.h +# +# Endianness. +# + +printf "Checking target machine endianness ... " +cat > conftest.c <> config.h + elif grep -q 'LISPUNIXCOREDWIM' conftest.o ; then + printf "big\n"; + printf "#define HAVE_LITTLE_ENDIAN 0\n" >> config.h + else + printf "failed\n" + exit 1 + fi +fi + # # Inline functions # -- cgit v1.2.3