Imported Upstream version 2.6.1p1
[debian/amanda] / config / amanda / dumpers.m4
index 5c3ce070e522a722eeca04bec4d25991e195cc0a..3763d4e9640b94a0b46d9e9546fdf2e63834682d 100644 (file)
@@ -33,23 +33,27 @@ AC_DEFUN([AMANDA_PROG_GNUTAR],
        ]
     )
 
-    if test "x$GNUTAR" != "xno"; then
-       # call ac_path_progs
-       AC_PATH_PROGS(GNUTAR,gtar gnutar tar,,$LOCSYSPATH)
-    else
+    if test "x$GNUTAR" = "xno"; then
        GNUTAR=
-    fi
-
-    if test ! -z "$GNUTAR"; then
-      case "`\"$GNUTAR\" --version 2>&1`" in
-       *GNU*tar* | *Free*paxutils* ) : # OK, it is GNU tar
-                   ;;
-       *)
-                   # warning..
-                   AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.])
-                   GNUTAR=''
-                   ;;
-      esac
+    else
+       for gnutar_name in gtar gnutar tar; do
+           AC_PATH_PROGS(GNUTAR, $gnutar_name, , $LOCSYSPATH)
+           if test -n "$GNUTAR"; then
+             case "`\"$GNUTAR\" --version 2>&1`" in
+              *GNU*tar* | *Free*paxutils* )
+                           # OK, it is GNU tar
+                           break
+                           ;;
+              *)
+                           # warning..
+                           AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.])
+                           # reset the cache for GNUTAR so AC_PATH_PROGS will search again
+                           GNUTAR=''
+                           unset ac_cv_path_GNUTAR
+                           ;;
+             esac
+           fi
+       done
     fi
 
     if test "x$GNUTAR" != "x"; then
@@ -103,11 +107,11 @@ AC_DEFUN([AMANDA_PROG_SAMBA_CLIENT],
       AC_PATH_PROG(SAMBA_CLIENT,smbclient,,$LOCSYSPATH)
       smbversion=0
       if test ! -z "$SAMBA_CLIENT"; then
-        case "`\"$SAMBA_CLIENT\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in
+        case "`\"$SAMBA_CLIENT\" '\\\\nosuchhost.amanda.org\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in
         *"Unknown host"*)
                      smbversion=1
                      ;;
-        *"Connection to not.a.host.name failed"*)
+        *"Connection to nosuchhost.amanda.org failed"*)
                      smbversion=2
                      ;;
         *)
@@ -210,7 +214,8 @@ AC_DEFUN([AMANDA_PROG_XFSDUMP_XFSRESTORE],
 #   the binaries we search for depends on the target system.  If working
 #   binaries are found, DUMP and RESTORE are defined to their full paths.
 #
-#   DUMP_RETURNS is defined if the system's 'dump' returns 1 on success.
+#   DUMP_RETURNS_1 is defined and substituted if the system's 'dump'
+#   returns 1 on success.
 #
 #   HAVE_DUMP_ESTIMATE is defined to the dump flag which enables estimates.
 #
@@ -229,23 +234,25 @@ AC_DEFUN([AMANDA_PROG_DUMP_RESTORE],
     # a variable is set up here to specify the order of dump programs to
     # search for on the system.
     DUMP_PROGRAMS="ufsdump dump backup"
-    dump_returns_1=
+    DUMP_RETURNS_1=
+    AIX_BACKUP=
     case "$target" in
        *-dg-*)
            DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
-           dump_returns_1=yes
+           DUMP_RETURNS_1=1
            ;;
       *-ibm-aix*)
            DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
+           AIX_BACKUP=1
            AC_DEFINE(AIX_BACKUP,1,
                [Is DUMP the AIX program 'backup'?])
            ;;
       *-ultrix*)
-           dump_returns_1=yes
+           DUMP_RETURNS_1=1
            ;;
     esac
 
-    if test -n "$dump_returns_1"; then
+    if test -n "$DUMP_RETURNS_1"; then
       AC_DEFINE(DUMP_RETURNS_1,1,
        [Define this if this system's dump exits with 1 as a success code. ])
     fi
@@ -358,6 +365,9 @@ AC_DEFUN([AMANDA_PROG_DUMP_RESTORE],
            fi
        ])
     fi
+
+    AC_SUBST(AIX_BACKUP)
+    AC_SUBST(DUMP_RETURNS_1)
 ])
 
 # SYNOPSIS
@@ -367,7 +377,7 @@ AC_DEFUN([AMANDA_PROG_DUMP_RESTORE],
 # DESCRIPTION
 #
 #   Decide if the 'rundump' setuid-root wrapper should be used to invoke
-#   dump.  If so, USE_RUNDUMP is #defined.
+#   dump.  If so, USE_RUNDUMP is defined and substituted.
 #
 AC_DEFUN([AMANDA_CHECK_USE_RUNDUMP], [
     USE_RUNDUMP=no
@@ -388,7 +398,12 @@ AC_DEFUN([AMANDA_CHECK_USE_RUNDUMP], [
         ])
 
     if test x"$USE_RUNDUMP" = x"yes"; then
+       USE_RUNDUMP=1
         AC_DEFINE(USE_RUNDUMP,1,
             [Define to invoke rundump (setuid-root) instead of DUMP program directly. ])
+    else
+       USE_RUNDUMP=
     fi
+
+    AC_SUBST(USE_RUNDUMP)
 ])