Imported Upstream version 3.1.0
[debian/amanda] / config / amanda / lfs.m4
1 # SYNOPSIS
2 #
3 #   AMANDA_SETUP_LFS
4 #
5 # OVERVIEW
6 #
7 #   Set up for large file suport on this system.  Besides adding compiler flags,
8 #   defines NEED_RESETOFS if the tape device's offset must be reset before it reaches
9 #   2GB (a Linux kernel bug in systems without LFS support).
10 #
11 AC_DEFUN([AMANDA_SETUP_LFS],
12 [
13     AC_REQUIRE([AMANDA_PROG_GETCONF])
14     AC_REQUIRE([AC_SYS_LARGEFILE])
15
16     # we use 'getconf', if it exists, to get the relevant
17     # compiler flags.
18     GETCONF_LFS="LFS"
19     case "$host" in
20         *-hp-*) GETCONF_LFS="XBS5_ILP32_OFFBIG" ;;
21         *-ibm-aix*) GETCONF_LFS="XBS5_ILP32_OFFBIG" ;;
22     esac
23
24     # Checks for compilers, typedefs, structures, and compiler characteristics.
25     # Check for large file compilation environment.
26     NEED_RESETOFS=yes
27     AC_CACHE_CHECK([for large file compilation CFLAGS],
28         amanda_cv_LFS_CFLAGS,
29         [
30         amanda_cv_LFS_CFLAGS=
31         if test "$GETCONF"; then
32             if $GETCONF ${GETCONF_LFS}_CFLAGS >/dev/null 2>&1; then
33                 amanda_cv_LFS_CFLAGS=`$GETCONF ${GETCONF_LFS}_CFLAGS 2>/dev/null`
34                 NEED_RESETOFS=no
35             fi
36         fi
37         ]
38     )
39     AMANDA_ADD_CFLAGS([$amanda_cv_LFS_CFLAGS])
40
41     AC_CACHE_CHECK(
42         [for large file compilation LDFLAGS],
43         amanda_cv_LFS_LDFLAGS,
44         [
45         amanda_cv_LFS_LDFLAGS=
46         if test "$GETCONF"; then
47             if $GETCONF ${GETCONF_LFS}_LDFLAGS >/dev/null 2>&1; then
48                 amanda_cv_LFS_LDFLAGS=`$GETCONF ${GETCONF_LFS}_LDFLAGS 2>/dev/null`
49                 NEED_RESETOFS=no
50             fi
51         fi
52         ]
53     )
54     AMANDA_ADD_LDFLAGS([$amanda_cv_LFS_LDFLAGS])
55
56     AC_CACHE_CHECK(
57         [for large file compilation LIBS],
58         amanda_cv_LFS_LIBS,
59         [
60         amanda_cv_LFS_LIBS=
61         if test "$GETCONF"; then
62             if $GETCONF ${GETCONF_LFS}_LIBS >/dev/null 2>&1; then
63                 amanda_cv_LFS_LIBS=`$GETCONF ${GETCONF_LFS}_LIBS 2>/dev/null`
64                 NEED_RESETOFS=no
65             fi
66         fi
67         ]
68     )
69     AMANDA_ADD_LIBS([$amanda_cv_LFS_LIBS])
70
71     if test x"$NEED_RESETOFS" = x"yes"; then
72         AC_DEFINE(NEED_RESETOFS,1,
73             [Define if we have to reset tape offsets when reaching 2GB. ])
74     fi
75 ])