-
Notifications
You must be signed in to change notification settings - Fork 5
/
gp-manual-graphviz.m4
49 lines (47 loc) · 1.18 KB
/
gp-manual-graphviz.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
dnl ---------------------------------------------------------------------------
dnl dot: This program is needed for processing images. If not found,
dnl documentation can still be built, but without figures.
dnl ---------------------------------------------------------------------------
AC_DEFUN([GP_CHECK_DOT],
[
try_dot=true
have_dot=false
AC_ARG_WITH(dot, AS_HELP_STRING([--without-dot], [Do not use dot]), [
if test "x$withval" = "xno"; then
try_dot=false
fi])
if $try_dot; then
AC_PATH_PROG(DOT,dot)
if test -n "${DOT}"; then
have_dot=true
fi
fi
if $have_dot; then
AC_SUBST(DOT)
AC_MSG_CHECKING([whether ${DOT} works])
${DOT} -Tps -o tesseract.ps 2> /dev/null <<EOF
graph tesseract {
node [[shape=point]];
o -- {a;b;c;d;}
a -- {ab;ac;ad;}
b -- {ab;bc;bd;}
c -- {ac;bc;cd;}
d -- {ad;bd;cd;}
ab -- {abc;abd;}
ac -- {abc;acd;}
ad -- {abd;acd;}
bc -- {abc;bcd;}
bd -- {abd;bcd;}
cd -- {acd;bcd;}
{abc;abd;acd;bcd;} -- abcd;
}
EOF
if test $? != 0 || test ! -f tesseract.ps; then
have_dot=false
AC_MSG_RESULT([no (see http://www.graphviz.org/ ...)])
else
AC_MSG_RESULT(yes)
fi
fi
AM_CONDITIONAL(ENABLE_GRAPHS, $have_dot)
])