@ -1927,6 +1927,92 @@ macro( tde_setup_msgfmt )
endmacro ( )
endmacro ( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # # t d e _ s e t u p _ l a r g e f i l e s
macro ( tde_setup_largefiles )
if ( NOT DEFINED HAVE_LARGEFILES )
message ( STATUS "Check support for large files" )
unset ( LARGEFILES_DEFINITIONS )
# c h e c k w i t h o u t s p e c i a l d e f i n i t i o n s
unset ( HAVE_SIZEOF_T CACHE )
check_type_size ( off_t SIZEOF_OFF_T )
if ( SIZEOF_OFF_T GREATER 7 )
set ( HAVE_LARGEFILES 1 )
endif ( )
# c h e c k w i t h d e f i n i t i o n _ F I L E _ O F F S E T _ B I T S = 6 4
if ( NOT HAVE_LARGEFILES )
unset ( HAVE_SIZEOF_OFF_T CACHE )
tde_save_and_set ( CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_FILE_OFFSET_BITS=64" )
check_type_size ( off_t SIZEOF_OFF_T )
tde_restore ( CMAKE_REQUIRED_DEFINITIONS )
if ( SIZEOF_OFF_T GREATER 7 )
set ( LARGEFILES_DEFINITIONS "-D_FILE_OFFSET_BITS=64" )
set ( HAVE_LARGEFILES 1 )
endif ( )
endif ( )
# c h e c k w i t h d e f i n i t i o n _ L A R G E _ F I L E S
if ( NOT HAVE_LARGEFILES )
unset ( HAVE_SIZEOF_OFF_T CACHE )
tde_save_and_set ( CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_LARGE_FILES" )
check_type_size ( off_t SIZEOF_OFF_T )
tde_restore ( CMAKE_REQUIRED_DEFINITIONS )
if ( SIZEOF_OFF_T GREATER 7 )
set ( LARGEFILES_DEFINITIONS "-D_LARGE_FILES" )
set ( HAVE_LARGEFILES 1 )
endif ( )
endif ( )
# c h e c k w i t h d e f i n i t i o n _ L A R G E F I L E _ S O U R C E
if ( NOT HAVE_LARGEFILES )
unset ( HAVE_SIZEOF_OFF_T CACHE )
tde_save_and_set ( CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_LARGEFILE_SOURCE" )
check_type_size ( off_t SIZEOF_OFF_T )
tde_restore ( CMAKE_REQUIRED_DEFINITIONS )
if ( SIZEOF_OFF_T GREATER 7 )
set ( LARGEFILES_DEFINITIONS "-D_LARGEFILE_SOURCE" )
set ( HAVE_LARGEFILES 1 )
endif ( )
endif ( )
# c h e c k f o r f s e e k o / f t e l l o
if ( HAVE_LARGEFILES )
tde_save_and_set ( CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${LARGEFILES_DEFINITIONS}" )
check_symbol_exists ( "fseeko" "stdio.h" HAVE_FSEEKO )
tde_restore ( CMAKE_REQUIRED_DEFINITIONS )
if ( NOT HAVE_FSEEKO )
tde_save_and_set ( CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${LARGEFILES_DEFINITIONS} -D_LARGEFILE_SOURCE" )
check_symbol_exists ( "fseeko" "stdio.h" HAVE_FSEEKO )
tde_restore ( CMAKE_REQUIRED_DEFINITIONS )
if ( HAVE_FSEEKO )
set ( LARGEFILES_DEFINITIONS "${LARGEFILES_DEFINITIONS} -D_LARGEFILE_SOURCE" )
else ( )
unset ( HAVE_LARGEFILES )
endif ( )
endif ( )
endif ( )
# c h e c k r e s u l t s
if ( HAVE_LARGEFILES )
if ( "${LARGEFILES_DEFINITIONS}" STREQUAL "" )
message ( STATUS "Check support for large files - Success" )
else ( )
add_definitions ( ${ LARGEFILES_DEFINITIONS } )
message ( STATUS "Check support for large files - Success with ${LARGEFILES_DEFINITIONS}" )
endif ( )
set ( HAVE_LARGEFILES 1 CACHE INTERNAL "Support for large files enabled" )
else ( )
message ( STATUS "Check support for large files - Failed" )
tde_message_fatal ( "Cannot find a way to enable support for large files." )
endif ( )
endif ( )
endmacro ( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # #
# # # # # R e s t o r e C M P 0 0 2 6 p o l i c y
# # # # # R e s t o r e C M P 0 0 2 6 p o l i c y