Imported Upstream version 3.1.0
[debian/amanda] / config / amanda / progs.m4
index c816b75e350a74b229ef4ca734c63e7be9e4f0dc..695940c179f77c6ae79aee972103b775e3c5bea9 100644 (file)
@@ -152,40 +152,40 @@ AC_DEFUN([AMANDA_PROG_GNUPLOT],
 
 # SYNOPSIS
 #
-#   AMANDA_PROG_PRINT
+#   AMANDA_PROG_LPR
 #
 # OVERVIEW
 #
 #   Search for a binary for printing, usually either 'lp' or 'lpr', and put its
-#   path in PRINT, as well as defining it in LPRCMD in config.h.
+#   path in LPR.
 #
-#   LPRFLAG is defined in config.h as the appropriate command-line flag to use 
+#   LPRFLAG is substituted as the appropriate command-line flag to use 
 #   to select a printer; either -P or -d.
 #
-AC_DEFUN([AMANDA_PROG_PRINT],
+AC_DEFUN([AMANDA_PROG_LPR],
 [
     AC_REQUIRE([AMANDA_INIT_PROGS])
 
-    AC_PATH_PROGS(PRINT, lpr lp)
-    if test ! -z "$PRINT"; then
-       AC_DEFINE_UNQUOTED(LPRCMD, "$PRINT",
-               [Command for starting printing jobs. ])
+    AC_PATH_PROGS(LPR, lpr lp)
+    if test ! -z "$LPR"; then
+       AC_DEFINE([HAVE_LPR_CMD], [1],
+           [Set to 1 if an LPR command was found at configure time])
 
        AC_CACHE_CHECK([which flag to use to select a printer],
            amanda_cv_printer_flag, [
-           amanda_cv_printer_flag=$PRINTER_FLAG
-           case "$PRINT" in
+           amanda_cv_printer_flag=$LPRFLAG
+           case "$LPR" in
                lpr|*/lpr) amanda_cv_printer_flag="-P";;
                lp|*/lp) amanda_cv_printer_flag="-d";;
            esac
        ])
-       if test ! -z "$amanda_cv_printer_flag"; then
-           AC_DEFINE_UNQUOTED(LPRFLAG, "$amanda_cv_printer_flag",
-                   [LPRCMD switch for specifying a printer name. ])
-       else
+       if test -z "$amanda_cv_printer_flag"; then
            AMANDA_MSG_WARN([WARNING: amanda will always print to the default printer])
        fi
     fi
+
+    AC_SUBST([LPR])
+    AC_SUBST([LPRFLAG])
 ])
 
 # SYNOPSIS
@@ -308,7 +308,7 @@ AC_DEFUN([AMANDA_PROG_MT],
     AC_REQUIRE([AMANDA_INIT_PROGS])
     AC_PATH_PROG(MT,mt,mt,$LOCSYSPATH)
 
-    case "$target" in
+    case "$host" in
        *-hp-*) MT_FILE_FLAG="-t" ;;
        *) MT_FILE_FLAG="-f" ;;
     esac
@@ -367,7 +367,9 @@ AC_DEFUN([AMANDA_PROG_SWIG],
     AC_REQUIRE([AMANDA_INIT_PROGS])
     AC_PATH_PROGS(SWIG,swig,,$LOCSYSPATH)
     AC_ARG_VAR([SWIG], [Path to the 'swig' binary (developers only)])
-    AC_PROG_SWIG([1.3.28])
+    # 1.3.32 introduces a change in the way empty strings are handled (old versions
+    # returned undef in Perl, while new versions return an empty Perl string)
+    AC_PROG_SWIG([1.3.32])
 ])
 
 AC_DEFUN([AMANDA_PROG_AR],
@@ -394,3 +396,13 @@ AC_DEFUN([AMANDA_PROG_GETTEXT],
     AC_REQUIRE([AMANDA_INIT_PROGS])
     AC_PATH_PROG(GETTEXT,gettext,,$LOCSYSPATH)
 ])
+
+AC_DEFUN([AMANDA_PROG_RPCGEN],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(RPCGEN,rpcgen,,$LOCSYSPATH)
+
+    # rpcgen rules (which only appear in ndmp-src) are disabled completely
+    # on systems where rpcgen is not available
+    AM_CONDITIONAL([HAVE_RPCGEN], [test "x$RPCGEN" != "x"])
+])