From b546a94b83b014f39cbd33ee2a8db5532c81bcc7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 29 Jun 2011 14:29:58 -0500 Subject: [svn-r21048] Add configure check for endianess and adjust test depending on status of check. Bring r21026 from trunk --- config/cmake/ConfigureChecks.cmake | 6 +++++- config/cmake/H5pubconf.h.in | 2 ++ tools/h5ls/CMakeLists.txt | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index a7f9228..9c9c8d1 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -10,6 +10,7 @@ INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) INCLUDE (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) INCLUDE (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) #----------------------------------------------------------------------------- # Always SET this for now IF we are on an OS X box @@ -222,6 +223,9 @@ SET (USE_INCLUDES "") IF (WINDOWS) SET (USE_INCLUDES ${USE_INCLUDES} "windows.h") ENDIF (WINDOWS) + +TEST_BIG_ENDIAN(H5_WORDS_BIGENDIAN) + #----------------------------------------------------------------------------- # Check IF header file exists and add it to the list. #----------------------------------------------------------------------------- @@ -645,7 +649,7 @@ IF (WINDOWS) ENDIF("${HAVE_IOEO_EXITCODE}" EQUAL 0) ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") ENDIF (WINDOWS) - + #----------------------------------------------------------------------------- # Option to see if GPFS is available on this filesystem --enable-gpfs diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 991dea8..ed0c15c 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -759,6 +759,8 @@ # endif #endif +#cmakedefine WORDS_BIGENDIAN @H5_WORDS_BIGENDIANR@ + /* Number of bits in a file offset, on hosts where this is settable. */ #cmakedefine _FILE_OFFSET_BITS diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index ff1e3c4..398d027 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -389,15 +389,15 @@ IF (BUILD_TESTING) # test for non-existing file ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) - IF (WORDS_BIGENDIAN) + IF (H5_WORDS_BIGENDIAN) # test for variable length data types in verbose mode ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) # test for dataset region references data types in verbose mode ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) - ELSE (WORDS_BIGENDIAN) + ELSE (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) - ENDIF (WORDS_BIGENDIAN) + ENDIF (H5_WORDS_BIGENDIAN) ENDIF (BUILD_TESTING) -- cgit v0.12