3 # AMANDA_WITH_MAXTAPEBLOCKSIZE
7 # Implement the --with-maxtapeblocksize option, and DEFINE and SUBST the
8 # result in MAX_TAPE_BLOCk_KB and MAXTAPEBLOCKSIZE, respectively.
10 AC_DEFUN([AMANDA_WITH_MAXTAPEBLOCKSIZE], [
11 AC_ARG_WITH(maxtapeblocksize,
12 AS_HELP_STRING([--with-maxtapeblocksize=kb],
13 [Maximum size of a tape block (default: 32)]),
14 [ MAXTAPEBLOCKSIZE="$withval" ],
15 [ MAXTAPEBLOCKSIZE=32 ]
18 AC_DEFINE_UNQUOTED(MAX_TAPE_BLOCK_KB,($MAXTAPEBLOCKSIZE),
19 [Maximum size of a tape block in KBytes.])
20 AC_SUBST(MAXTAPEBLOCKSIZE)
29 # Set up for the 'tape' device. One of the conditionals WANT_TAPE_XENIX,
30 # WANT_TAPE_AIX, WANT_TAPE_UWARE, and WANT_TAPE_POSIX will be true; the
31 # corresponding symbols are also DEFINEd. Finally, WANT_TAPE_DEVICE is
32 # defined nad AM_CONDITIONAL'd if the tape device should be supported (if
33 # at least one of the backends is available).
35 # If 'struct mtget' fields mt_flags, mt_fileno, mt_blkno, mt_dsreg, and
36 # mt_erreg, the corresponding HAVE_MT_* is DEFINEd.
38 # Not that most of the checks in this section correspond to the older
39 # tapeio (in tape-src/), rather than the new tape device.
41 AC_DEFUN([AMANDA_TAPE_DEVICE], [
48 # check for MTIOCTOP, an indicator of POSIX tape support
49 AC_CACHE_CHECK([for MTIOCTOP], amanda_cv_HAVE_MTIOCTOP,[
51 #ifdef HAVE_SYS_TAPE_H
52 # include <sys/tape.h>
54 #ifdef HAVE_SYS_MTIO_H
55 # include <sys/mtio.h>
58 #error MTIOCTOP not defined
62 amanda_cv_HAVE_MTIOCTOP=yes,
63 amanda_cv_HAVE_MTIOCTOP=no,
64 amanda_cv_HAVE_MTIOCTOP=no)]
66 HAVE_MTIOCTOP=$amanda_cv_HAVE_MTIOCTOP
69 # decide which tape device to compile (arranged in such a way that
70 # only one actually gets compiled)
72 *-ibm-aix*) aix_tapeio=yes ;;
73 *-sysv4.2uw2*) uware_tapeio=yes ;;
74 *-sco3.2v5*) xenix_tapeio=yes ;;
75 i386-pc-isc4*) xenix_tapeio=yes ;;
78 # maybe we have no tape device at all (e.g., Mac OS X)?
79 if test -n "$xenix_tapeio" ||
80 test -n "$aix_tapeio" ||
81 test -n "$uware_tapeio" ||
82 test -n "$HAVE_MTIOCTOP"; then
84 AC_DEFINE(WANT_TAPE_DEVICE, 1, [Define if the tape-device will be built])
87 AM_CONDITIONAL(WANT_TAPE_XENIX, test -n "$xenix_tapeio")
88 AM_CONDITIONAL(WANT_TAPE_AIX, test -n "$aix_tapeio")
89 AM_CONDITIONAL(WANT_TAPE_UWARE, test -n "$uware_tapeio")
90 AM_CONDITIONAL(WANT_TAPE_POSIX, test -n "$HAVE_MTIOCTOP")
91 AM_CONDITIONAL(WANT_TAPE_DEVICE, test -n "$want_tape_device")
93 if test -n "$xenix_tapeio"; then
94 AC_DEFINE(WANT_TAPE_XENIX,1,[Define on XENIX/ISC. ])
97 if test -n "$aix_tapeio"; then
98 AC_DEFINE(WANT_TAPE_AIX,1,[Define on AIX. ])
101 if test -n "$uware_tapeio"; then
102 AC_DEFINE(WANT_TAPE_UWARE,1,[Define on UnixWare. ])
106 # Check for various "mt status" related structure elements.
108 AC_MSG_CHECKING([for mt_flags mtget structure element])
109 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
111 #include <sys/types.h>
112 #include <sys/mtio.h>
120 AC_DEFINE(HAVE_MT_FLAGS,1,
121 [Define if the mtget structure has an mt_flags field])
126 AC_MSG_CHECKING([for mt_fileno mtget structure element])
127 mt_fileno_result="found"
128 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
130 #include <sys/types.h>
131 #include <sys/mtio.h>
139 AC_DEFINE(HAVE_MT_FILENO,1,
140 [Define if the mtget structure has an mt_fileno field])
145 AC_MSG_CHECKING(for mt_blkno mtget structure element)
146 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
148 #include <sys/types.h>
149 #include <sys/mtio.h>
157 AC_DEFINE(HAVE_MT_BLKNO,1,
158 [Define if the mtget structure has an mt_blkno field])
163 AC_MSG_CHECKING(for mt_dsreg mtget structure element)
164 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
166 #include <sys/types.h>
167 #include <sys/mtio.h>
175 AC_DEFINE(HAVE_MT_DSREG,1,
176 [Define if the mtget structure has an mt_dsreg field])
181 AC_MSG_CHECKING(for mt_erreg mtget structure element)
182 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
184 #include <sys/types.h>
185 #include <sys/mtio.h>
193 AC_DEFINE(HAVE_MT_ERREG,1,
194 [Define if the mtget structure has an mt_erreg field])