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
40 for gnutar_name in gtar gnutar tar; do
41 AC_PATH_PROGS(GNUTAR, $gnutar_name, , $LOCSYSPATH)
42 if test -n "$GNUTAR"; then
43 case `"$GNUTAR" --version 2>&1` in
44 *GNU*tar* | *Free*paxutils* )
49 if test -n "$OLD_GNUTAR"; then
50 AMANDA_MSG_WARN([$GNUTAR is not GNU tar, it will be used.])
53 AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.])
54 # reset the cache for GNUTAR so AC_PATH_PROGS will search again
56 unset ac_cv_path_GNUTAR
64 if test "x$GNUTAR" != "x"; then
66 AC_DEFINE_UNQUOTED(GNUTAR, "$GNUTAR", [Location of the GNU 'tar' binary])
68 AC_ARG_VAR(GNUTAR, [Location of the GNU 'tar' binary])
78 # Search for a 'star' binary, placing the result in the precious
79 # variable STAR. The discovered binary is tested to ensure it's really
82 # Also handle --with-star
84 AC_DEFUN([AMANDA_PROG_STAR],
86 AC_REQUIRE([AMANDA_INIT_PROGS])
90 AS_HELP_STRING([--with-star=PROG],
91 [use PROG as 'star']),
98 *) AC_MSG_ERROR([*** You must supply a full pathname to --with-star]);;
104 if test "x$STAR" = "xno"; then
108 AC_PATH_PROGS(STAR, star, , $LOCSYSPATH)
109 if test -n "$STAR"; then
110 case `"$STAR" --version 2>/dev/null` in
116 if test -n "$OLD_STAR"; then
117 AMANDA_MSG_WARN([$STAR is not star, it will be used.])
120 AMANDA_MSG_WARN([$STAR is not star, so it will not be used.])
121 # reset the cache for STAR so AC_PATH_PROGS will search again
123 unset ac_cv_path_STAR
130 if test "x$STAR" != "x"; then
132 AC_DEFINE_UNQUOTED(STAR, "$STAR", [Location of the 'star' binary])
134 AC_ARG_VAR(STAR, [Location of the 'star' binary])
140 # AMANDA_PROG_SAMBA_CLIENT
144 # Search for a samba client (smbclient) binary, placing the result in
145 # the variable SAMBA_CLIENT. The discovered binary is tested to determine an
146 # internally significant version number, stored in SAMBA_VERSION. The version
147 # serves only to differentiate versions of Samba which Amanada must treat
148 # differently, and has no relation to the actual Samba version number.
150 # Automake conditional 'WANT_SAMBA' is set if a samba client is discovered.
152 # Also handles --with-smbclient and (deprecated) --with-samba-user
154 AC_DEFUN([AMANDA_PROG_SAMBA_CLIENT],
156 AC_REQUIRE([AMANDA_INIT_PROGS])
158 AC_ARG_WITH(smbclient,
159 AS_HELP_STRING([--with-smbclient=PROG],
160 [use PROG as 'smbclient']),
163 /*) SAMBA_CLIENT="$withval";;
165 n|no) SAMBA_CLIENT=no ;;
166 *) AC_MSG_ERROR([*** You must supply a full pathname to --with-smbclient]);;
171 AC_ARG_WITH(samba-user,
172 AS_HELP_STRING([--with-samba-user],
173 [deprecated; place username in 'amandapass']),
174 [ AC_MSG_ERROR([--with-samba-user is no longer supported; place username in 'amandapass']) ]
177 if test "x$SAMBA_CLIENT" != "xno"; then
178 AC_PATH_PROG(SAMBA_CLIENT,smbclient,,$LOCSYSPATH)
180 if test ! -z "$SAMBA_CLIENT"; then
181 case `"$SAMBA_CLIENT" '\\\\nosuchhost.amanda.org\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1` in
185 *"Connection to nosuchhost.amanda.org failed"*)
189 AMANDA_MSG_WARN([$SAMBA_CLIENT does not seem to be smbclient, so it will not be used.])
193 if test -n "$SAMBA_CLIENT"; then
194 AC_DEFINE_UNQUOTED(SAMBA_CLIENT,"$SAMBA_CLIENT",
195 [Define the location of smbclient for backing up Samba PC clients. ])
196 AC_DEFINE_UNQUOTED(SAMBA_VERSION, $smbversion,
197 [Not the actual samba version, just a number that should be increased whenever we start to rely on a new samba feature. ])
202 AM_CONDITIONAL(WANT_SAMBA, test -n "$SAMBA_CLIENT")
207 # AMANDA_PROG_VDUMP_VRESTORE
211 # Search for 'vdump' and 'vrestore', setting and AC_DEFINE-ing VDUMP and
212 # VRESTORE if they are found.
214 AC_DEFUN([AMANDA_PROG_VDUMP_VRESTORE],
216 AC_REQUIRE([AMANDA_INIT_PROGS])
218 AC_PATH_PROG(VDUMP,vdump,,$SYSLOCPATH)
219 AC_PATH_PROG(VRESTORE,vrestore,,$SYSLOCPATH)
220 if test "$VDUMP" -a "$VRESTORE"; then
221 AC_DEFINE_UNQUOTED(VDUMP,"$VDUMP",[Define the location of the vdump program. ])
222 AC_DEFINE_UNQUOTED(VRESTORE,"$VRESTORE",[Define the location of the vrestore program. ])
228 # AMANDA_PROG_VXDUMP_VXRESTORE
232 # Search for 'vxdump' and 'vxrestore', setting and AC_DEFINE-ing VXDUMP
233 # and VXRESTORE if they are found.
235 # In addition to the standard paths, this macro will search in
238 AC_DEFUN([AMANDA_PROG_VXDUMP_VXRESTORE],
240 AC_REQUIRE([AMANDA_INIT_PROGS])
242 AC_PATH_PROG(VXDUMP,vxdump,,$SYSLOCPATH:/usr/lib/fs/vxfs)
243 AC_PATH_PROG(VXRESTORE,vxrestore,,$SYSLOCPATH:/usr/lib/fs/vxfs)
244 if test "$VXDUMP" -a "$VXRESTORE"; then
245 AC_DEFINE_UNQUOTED(VXDUMP,"$VXDUMP",
246 [Define the location of the vxdump program on HPUX and SINIX hosts or on
247 * other hosts where the Veritas filesystem (vxfs) has been installed. ])
248 AC_DEFINE_UNQUOTED(VXRESTORE,"$VXRESTORE",
249 [Define the location of the vxrestore program on HPUX and SINIX hosts or on
250 * other hosts where the Veritas filesystem (vxfs) has been installed. ])
256 # AMANDA_PROG_XFSDUMP_XFSRESTORE
260 # Search for 'xfsdump' and 'xfsrestore', setting and AC_DEFINE-ing XFSDUMP
261 # and XFSRESTORE if they are found.
263 AC_DEFUN([AMANDA_PROG_XFSDUMP_XFSRESTORE],
265 AC_REQUIRE([AMANDA_INIT_PROGS])
267 AC_PATH_PROGS(XFSDUMP,xfsdump,,$SYSLOCPATH)
268 AC_PATH_PROGS(XFSRESTORE,xfsrestore,,$SYSLOCPATH)
269 if test "$XFSDUMP" -a "$XFSRESTORE"; then
270 AC_DEFINE_UNQUOTED(XFSDUMP,"$XFSDUMP",
271 [Define the location of the xfsdump program on Irix hosts. ])
272 AC_DEFINE_UNQUOTED(XFSRESTORE,"$XFSRESTORE",
273 [Define the location of the xfsrestore program on Irix hosts. ])
274 AMANDA_MSG_WARN([[xfsdump causes the setuid-root rundump program to be enabled. To disable it, just #undef XFSDUMP in config/config.h]])
280 # AMANDA_PROG_DUMP_RESTORE
284 # Search for compatible dump and restore binaries. The exact name of
285 # the binaries we search for depends on the target system. If working
286 # binaries are found, DUMP and RESTORE are defined to their full paths.
288 # DUMP_RETURNS_1 is defined and substituted if the system's 'dump'
289 # returns 1 on success.
291 # HAVE_DUMP_ESTIMATE is defined to the dump flag which enables estimates.
293 # The --with-honor-nodump flag is processed, and the result of the test is
294 # positive, then HAVE_HONOR_NODUMP is defined.
296 AC_DEFUN([AMANDA_PROG_DUMP_RESTORE],
298 AC_REQUIRE([AMANDA_INIT_PROGS])
299 AC_REQUIRE([AMANDA_PROG_GREP])
301 # Set the order of dump programs to look for. Finding the proper file
302 # system dumping program is problematic. Some systems, notably HP-UX
303 # and AIX, have both the backup and dump programs. HP-UX can't use the
304 # the backup program while AIX systems can't use the dump program. So
305 # a variable is set up here to specify the order of dump programs to
306 # search for on the system.
307 DUMP_PROGRAMS="ufsdump dump backup"
312 DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
316 DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
318 AC_DEFINE(AIX_BACKUP,1,
319 [Is DUMP the AIX program 'backup'?])
326 if test -n "$DUMP_RETURNS_1"; then
327 AC_DEFINE(DUMP_RETURNS_1,1,
328 [Define this if this system's dump exits with 1 as a success code. ])
331 AC_PATH_PROGS(DUMP,$DUMP_PROGRAMS,,$SYSLOCPATH)
332 AC_PATH_PROGS(RESTORE,ufsrestore restore,,$SYSLOCPATH)
334 # newer versions of GNU tar include a program named 'backup' which
335 # does *not* implement the expected 'dump' interface. Detect that here
336 # and pretend we never saw it.
337 if test -n "$DUMP"; then
338 if test "`basename $DUMP`" = "backup"; then
339 backup_gnutar=`$DUMP --version | $GREP "GNU tar"`
340 if test $? -eq 0; then
346 if test "$DUMP" -a "$RESTORE"; then
347 AC_DEFINE_UNQUOTED(DUMP,"$DUMP",
348 [Define the location of the ufsdump, backup, or dump program. ])
349 AC_DEFINE_UNQUOTED(RESTORE,"$RESTORE",
350 [Define the location of the ufsrestore or restore program. ])
352 # check for an estimate flag
353 if test -x $DUMP; then
355 [whether $DUMP supports -E or -S for estimates],
356 amanda_cv_dump_estimate,
360 AC_TRY_COMMAND($DUMP 9Ef /dev/null /dev/null/invalid/fs 2>&1
363 | $GREP -v Label >conftest.d-E 2>&1)
364 cat conftest.d-E >&AS_MESSAGE_LOG_FD()
365 AC_TRY_COMMAND($DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1
368 | $GREP -v Label >conftest.d-S 2>&1)
369 cat conftest.d-S >&AS_MESSAGE_LOG_FD()
370 AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
373 | $GREP -v Label >conftest.d 2>&1)
374 cat conftest.d >&AS_MESSAGE_LOG_FD()
375 if AC_TRY_COMMAND(cmp conftest.d-E conftest.d 1>&2); then
376 amanda_cv_dump_estimate=E
377 elif AC_TRY_COMMAND(cmp conftest.d-S conftest.d 1>&2); then
378 amanda_cv_dump_estimate=S
380 amanda_cv_dump_estimate=no
382 rm -f conftest.d conftest.d-E conftest.d-S
384 *) amanda_cv_dump_estimate=no
389 AMANDA_MSG_WARN([$DUMP is not executable, cannot run -E/-S test])
390 amanda_cv_dump_estimate=no
392 if test "x$amanda_cv_dump_estimate" != xno; then
393 AC_DEFINE_UNQUOTED(HAVE_DUMP_ESTIMATE, "$amanda_cv_dump_estimate",
394 [Define to the string that enables dump estimates. ])
397 AC_ARG_WITH(dump-honor-nodump,
398 AS_HELP_STRING([--with-dump-honor-nodump],
399 [if dump supports -h, use it for level0s too]),
401 if test -x $DUMP; then
403 [whether $DUMP supports -h (honor nodump flag)],
404 amanda_cv_honor_nodump,
408 AC_TRY_COMMAND($DUMP 9hf 0 /dev/null /dev/null/invalid/fs 2>&1
411 | $GREP -v Label >conftest.d-h 2>&1)
412 cat conftest.d-h >&AS_MESSAGE_LOG_FD()
413 AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
416 | $GREP -v Label >conftest.d 2>&1)
417 cat conftest.d >&AS_MESSAGE_LOG_FD()
418 if AC_TRY_COMMAND(diff conftest.d-h conftest.d 1>&2); then
419 amanda_cv_honor_nodump=yes
421 amanda_cv_honor_nodump=no
423 rm -f conftest.d conftest.d-h
425 *) amanda_cv_honor_nodump=no
430 AMANDA_MSG_WARN([$DUMP is not executable, cannot run -h test])
431 amanda_cv_honor_nodump=no
433 if test "x$amanda_cv_honor_nodump" = xyes; then
434 AC_DEFINE(HAVE_HONOR_NODUMP,1,
435 [Define this if dump accepts -h for honoring nodump. ])
441 AC_SUBST(DUMP_RETURNS_1)
446 # AMANDA_CHECK_USE_RUNDUMP
450 # Decide if the 'rundump' setuid-root wrapper should be used to invoke
451 # dump. If so, USE_RUNDUMP is defined and substituted.
453 AC_DEFUN([AMANDA_CHECK_USE_RUNDUMP], [
456 # some systems require rundump unconditionally
458 *-ultrix*) USE_RUNDUMP=yes ;;
459 *-dg-*) USE_RUNDUMP=yes ;;
463 AS_HELP_STRING([--with-rundump], [use rundump, a setuid-root wrapper, to invoke dump]), [
465 n | no) USE_RUNDUMP=no ;;
466 y | ye | yes) USE_RUNDUMP=yes ;;
467 *) AC_MSG_ERROR([You must not supply an argument to --with-rundump option.]);;
471 if test x"$USE_RUNDUMP" = x"yes"; then
473 AC_DEFINE(USE_RUNDUMP,1,
474 [Define to invoke rundump (setuid-root) instead of DUMP program directly. ])
479 AC_SUBST(USE_RUNDUMP)