From b780be757851eefbad64085006ccae806b3e5aeb Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 27 Apr 2009 12:06:24 +0200 Subject: [PATCH] build: detect endianness at compile time Signed-off-by: Julien Danjou --- awesomeConfig.cmake | 5 +++++ config.h.in | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index 610025ee..c10109b1 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -28,6 +28,11 @@ add_definitions(-std=gnu99 -ggdb3 -fno-strict-aliasing -Wall -Wextra -Wstrict-prototypes) # }}} +# {{{ Endianness +include(TestBigEndian) +TEST_BIG_ENDIAN(AWESOME_IS_BIG_ENDIAN) +# }}} + # {{{ Find external utilities macro(a_find_program var prg req) set(required ${req}) diff --git a/config.h.in b/config.h.in index 2f4d2f9e..9241050e 100644 --- a/config.h.in +++ b/config.h.in @@ -1,8 +1,9 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ -#define AWESOME_LUA_LIB_PATH "@AWESOME_LUA_LIB_PATH@" -#define XDG_CONFIG_DIR "@XDG_CONFIG_DIR@" +#define AWESOME_LUA_LIB_PATH "@AWESOME_LUA_LIB_PATH@" +#define XDG_CONFIG_DIR "@XDG_CONFIG_DIR@" +#define AWESOME_IS_BIG_ENDIAN @AWESOME_IS_BIG_ENDIAN@ #cmakedefine WITH_DBUS