3 dnl The problem is that the default compilation flags in Solaris 2.6 won't
4 dnl let programs access large files; you need to tell the compiler that
5 dnl you actually want your programs to work on large files. For more
6 dnl details about this brain damage please see:
7 dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
9 dnl Written by Paul Eggert <eggert@twinsun.com>.
11 dnl Internal subroutine of AC_LFS.
12 dnl AC_LFS_FLAGS(FLAGSNAME)
13 AC_DEFUN(AC_LFS_FLAGS,
14 [AC_CACHE_CHECK([for $1 value to request large file support], ac_cv_lfs_$1,
15 [ac_cv_lfs_$1=`($GETCONF LFS_$1) 2>/dev/null` || {
20 irix6.[[2-9]]* | irix6.1[[0-9]]* | irix[[7-9]].* | irix[[1-9]][[0-9]]*)
21 if test "$GCC" != yes; then
25 CC="$ac_save_CC $ac_cv_lfs_CFLAGS"
26 AC_TRY_LINK(, , , ac_cv_lfs_CFLAGS=no)
31 dnl Internal subroutine of AC_LFS.
32 dnl AC_LFS_SPACE_APPEND(VAR, VAL)
33 AC_DEFUN(AC_LFS_SPACE_APPEND,
43 dnl Internal subroutine of AC_LFS.
44 dnl AC_LFS_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
45 AC_DEFUN(AC_LFS_MACRO_VALUE,
46 [AC_CACHE_CHECK([for $1], $2,
49 for ac_flag in $ac_cv_lfs_CFLAGS no; do
54 $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
57 if test "[$]$2" != no; then
58 AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
62 [AC_REQUIRE([AC_CANONICAL_HOST])
64 [ --disable-lfs omit Large File Support])
65 if test "$enable_lfs" != no; then
66 AC_CHECK_TOOL(GETCONF, getconf)
70 for ac_flag in $ac_cv_lfs_CFLAGS no; do
73 -D_FILE_OFFSET_BITS=*) ;;
74 -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
75 -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
77 AC_LFS_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
79 AC_LFS_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
82 AC_LFS_SPACE_APPEND(LDFLAGS, "$ac_cv_lfs_LDFLAGS")
83 AC_LFS_SPACE_APPEND(LIBS, "$ac_cv_lfs_LIBS")
84 AC_LFS_MACRO_VALUE(_FILE_OFFSET_BITS, ac_cv_file_offset_bits,
85 [Number of bits in a file offset, on hosts where this is settable. ],
87 # HP-UX 10.20 and later
88 hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
89 ac_cv_file_offset_bits=64 ;;
91 AC_LFS_MACRO_VALUE(_LARGEFILE_SOURCE, ac_cv_largefile_source,
92 [Define to make fseeko etc. visible, on some hosts. ],
94 # HP-UX 10.20 and later
95 hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
96 ac_cv_largefile_source=1 ;;
98 AC_LFS_MACRO_VALUE(_LARGE_FILES, ac_cv_large_files,
99 [Define for large files, on AIX-style hosts. ],
102 aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
103 ac_cv_large_files=1 ;;