Imported Upstream version 3.2.0
[debian/amanda] / config / amanda / progs.m4
index c816b75e350a74b229ef4ca734c63e7be9e4f0dc..11f98924b06ee0cce9b04c876cb7b328f7bf1182 100644 (file)
@@ -20,7 +20,8 @@
 #
 #   SYSPATH is a list of likely system locations for a file, while
 #   LOCPATH is a list of likely local locations.  The two are combined
-#   in different orders in SYSLOCPATH and LOCSYSPATH.
+#   in different orders in SYSLOCPATH and LOCSYSPATH.  These path differences
+#   are known to affect Solaris 8.
 #
 AC_DEFUN([AMANDA_INIT_PROGS],
 [
@@ -122,70 +123,40 @@ AC_DEFUN([AMANDA_PROG_LINT],
 
 # SYNOPSIS
 #
-#   AMANDA_PROG_GNUPLOT
-#
-# OVERVIEW
-#
-#   Search for a 'gnuplot' binary, placing the result in the precious 
-#   variable GNUPLOT.  Also accepts --with-gnuplot to indicate the location
-#   of the binary.
-#
-AC_DEFUN([AMANDA_PROG_GNUPLOT],
-[
-    AC_REQUIRE([AMANDA_INIT_PROGS])
-
-    AC_ARG_WITH(gnuplot,
-    AS_HELP_STRING([--with-gnuplot=PATH],
-                  [use gnuplot executable at PATH in amplot]),
-       [
-           case "$withval" in
-               y | ye | yes) : ;;
-               n | no) GNUPLOT= ;;
-               *) GNUPLOT="$withval" ;;
-           esac
-       ])
-    AC_PATH_PROG(GNUPLOT,gnuplot,,$LOCSYSPATH)
-
-    AC_ARG_VAR(GNUPLOT, [Location of the 'gnuplot' binary])
-    AC_SUBST(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
@@ -306,9 +277,9 @@ AC_DEFUN([AMANDA_PROG_MAILER],
 AC_DEFUN([AMANDA_PROG_MT],
 [
     AC_REQUIRE([AMANDA_INIT_PROGS])
-    AC_PATH_PROG(MT,mt,mt,$LOCSYSPATH)
+    AC_PATH_PROG(MT,mt,mt,$SYSLOCPATH)
 
-    case "$target" in
+    case "$host" in
        *-hp-*) MT_FILE_FLAG="-t" ;;
        *) MT_FILE_FLAG="-f" ;;
     esac
@@ -320,30 +291,11 @@ AC_DEFUN([AMANDA_PROG_MT],
 ])
 
 
-AC_DEFUN([AMANDA_PROG_CHIO],
-[
-    AC_REQUIRE([AMANDA_INIT_PROGS])
-    AC_PATH_PROG(CHIO,chio,chio,$LOCSYSPATH)
-])
-
-
-AC_DEFUN([AMANDA_PROG_CHS],
-[
-    AC_REQUIRE([AMANDA_INIT_PROGS])
-    AC_PATH_PROG(CHS,chs,chs,$LOCSYSPATH)
-])
-
-
 AC_DEFUN([AMANDA_PROG_MTX],
 [
     AC_REQUIRE([AMANDA_INIT_PROGS])
     AC_PATH_PROG(MTX,mtx,mtx,$LOCSYSPATH)
-])
-
-AC_DEFUN([AMANDA_PROG_MCUTIL],
-[
-    AC_REQUIRE([AMANDA_INIT_PROGS])
-    AC_PATH_PROG(MCUTIL,mcutil,mcutil,$LOCSYSPATH)
+    AC_ARG_VAR([MTX], [Path to the 'mtx' binary])
 ])
 
 AC_DEFUN([AMANDA_PROG_PCAT],
@@ -367,7 +319,10 @@ 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)
+    # 1.3.39 is required for the %begin block
+    AC_PROG_SWIG([1.3.39])
 ])
 
 AC_DEFUN([AMANDA_PROG_AR],
@@ -394,3 +349,27 @@ 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)
+])
+
+AC_DEFUN([AMANDA_PROG_LEX],
+[
+    AC_REQUIRE([AM_PROG_LEX])
+    AC_REQUIRE([AMANDA_PROG_GREP])
+    if test x"$LEX" != x""; then
+       AC_MSG_CHECKING([whether lex is broken Solaris (SGU) lex])
+       $LEX -V < /dev/null >/dev/null 2>conftest.out
+       if grep SGU conftest.out >/dev/null; then
+           AC_MSG_RESULT([yes - disabled (set LEX=/path/to/lex to use a specific binary)])
+           LEX='echo no lex equivalent available; false'
+       else
+           AC_MSG_RESULT([no])
+       fi
+       rm conftest.out
+    fi
+])
+