Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sylvain Joubert
KWSys
Commits
3101aca1
Commit
3101aca1
authored
18 years ago
by
Brad King
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Moved test for large file support into kwsysPlatformCxxTests.cxx with name KWSYS_LFS_WORKS.
parent
1b4dc3aa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+23
-17
23 additions, 17 deletions
CMakeLists.txt
Configure.h.in
+1
-1
1 addition, 1 deletion
Configure.h.in
RequireLargeFilesSupport.cxx
+0
-28
0 additions, 28 deletions
RequireLargeFilesSupport.cxx
kwsysPlatformCxxTests.cxx
+32
-0
32 additions, 0 deletions
kwsysPlatformCxxTests.cxx
with
56 additions
and
46 deletions
CMakeLists.txt
+
23
−
17
View file @
3101aca1
...
...
@@ -142,6 +142,9 @@ IF(KWSYS_STANDALONE)
ENDIF
(
BUILD_TESTING
)
ENDIF
(
KWSYS_STANDALONE
)
# Include helper macros.
INCLUDE
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/kwsysPlatformCxxTests.cmake
)
# Do full dependency headers.
INCLUDE_REGULAR_EXPRESSION
(
"^.*$"
)
...
...
@@ -241,22 +244,6 @@ IF(NOT KWSYS_IN_SOURCE_BUILD)
${
PROJECT_BINARY_DIR
}
/kwsysPrivate.h COPY_ONLY IMMEDIATE
)
ENDIF
(
NOT KWSYS_IN_SOURCE_BUILD
)
SET
(
KWSYS_REQUIRE_LARGE_FILE_SUPPORT 0
)
IF
(
"
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
"
LESS 2.4
)
MESSAGE
(
STATUS
"Skip large files support because CMake is earlier than 2.4"
)
ELSE
(
"
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
"
LESS 2.4
)
INCLUDE
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/CheckCXXSourceRuns.cmake
)
FILE
(
READ
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/RequireLargeFilesSupport.cxx"
__kwsys_require_large_files_support
)
CHECK_CXX_SOURCE_RUNS
(
"
${
__kwsys_require_large_files_support
}
"
REQUIRE_LARGE_FILE_SUPPORT
"Support for 64 bit file systems"
)
IF
(
REQUIRE_LARGE_FILE_SUPPORT
)
SET
(
KWSYS_REQUIRE_LARGE_FILE_SUPPORT 1
)
ENDIF
(
REQUIRE_LARGE_FILE_SUPPORT
)
ENDIF
(
"
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
"
LESS 2.4
)
#-----------------------------------------------------------------------------
# We require ANSI support from the C compiler. Add any needed flags.
IF
(
CMAKE_ANSI_CFLAGS
)
...
...
@@ -280,11 +267,30 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF
(
CMAKE_SYSTEM MATCHES
"OSF1-V.*"
)
ENDIF
(
NOT CMAKE_COMPILER_IS_GNUCXX
)
#-----------------------------------------------------------------------------
# Configure Large File Support.
SET
(
KWSYS_LFS_REQUESTED 1
)
SET
(
KWSYS_LFS_AVAILABLE 0
)
IF
(
KWSYS_LFS_REQUESTED
)
# Large File Support is requested.
SET
(
KWSYS_LFS_REQUESTED 1
)
# Check for large file support.
KWSYS_PLATFORM_CXX_TEST_RUN
(
KWSYS_LFS_WORKS
"Checking for Large File Support"
DIRECT
)
IF
(
KWSYS_LFS_WORKS
)
SET
(
KWSYS_LFS_AVAILABLE 1
)
ENDIF
(
KWSYS_LFS_WORKS
)
ELSE
(
KWSYS_LFS_REQUESTED
)
# Large File Support is not requested.
SET
(
KWSYS_LFS_REQUESTED 0
)
ENDIF
(
KWSYS_LFS_REQUESTED
)
#-----------------------------------------------------------------------------
# Configure the standard library header wrappers based on compiler's
# capabilities and parent project's request. Enforce 0/1 as only
# possible values for configuration into Configure.hxx.
INCLUDE
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/kwsysPlatformCxxTests.cmake
)
KWSYS_PLATFORM_CXX_TEST
(
KWSYS_STL_HAVE_STD
"Checking whether STL classes are in std namespace"
DIRECT
)
...
...
This diff is collapsed.
Click to expand it.
Configure.h.in
+
1
−
1
View file @
3101aca1
...
...
@@ -24,7 +24,7 @@
/* This is a support for files on the disk that are larger than 2GB. Since
this is the first place that any include should happen, do this here. */
#if @KWSYS_
REQUIRE_LARGE_FILE_SUPPORT
@
#if @KWSYS_
LFS_AVAILABLE
@
# ifndef _LARGEFILE_SOURCE
# define _LARGEFILE_SOURCE
# endif
...
...
This diff is collapsed.
Click to expand it.
RequireLargeFilesSupport.cxx
deleted
100644 → 0
+
0
−
28
View file @
1b4dc3aa
#define _LARGEFILE_SOURCE
#define _LARGE_FILES
#define _FILE_OFFSET_BITS 64
#include
<sys/types.h>
#include
<sys/stat.h>
#include
<assert.h>
#include
<stdio.h>
int
main
(
int
,
char
**
argv
)
{
// check that off_t can hold 2^63 - 1 and perform basic operations...
#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
if
(
OFF_T_64
%
2147483647
!=
1
)
return
1
;
// stat breaks on SCO OpenServer
struct
stat
buf
;
stat
(
argv
[
0
],
&
buf
);
if
(
!
S_ISREG
(
buf
.
st_mode
))
return
2
;
FILE
*
file
=
fopen
(
argv
[
0
],
"r"
);
off_t
offset
=
ftello
(
file
);
fseek
(
file
,
offset
,
SEEK_CUR
);
fclose
(
file
);
return
0
;
}
This diff is collapsed.
Click to expand it.
kwsysPlatformCxxTests.cxx
+
32
−
0
View file @
3101aca1
...
...
@@ -275,6 +275,38 @@ int main()
}
#endif
#ifdef TEST_KWSYS_LFS_WORKS
/* Return 0 when LFS is available and 1 otherwise. */
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _LARGE_FILES
#define _FILE_OFFSET_BITS 64
#include
<sys/types.h>
#include
<sys/stat.h>
#include
<assert.h>
#include
<stdio.h>
int
main
(
int
,
char
**
argv
)
{
/* check that off_t can hold 2^63 - 1 and perform basic operations... */
#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
if
(
OFF_T_64
%
2147483647
!=
1
)
return
1
;
// stat breaks on SCO OpenServer
struct
stat
buf
;
stat
(
argv
[
0
],
&
buf
);
if
(
!
S_ISREG
(
buf
.
st_mode
))
return
2
;
FILE
*
file
=
fopen
(
argv
[
0
],
"r"
);
off_t
offset
=
ftello
(
file
);
fseek
(
file
,
offset
,
SEEK_CUR
);
fclose
(
file
);
return
0
;
}
#endif
#ifdef TEST_KWSYS_CXX_TYPE_INFO
/* Collect fundamental type information and save it to a CMake script. */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment