Double-quote the `uname...` expression.
[gnulib.git] / m4 / lfs.m4
1 #serial 2
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" in
32   no)
33     case "`(uname -s -r) 2>/dev/null`" in
34     HP-UX' '?.10.[[2-9]][[0-9]]* | HP-UX' '?.1[[1-9]]* | HP-UX' '?.[[2-9]][[0-9]]*)
35       # HP-UX 10.20 and later support large files,
36       # but do not support `getconf LFS_CFLAGS'.
37       ac_test_CPPFLAGS='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
38       ac_test_LDFLAGS=
39       ac_test_LIBS=
40       ac_getconfs=nonempty
41       ac_result=yes ;;
42     esac ;;
43   esac
44   case "$ac_result$ac_getconfs" in
45     yes) ac_result=no ;;
46   esac
47   case "$ac_result$ac_set" in
48     yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
49   esac
50   AC_MSG_RESULT($ac_result)
51   case $ac_result in
52     yes)
53       for ac_shellvar in $ac_shellvars; do
54         eval $ac_shellvar=\$ac_test_$ac_shellvar
55       done ;;
56   esac
57 ])