1 AC_DEFUN([MOONLIGHT_CHECK_LARGE_FILE],
4 AC_CACHE_CHECK([whether _LARGEFILE64_SOURCE needs to be defined for large files], moon_cv_largefile64_source, [
10 int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
12 moon_cv_largefile64_source="no"
15 #define _LARGEFILE64_SOURCE 1
16 #include <sys/types.h>
20 int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
22 moon_cv_largefile64_source="yes"
24 moon_cv_largefile64_source="unknown (large files may not be supported)"
29 if test "x$largefile64_source" = "xyes"; then
30 LARGEFILE_CFLAGS="-D_LARGEFILE64_SOURCE=1"
31 elif test "x$largefile64_source" = "xundefined"; then
32 AC_DEFINE(O_LARGEFILE, 0, [Define to 0 if your system does not have the O_LARGEFILE flag])
35 if test -n "$ac_cv_sys_large_files" -a "x$ac_cv_sys_large_files" != "xno"; then
36 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_LARGE_FILES=1"
39 if test "x$ac_cv_sys_file_offset_bits" != "xno"; then
40 LARGEFILE_CFLAGS="$LARGEFILE_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"