summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-08-25 20:07:06 (GMT)
committerBrad King <brad.king@kitware.com>2006-08-25 20:07:06 (GMT)
commitebf532b106fed4bb4c2993be43e3ec2a42573f6b (patch)
tree0a71d243169871464f8eb811482b6a53512f2235 /Source/kwsys
parentffb1a9f80ad4e604c11c24a2f8769e93ba035ab3 (diff)
downloadCMake-ebf532b106fed4bb4c2993be43e3ec2a42573f6b.zip
CMake-ebf532b106fed4bb4c2993be43e3ec2a42573f6b.tar.gz
CMake-ebf532b106fed4bb4c2993be43e3ec2a42573f6b.tar.bz2
ENH: Separate the notion of a request for LFS and its availability. Allow user code to block definitions of LFS macros. Added framework to give error if sys/types.h is included before this header when LFS is requested (currently disabled).
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/Configure.h.in44
1 files changed, 35 insertions, 9 deletions
diff --git a/Source/kwsys/Configure.h.in b/Source/kwsys/Configure.h.in
index ba4b99c..1afd416 100644
--- a/Source/kwsys/Configure.h.in
+++ b/Source/kwsys/Configure.h.in
@@ -22,18 +22,44 @@
# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
#endif
-/* 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_LFS_AVAILABLE@
-# ifndef _LARGEFILE_SOURCE
-# define _LARGEFILE_SOURCE
+/* Whether Large File Support is requested. */
+#define @KWSYS_NAMESPACE@_LFS_REQUESTED @KWSYS_LFS_REQUESTED@
+
+/* Whether Large File Support is available. */
+#if @KWSYS_NAMESPACE@_LFS_REQUESTED
+# define @KWSYS_NAMESPACE@_LFS_AVAILABLE @KWSYS_LFS_AVAILABLE@
+#endif
+
+/* Setup Large File Support if requested. */
+#if @KWSYS_NAMESPACE@_LFS_REQUESTED
+ /* Since LFS is requested this header must be included before system
+ headers whether or not LFS is available. */
+# if 0 && (defined(_SYS_TYPES_H) || defined(_SYS_TYPES_INCLUDED))
+# error "@KWSYS_NAMESPACE@/Configure.h must be included before sys/types.h"
+# endif
+ /* Enable the large file API if it is available. */
+# if @KWSYS_NAMESPACE@_LFS_AVAILABLE && \
+ !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINES)
+# if !defined(_LARGEFILE_SOURCE) && \
+ !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGEFILE_SOURCE)
+# define _LARGEFILE_SOURCE
# endif
-# ifndef _LARGE_FILES
-# define _LARGE_FILES
+# if !defined(_LARGEFILE64_SOURCE) && \
+ !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGEFILE64_SOURCE)
+# define _LARGEFILE64_SOURCE
# endif
-# ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
+# if !defined(_LARGE_FILES) && \
+ !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_LARGE_FILES)
+# define _LARGE_FILES
# endif
+# if !defined(_FILE_OFFSET_BITS) && \
+ !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_FILE_OFFSET_BITS)
+# define _FILE_OFFSET_BITS 64
+# endif
+# if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS < 64
+# error "_FILE_OFFSET_BITS must be defined to at least 64"
+# endif
+# endif
#endif
/* Setup the export macro. */