.
[gnulib.git] / m4 / lfs.m4
1 #serial 1
2
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
8
9 dnl Written by Paul Eggert <eggert@twinsun.com>.
10
11 AC_DEFUN(AC_LFS,
12 [dnl
13   # If available, prefer support for large files unless the user specified
14   # one of the CPPFLAGS, LDFLAGS, or LIBS variables.
15   AC_MSG_CHECKING(whether large file support needs explicit enabling)
16   ac_getconfs=''
17   ac_result=yes
18   ac_set=''
19   ac_shellvars='CPPFLAGS LDFLAGS LIBS'
20   for ac_shellvar in $ac_shellvars; do
21     case $ac_shellvar in
22       CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
23       *) ac_lfsvar=LFS_$ac_shellvar ;;
24     esac
25     eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
26     (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
27     ac_getconf=`getconf $ac_lfsvar`
28     ac_getconfs=$ac_getconfs$ac_getconf
29     eval ac_test_$ac_shellvar=\$ac_getconf
30   done
31   case "$ac_result$ac_getconfs" in
32     yes) ac_result=no ;;
33   esac
34   case "$ac_result$ac_set" in
35     yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
36   esac
37   AC_MSG_RESULT($ac_result)
38   case $ac_result in
39     yes)
40       for ac_shellvar in $ac_shellvars; do
41         eval $ac_shellvar=\$ac_test_$ac_shellvar
42       done ;;
43   esac
44 ])