10 # Search for a GNU 'tar' binary, placing the result in the precious
11 # variable GNUTAR. The discovered binary is tested to ensure it's really
14 # Also handle --with-gnutar
16 AC_DEFUN([AMANDA_PROG_GNUTAR],
18 AC_REQUIRE([AMANDA_INIT_PROGS])
22 AS_HELP_STRING([--with-gnutar=PROG],
23 [use PROG as GNU 'tar']),
27 /*) GNUTAR="$withval";;
30 *) AC_MSG_ERROR([*** You must supply a full pathname to --with-gnutar]);;
36 if test "x$GNUTAR" != "xno"; then
38 AC_PATH_PROGS(GNUTAR,gtar gnutar tar,,$LOCSYSPATH)
43 if test ! -z "$GNUTAR"; then
44 case "`\"$GNUTAR\" --version 2>&1`" in
45 *GNU*tar* | *Free*paxutils* ) : # OK, it is GNU tar
49 AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.])
55 if test "x$GNUTAR" != "x"; then
57 AC_DEFINE_UNQUOTED(GNUTAR, "$GNUTAR", [Location of the GNU 'tar' binary])
59 AC_ARG_VAR(GNUTAR, [Location of the GNU 'tar' binary])
65 # AMANDA_PROG_SAMBA_CLIENT
69 # Search for a samba client (smbclient) binary, placing the result in
70 # the variable SAMBA_CLIENT. The discovered binary is tested to determine an
71 # internally significant version number, stored in SAMBA_VERSION. The version
72 # serves only to differentiate versions of Samba which Amanada must treat
73 # differently, and has no relation to the actual Samba version number.
75 # Automake conditional 'WANT_SAMBA' is set if a samba client is discovered.
77 # Also handles --with-smbclient and (deprecated) --with-samba-user
79 AC_DEFUN([AMANDA_PROG_SAMBA_CLIENT],
81 AC_REQUIRE([AMANDA_INIT_PROGS])
83 AC_ARG_WITH(smbclient,
84 AS_HELP_STRING([--with-smbclient=PROG],
85 [use PROG as 'smbclient']),
88 /*) SAMBA_CLIENT="$withval";;
90 n|no) SAMBA_CLIENT=no ;;
91 *) AC_MSG_ERROR([*** You must supply a full pathname to --with-smbclient]);;
96 AC_ARG_WITH(samba-user,
97 AS_HELP_STRING([--with-samba-user],
98 [deprecated; place username in 'amandapass']),
99 [ AC_MSG_ERROR([--with-samba-user is no longer supported; place username in 'amandapass']) ]
102 if test "x$SAMBA_CLIENT" != "xno"; then
103 AC_PATH_PROG(SAMBA_CLIENT,smbclient,,$LOCSYSPATH)
105 if test ! -z "$SAMBA_CLIENT"; then
106 case "`\"$SAMBA_CLIENT\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in
110 *"Connection to not.a.host.name failed"*)
114 AMANDA_MSG_WARN([$SAMBA_CLIENT does not seem to be smbclient, so it will not be used.])
118 if test -n "$SAMBA_CLIENT"; then
119 AC_DEFINE_UNQUOTED(SAMBA_CLIENT,"$SAMBA_CLIENT",
120 [Define the location of smbclient for backing up Samba PC clients. ])
121 AC_DEFINE_UNQUOTED(SAMBA_VERSION, $smbversion,
122 [Not the actual samba version, just a number that should be increased whenever we start to rely on a new samba feature. ])
127 AM_CONDITIONAL(WANT_SAMBA, test -n "$SAMBA_CLIENT")
132 # AMANDA_PROG_VDUMP_VRESTORE
136 # Search for 'vdump' and 'vrestore', setting and AC_DEFINE-ing VDUMP and
137 # VRESTORE if they are found.
139 AC_DEFUN([AMANDA_PROG_VDUMP_VRESTORE],
141 AC_REQUIRE([AMANDA_INIT_PROGS])
143 AC_PATH_PROG(VDUMP,vdump,,$SYSLOCPATH)
144 AC_PATH_PROG(VRESTORE,vrestore,,$SYSLOCPATH)
145 if test "$VDUMP" -a "$VRESTORE"; then
146 AC_DEFINE_UNQUOTED(VDUMP,"$VDUMP",[Define the location of the vdump program. ])
147 AC_DEFINE_UNQUOTED(VRESTORE,"$VRESTORE",[Define the location of the vrestore program. ])
153 # AMANDA_PROG_VXDUMP_VXRESTORE
157 # Search for 'vxdump' and 'vxrestore', setting and AC_DEFINE-ing VXDUMP
158 # and VXRESTORE if they are found.
160 # In addition to the standard paths, this macro will search in
163 AC_DEFUN([AMANDA_PROG_VXDUMP_VXRESTORE],
165 AC_REQUIRE([AMANDA_INIT_PROGS])
167 AC_PATH_PROG(VXDUMP,vxdump,,$SYSLOCPATH:/usr/lib/fs/vxfs)
168 AC_PATH_PROG(VXRESTORE,vxrestore,,$SYSLOCPATH:/usr/lib/fs/vxfs)
169 if test "$VXDUMP" -a "$VXRESTORE"; then
170 AC_DEFINE_UNQUOTED(VXDUMP,"$VXDUMP",
171 [Define the location of the vxdump program on HPUX and SINIX hosts or on
172 * other hosts where the Veritas filesystem (vxfs) has been installed. ])
173 AC_DEFINE_UNQUOTED(VXRESTORE,"$VXRESTORE",
174 [Define the location of the vxrestore program on HPUX and SINIX hosts or on
175 * other hosts where the Veritas filesystem (vxfs) has been installed. ])
181 # AMANDA_PROG_XFSDUMP_XFSRESTORE
185 # Search for 'xfsdump' and 'xfsrestore', setting and AC_DEFINE-ing XFSDUMP
186 # and XFSRESTORE if they are found.
188 AC_DEFUN([AMANDA_PROG_XFSDUMP_XFSRESTORE],
190 AC_REQUIRE([AMANDA_INIT_PROGS])
192 AC_PATH_PROGS(XFSDUMP,xfsdump,,$SYSLOCPATH)
193 AC_PATH_PROGS(XFSRESTORE,xfsrestore,,$SYSLOCPATH)
194 if test "$XFSDUMP" -a "$XFSRESTORE"; then
195 AC_DEFINE_UNQUOTED(XFSDUMP,"$XFSDUMP",
196 [Define the location of the xfsdump program on Irix hosts. ])
197 AC_DEFINE_UNQUOTED(XFSRESTORE,"$XFSRESTORE",
198 [Define the location of the xfsrestore program on Irix hosts. ])
199 AMANDA_MSG_WARN([[xfsdump causes the setuid-root rundump program to be enabled. To disable it, just #undef XFSDUMP in config/config.h]])
205 # AMANDA_PROG_DUMP_RESTORE
209 # Search for compatible dump and restore binaries. The exact name of
210 # the binaries we search for depends on the target system. If working
211 # binaries are found, DUMP and RESTORE are defined to their full paths.
213 # DUMP_RETURNS is defined if the system's 'dump' returns 1 on success.
215 # HAVE_DUMP_ESTIMATE is defined to the dump flag which enables estimates.
217 # The --with-honor-nodump flag is processed, and the result of the test is
218 # positive, then HAVE_HONOR_NODUMP is defined.
220 AC_DEFUN([AMANDA_PROG_DUMP_RESTORE],
222 AC_REQUIRE([AMANDA_INIT_PROGS])
223 AC_REQUIRE([AMANDA_PROG_GREP])
225 # Set the order of dump programs to look for. Finding the proper file
226 # system dumping program is problematic. Some systems, notably HP-UX
227 # and AIX, have both the backup and dump programs. HP-UX can't use the
228 # the backup program while AIX systems can't use the dump program. So
229 # a variable is set up here to specify the order of dump programs to
230 # search for on the system.
231 DUMP_PROGRAMS="ufsdump dump backup"
235 DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
239 DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
240 AC_DEFINE(AIX_BACKUP,1,
241 [Is DUMP the AIX program 'backup'?])
248 if test -n "$dump_returns_1"; then
249 AC_DEFINE(DUMP_RETURNS_1,1,
250 [Define this if this system's dump exits with 1 as a success code. ])
253 AC_PATH_PROGS(DUMP,$DUMP_PROGRAMS,,$SYSLOCPATH)
254 AC_PATH_PROGS(RESTORE,ufsrestore restore,,$SYSLOCPATH)
256 # newer versions of GNU tar include a program named 'backup' which
257 # does *not* implement the expected 'dump' interface. Detect that here
258 # and pretend we never saw it.
259 if test -n "$DUMP"; then
260 if test "`basename $DUMP`" = "backup"; then
261 backup_gnutar=`$DUMP --version | $GREP "GNU tar"`
262 if test $? -eq 0; then
268 if test "$DUMP" -a "$RESTORE"; then
269 AC_DEFINE_UNQUOTED(DUMP,"$DUMP",
270 [Define the location of the ufsdump, backup, or dump program. ])
271 AC_DEFINE_UNQUOTED(RESTORE,"$RESTORE",
272 [Define the location of the ufsrestore or restore program. ])
274 # check for an estimate flag
275 if test -x $DUMP; then
277 [whether $DUMP supports -E or -S for estimates],
278 amanda_cv_dump_estimate,
282 AC_TRY_COMMAND($DUMP 9Ef /dev/null /dev/null/invalid/fs 2>&1
285 | $GREP -v Label >conftest.d-E 2>&1)
286 cat conftest.d-E >&AS_MESSAGE_LOG_FD()
287 AC_TRY_COMMAND($DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1
290 | $GREP -v Label >conftest.d-S 2>&1)
291 cat conftest.d-S >&AS_MESSAGE_LOG_FD()
292 AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
295 | $GREP -v Label >conftest.d 2>&1)
296 cat conftest.d >&AS_MESSAGE_LOG_FD()
297 if AC_TRY_COMMAND(cmp conftest.d-E conftest.d 1>&2); then
298 amanda_cv_dump_estimate=E
299 elif AC_TRY_COMMAND(cmp conftest.d-S conftest.d 1>&2); then
300 amanda_cv_dump_estimate=S
302 amanda_cv_dump_estimate=no
304 rm -f conftest.d conftest.d-E conftest.d-S
306 *) amanda_cv_dump_estimate=no
311 AMANDA_MSG_WARN([$DUMP is not executable, cannot run -E/-S test])
312 amanda_cv_dump_estimate=no
314 if test "x$amanda_cv_dump_estimate" != xno; then
315 AC_DEFINE_UNQUOTED(HAVE_DUMP_ESTIMATE, "$amanda_cv_dump_estimate",
316 [Define to the string that enables dump estimates. ])
319 AC_ARG_WITH(dump-honor-nodump,
320 AS_HELP_STRING([--with-dump-honor-nodump],
321 [if dump supports -h, use it for level0s too]),
323 if test -x $DUMP; then
325 [whether $DUMP supports -h (honor nodump flag)],
326 amanda_cv_honor_nodump,
330 AC_TRY_COMMAND($DUMP 9hf 0 /dev/null /dev/null/invalid/fs 2>&1
333 | $GREP -v Label >conftest.d-h 2>&1)
334 cat conftest.d-h >&AS_MESSAGE_LOG_FD()
335 AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
338 | $GREP -v Label >conftest.d 2>&1)
339 cat conftest.d >&AS_MESSAGE_LOG_FD()
340 if AC_TRY_COMMAND(diff conftest.d-h conftest.d 1>&2); then
341 amanda_cv_honor_nodump=yes
343 amanda_cv_honor_nodump=no
345 rm -f conftest.d conftest.d-h
347 *) amanda_cv_honor_nodump=no
352 AMANDA_MSG_WARN([$DUMP is not executable, cannot run -h test])
353 amanda_cv_honor_nodump=no
355 if test "x$amanda_cv_honor_nodump" = xyes; then
356 AC_DEFINE(HAVE_HONOR_NODUMP,1,
357 [Define this if dump accepts -h for honoring nodump. ])
365 # AMANDA_CHECK_USE_RUNDUMP
369 # Decide if the 'rundump' setuid-root wrapper should be used to invoke
370 # dump. If so, USE_RUNDUMP is #defined.
372 AC_DEFUN([AMANDA_CHECK_USE_RUNDUMP], [
375 # some systems require rundump unconditionally
377 *-ultrix*) USE_RUNDUMP=yes ;;
378 *-dg-*) USE_RUNDUMP=yes ;;
382 AS_HELP_STRING([--with-rundump], [use rundump, a setuid-root wrapper, to invoke dump]), [
384 n | no) USE_RUNDUMP=no ;;
385 y | ye | yes) USE_RUNDUMP=yes ;;
386 *) AC_MSG_ERROR([You must not supply an argument to --with-rundump option.]);;
390 if test x"$USE_RUNDUMP" = x"yes"; then
391 AC_DEFINE(USE_RUNDUMP,1,
392 [Define to invoke rundump (setuid-root) instead of DUMP program directly. ])