Imported Upstream version 2.6.0
[debian/amanda] / config / amanda / amplot.m4
1 # OVERVIEW
2 #
3 #   'amplot' is largely pieced together by the instantiation phase of 
4 #   configure; that is handled here.
5
6 # SYNOPSIS
7 #
8 #   AMANDA_SETUP_AMPLOT
9 #
10 # DESCRIPTION
11 #
12 #   Check for the requirements for amplot, and set the Automake conditional
13 #   WANT_AMPLOT appropriately.  If amplot is to be built, then also set up
14 #   the required substitutions to build it correctly.
15 #
16 AC_DEFUN([AMANDA_SETUP_AMPLOT],
17 [
18     AC_REQUIRE([AMANDA_PROG_GNUPLOT])
19     AC_REQUIRE([AMANDA_PROG_PCAT])
20     AC_REQUIRE([AMANDA_PROG_COMPRESS])
21     AC_REQUIRE([AMANDA_PROG_GZIP])
22     AC_REQUIRE([AC_PROG_AWK])
23
24     if test "x$GNUPLOT" != "x"; then
25         WANT_AMPLOT=true
26
27         # variable substitutions for amcat.awk
28         if test "$PCAT"; then
29             AMPLOT_CAT_PACK="if(o==\"z\")print \"$PCAT\"; else"
30         else
31             AMPLOT_CAT_PACK=
32         fi
33         if test "$COMPRESS"; then
34             AMPLOT_COMPRESS=$COMPRESS
35             AMPLOT_CAT_COMPRESS="if(o==\"Z\")print \"$COMPRESS -dc\"; else"
36         else
37             AMPLOT_CAT_COMPRESS=
38         fi
39         if test "$GZIP"; then
40             AMPLOT_COMPRESS=$GZIP
41             AMPLOT_CAT_GZIP="if(o==\"gz\")print \"$GZIP -dc\"; else"
42         else
43             AMPLOT_CAT_GZIP=
44         fi
45
46         AC_SUBST(AMPLOT_COMPRESS)
47         AC_SUBST(AMPLOT_CAT_GZIP)
48         AC_SUBST(AMPLOT_CAT_COMPRESS)
49         AC_SUBST(AMPLOT_CAT_PACK)
50     else
51         WANT_AMPLOT=false
52         AMANDA_MSG_WARN([Not building 'amplot', because gnuplot was not found])
53     fi
54
55     AM_CONDITIONAL(WANT_AMPLOT, test x"$WANT_AMPLOT" = x"true")
56 ])