|
@@ -119,6 +119,28 @@ if(STATS STREQUAL "global")
|
|
set(WITH_ALLOCATOR_STATS ON)
|
|
set(WITH_ALLOCATOR_STATS ON)
|
|
endif(STATS STREQUAL "global")
|
|
endif(STATS STREQUAL "global")
|
|
|
|
|
|
|
|
+if(PAGESIZE_ALIGN)
|
|
|
|
+ execute_process(COMMAND getconf PAGESIZE OUTPUT_VARIABLE SYS_PAGESIZE)
|
|
|
|
+ string(STRIP ${SYS_PAGESIZE} SYS_PAGESIZE)
|
|
|
|
+ MATH( EXPR PS_NOT_POW_2 "${SYS_PAGESIZE} & (${SYS_PAGESIZE} - 1)" )
|
|
|
|
+ if(NOT SYS_PAGESIZE OR PS_NOT_POW_2)
|
|
|
|
+ message(FATAL_ERROR "System page size (" ${SYS_PAGESIZE}
|
|
|
|
+ ") is reported not to be a power of two.")
|
|
|
|
+ endif(NOT SYS_PAGESIZE OR PS_NOT_POW_2)
|
|
|
|
+ MATH( EXPR SAS_MOD_PG "${SYS_ALLOC_SIZE} % ${SYS_PAGESIZE}" )
|
|
|
|
+ if(SAS_MOD_PG)
|
|
|
|
+ message(FATAL_ERROR "System allocation size (" ${SYS_ALLOC_SIZE}
|
|
|
|
+ ") is not a multiple of the system page size (" ${SYS_PAGESIZE}
|
|
|
|
+ "). Please set it so that it is.")
|
|
|
|
+ endif(SAS_MOD_PG)
|
|
|
|
+endif(PAGESIZE_ALIGN)
|
|
|
|
+
|
|
|
|
+MATH( EXPR SAS_NOT_POW_2 "${SYS_ALLOC_SIZE} & (${SYS_ALLOC_SIZE} - 1)" )
|
|
|
|
+if(NOT SYS_ALLOC_SIZE OR SAS_NOT_POW_2)
|
|
|
|
+ message(FATAL_ERROR "You have to set SYS_ALLOC_SIZE (" ${SYS_ALLOC_SIZE}
|
|
|
|
+ ") to a power of two.")
|
|
|
|
+endif(NOT SYS_ALLOC_SIZE OR SAS_NOT_POW_2)
|
|
|
|
+
|
|
configure_file (
|
|
configure_file (
|
|
"${PROJECT_SOURCE_DIR}/config.h.cmake"
|
|
"${PROJECT_SOURCE_DIR}/config.h.cmake"
|
|
"${PROJECT_BINARY_DIR}/dmmlib/config.h"
|
|
"${PROJECT_BINARY_DIR}/dmmlib/config.h"
|