diff options
author | Dirk Mueller <mueller@kde.org> | 2008-07-07 12:37:43 +0000 |
---|---|---|
committer | Dirk Mueller <mueller@kde.org> | 2008-07-07 12:37:43 +0000 |
commit | eb8b7009c84d207c26d78b7b8a66502466ae97d1 (patch) | |
tree | 387175a7bfad392bfe10ec6b1d39318d523fe393 /modules | |
parent | 7bc93dbb8a217688ba6e9379f957cd895aca5932 (diff) | |
download | extra-cmake-modules-eb8b7009c84d207c26d78b7b8a66502466ae97d1.tar.gz extra-cmake-modules-eb8b7009c84d207c26d78b7b8a66502466ae97d1.tar.bz2 |
add a configure check and add -D_FILE_OFFSET_BITS=64 if needed
svn path=/trunk/KDE/kdelibs/; revision=829068
Diffstat (limited to 'modules')
-rw-r--r-- | modules/FindKDE4Internal.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index 9d9f22cb..230ca1d5 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -873,6 +873,25 @@ if (CMAKE_SYSTEM_NAME MATCHES Linux) endif (CMAKE_C_COMPILER MATCHES "icc") endif (CMAKE_SYSTEM_NAME MATCHES Linux) +if (UNIX) + set ( _KDE4_PLATFORM_DEFINITIONS "${_KDE4_PLATFORM_DEFINITIONS} -D_LARGEFILE64_SOURCE") + + check_cxx_source_compiles(" +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; +" + _OFFT_IS_64BIT) + + if (not ${_OFFT_IS_64BIT}) + set ( _KDE4_PLATFORM_DEFINITIONS "${_KDE4_PLATFORM_DEFINITIONS} -D_FILE_OFFSET_BITS=64") + endif (not ${_OFFT_IS_64BIT}) +endif (UNIX) if (CMAKE_SYSTEM_NAME MATCHES BSD) set ( _KDE4_PLATFORM_DEFINITIONS -D_GNU_SOURCE ) |