1 dnl -------------------------------------------------------------------
2 dnl This test for largefile support was written by Vadim Zeitlin for
4 dnl -------------------------------------------------------------------
6 dnl WX_SYS_LARGEFILE_TEST
8 dnl NB: original autoconf test was checking if compiler supported 6 bit off_t
9 dnl arithmetic properly but this failed miserably with gcc under Linux
10 dnl whereas the system still supports 64 bit files, so now simply check
11 dnl that off_t is big enough
12 define(WX_SYS_LARGEFILE_TEST,
14 unsigned int field: sizeof(off_t) == 8;
18 dnl WX_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR)
19 define(WX_SYS_LARGEFILE_MACRO_VALUE,
21 AC_CACHE_CHECK([for $1 value needed for large files], [$3],
23 AC_TRY_COMPILE([#define $1 $2
24 #include <sys/types.h>],
25 WX_SYS_LARGEFILE_TEST,
31 if test "$$3" != no; then
33 AC_DEFINE_UNQUOTED([$1], [$$3])
39 dnl By default, many hosts won't let programs access large files;
40 dnl one must use special compiler options to get large-file access to work.
41 dnl For more details about this brain damage please see:
42 dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
43 AC_DEFUN([AC_SYS_LARGEFILE],
44 [AC_ARG_ENABLE(largefile,
45 [ --disable-largefile omit support for large files])
46 if test "$enable_largefile" != no; then
47 dnl _FILE_OFFSET_BITS==64 is needed for Linux, Solaris, ...
48 dnl _LARGE_FILES -- for AIX
50 WX_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, ac_cv_sys_file_offset_bits)
51 if test "x$wx_largefile" != "xyes"; then
52 WX_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, ac_cv_sys_large_files)
55 AC_MSG_CHECKING(if large file support is available)
56 if test "x$wx_largefile" = "xyes"; then
57 AC_DEFINE(HAVE_LARGEFILE_SUPPORT)
59 AC_MSG_RESULT($wx_largefile)
63 dnl ----------end of largefile test------------------------------------