Changeset: c2326f283a6b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c2326f283a6b
Removed Files:
cmake/TestWindowsFSeek.c
Modified Files:
CMakeLists.txt
cmake/TestLargeFiles.c.cmake.in
cmake/TestLargeFiles.cmake
geom/monetdb5/CMakeLists.txt
monetdb_config.h.in
sql/backends/monet5/vaults/shp/CMakeLists.txt
Branch: cmake-fun
Log Message:
Fixed 64 bit filesystem support checks.
diffs (143 lines):
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -189,6 +189,7 @@ endif()
opj_test_large_files(_LARGE_FILES)
opj_test_large_files(_LARGEFILE_SOURCE)
opj_test_large_files(_FILE_OFFSET_BITS)
+opj_test_large_files(_DARWIN_USE_64_BIT_INODE)
#Test if struct tm has tm_zone field
check_struct_has_member("struct tm" tm_zone "time.h" HAVE_STRUCT_TM_TM_ZONE
LANGUAGE C)
#Test CPU endianness
@@ -499,7 +500,6 @@ check_symbol_exists("fallocate" "fcntl.h
check_symbol_exists("fcntl" "unistd.h;fcntl.h" HAVE_FCNTL)
check_symbol_exists("fdatasync" "unistd.h" HAVE_FDATASYNC)
check_symbol_exists("fork" "sys/types.h;unistd.h" HAVE_FORK)
-check_symbol_exists("fseeko" "stdio.h" HAVE_FSEEKO)
check_symbol_exists("fsync" "unistd.h" HAVE_FSYNC)
check_symbol_exists("ftime" "sys/timeb.h" HAVE_FTIME)
check_symbol_exists("getopt" "unistd.h" HAVE_GETOPT)
diff --git a/cmake/TestLargeFiles.c.cmake.in b/cmake/TestLargeFiles.c.cmake.in
--- a/cmake/TestLargeFiles.c.cmake.in
+++ b/cmake/TestLargeFiles.c.cmake.in
@@ -2,6 +2,7 @@
#cmakedefine _LARGEFILE_SOURCE
#cmakedefine _LARGE_FILES
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
+#cmakedefine _DARWIN_USE_64_BIT_INODE
#include <sys/types.h>
#include <stdio.h>
diff --git a/cmake/TestLargeFiles.cmake b/cmake/TestLargeFiles.cmake
--- a/cmake/TestLargeFiles.cmake
+++ b/cmake/TestLargeFiles.cmake
@@ -8,14 +8,14 @@
# _LARGE_FILES
# _LARGEFILE_SOURCE
# _FILE_OFFSET_BITS 64
+# _DARWIN_USE_64_BIT_INODE
# OPJ_HAVE_FSEEKO
#
# However, it is YOUR job to make sure these defines are set in a
#cmakedefine so they
# end up in a config.h file that is included in your source if necessary!
#
# Adapted from Gromacs project (http://www.gromacs.org/)
-# by Julien Malik
-#
+# by Julien Malik adn Pedro Ferreira
macro(OPJ_TEST_LARGE_FILES VARIABLE)
if(NOT DEFINED ${VARIABLE})
@@ -66,16 +66,16 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
endif()
endif()
-
- #if(NOT FILE64_OK)
- # # now check for Windows stuff
- # try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
- #
"${PROJECT_SOURCE_DIR}/cmake/TestWindowsFSeek.c")
- # if(FILE64_OK)
- # message(STATUS "Checking for 64-bit off_t - present
with _fseeki64")
- # set(HAVE__FSEEKI64 1)
- # endif()
- #endif()
+ if(NOT FILE64_OK AND APPLE)
+ # Test with _DARWIN_USE_64_BIT_INODE
+ try_compile(FILE64_OK "${PROJECT_BINARY_DIR}"
+
"${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
+ COMPILE_DEFINITIONS
"-D_DARWIN_USE_64_BIT_INODE" )
+ if(FILE64_OK)
+ message(STATUS "Checking for 64-bit off_t -
present with _DARWIN_USE_64_BIT_INODE")
+ set(_DARWIN_USE_64_BIT_INODE 1)
+ endif()
+ endif()
if(NOT FILE64_OK)
message(STATUS "Checking for 64-bit off_t - not
present")
@@ -84,6 +84,7 @@ macro(OPJ_TEST_LARGE_FILES VARIABLE)
set(_FILE_OFFSET_BITS ${_FILE_OFFSET_BITS} CACHE INTERNAL
"Result of test for needed _FILE_OFFSET_BITS=64")
set(_LARGE_FILES ${_LARGE_FILES} CACHE INTERNAL
"Result of test for needed _LARGE_FILES")
set(_LARGEFILE_SOURCE ${_LARGEFILE_SOURCE} CACHE INTERNAL
"Result of test for needed _LARGEFILE_SOURCE")
+ set(_DARWIN_USE_64_BIT_INODE ${_DARWIN_USE_64_BIT_INODE} CACHE
INTERNAL "Result of test for needed _DARWIN_USE_64_BIT_INODE")
# Set the flags we might have determined to be required above
configure_file("${PROJECT_SOURCE_DIR}/cmake/TestLargeFiles.c.cmake.in"
diff --git a/cmake/TestWindowsFSeek.c b/cmake/TestWindowsFSeek.c
deleted file mode 100644
--- a/cmake/TestWindowsFSeek.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// From
https://github.com/Framstag/libosmscout/pull/251/files#diff-40f8e3cdfc36152528d5235258332447
-#include <stdio.h>
-
-int main()
-{
- __int64 off=0;
-
- _fseeki64(NULL, off, SEEK_SET);
-
- return 0;
-}
diff --git a/geom/monetdb5/CMakeLists.txt b/geom/monetdb5/CMakeLists.txt
--- a/geom/monetdb5/CMakeLists.txt
+++ b/geom/monetdb5/CMakeLists.txt
@@ -25,7 +25,7 @@ if(NOT ${ENABLE_GEOM} STREQUAL "NO")
endif()
endif()
if(HAVE_GEOM)
- include_directories(../lib ../../gdk ../../common/stream
../../common/utils ../../monetdb5/mal ${GEOS_INCLUDE_DIR}
+ include_directories(../../gdk ../../common/stream ../../common/utils
../../monetdb5/mal ${GEOS_INCLUDE_DIR}
${PROJ_INCLUDE_DIR})
set(GEOM_LINK_LIBRARIES ${GEOS_LIBRARIES} ${PROJ_LIBRARIES})
diff --git a/monetdb_config.h.in b/monetdb_config.h.in
--- a/monetdb_config.h.in
+++ b/monetdb_config.h.in
@@ -417,12 +417,12 @@
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
-#define _DARWIN_USE_64_BIT_INODE
+#cmakedefine _DARWIN_USE_64_BIT_INODE
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#ifndef _FILE_OFFSET_BITS
-#cmakedefine _FILE_OFFSET_BITS
+#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
#endif
/* Define to make fseeko visible on some hosts (e.g. glibc 2.2). */
diff --git a/sql/backends/monet5/vaults/shp/CMakeLists.txt
b/sql/backends/monet5/vaults/shp/CMakeLists.txt
--- a/sql/backends/monet5/vaults/shp/CMakeLists.txt
+++ b/sql/backends/monet5/vaults/shp/CMakeLists.txt
@@ -24,7 +24,7 @@ if(HAVE_SHP)
../../../../../monetdb5/modules/atoms ../../../../../monetdb5/modules/kernel
../../../../../monetdb5/mal
../../../../../monetdb5/modules/mal ../../../../../monetdb5/optimizer
../../../../../monetdb5/scheduler ../../../../../common/stream
../../../../../common/utils
- ../../../../../gdk
../../../../../geom/lib ../../../../../geom/monetdb5 ${GDAL_INCLUDE_DIR})
+ ../../../../../gdk
../../../../../geom/monetdb5 ${GDAL_INCLUDE_DIR})
set(SHP_LINK_LIBRARIES ${GDAL_LIBRARIES})
if(WIN32)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list