From 74d59d78840da38cdcbe4dacb032fec2e0f2f437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 25 Aug 2018 15:26:49 +0200 Subject: cmake: Add detection whether the system is big endian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 3 +++ config.h.cmake | 16 ++++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index b5f556f..c6fcfb3 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -12,6 +12,9 @@ find_package( TDE ) tde_setup_architecture_flags( ) +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + ##### check for gcc visibility support ######### diff --git a/config.h.cmake b/config.h.cmake index 47cd0c7..a3a579f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -3,6 +3,10 @@ // Defined if you have fvisibility and fvisibility-inlines-hidden support. #cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@ @@ -291,18 +295,6 @@ /* Defined if compiling without arts */ /* #undef WITHOUT_ARTS */ -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif -#endif - /* * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system * headers and I'm too lazy to write a configure test as long as only -- cgit v1.2.3