summaryrefslogtreecommitdiff
path: root/libgphoto2_port/gphoto-m4/gp-manual-graphviz.m4
blob: 3b6f87d23a9cc1613a7d851c8312e155901b87ed (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
# gp-manual-graphviz.m4 - look for graphviz dot tool; check it -*- Autoconf -*-
# serial 13
dnl | Increment the above serial number every time you edit this file.
dnl | When it finds multiple m4 files with the same name,
dnl | aclocal will use the one with the highest serial.
dnl
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)

])
dnl
dnl
dnl ####################################################################
dnl
dnl Local Variables:
dnl mode: autoconf
dnl End: