Remove generated files
[framework/connectivity/libgphoto2.git] / libgphoto2_port / m4 / gp-manual-pstoimg.m4
1 dnl ---------------------------------------------------------------------------
2 dnl pstoimg: This program is needed for processing images. If not found,
3 dnl          documentation can still be built, but without figures.
4 dnl ---------------------------------------------------------------------------
5 AC_DEFUN([GP_CHECK_PSTOIMG],
6 [
7 AC_REQUIRE([GP_CHECK_DOT])dnl for creating tesseract.ps
8
9 try_pstoimg=true
10 have_pstoimg=false
11 AC_ARG_WITH(pstoimg, AS_HELP_STRING([--without-pstoimg], [Do not use pstoimg]),[
12         if test "x$withval" = "xno"; then
13                 try_pstoimg=false
14         fi])
15 if $try_pstoimg; then
16         AC_PATH_PROG(PSTOIMG,pstoimg)
17         if test -n "${PSTOIMG}"; then
18                 have_pstoimg=true
19         fi
20 fi
21 if $have_pstoimg; then
22         AC_SUBST(PSTOIMG)
23         AC_MSG_CHECKING([whether ${PSTOIMG} works])
24         rm -f tesseract.png
25         ${PSTOIMG} -type png -scale 1.2 -antialias -crop a tesseract.ps > /dev/null
26         if test $? != 0 || test ! -f tesseract.png; then
27                 have_pstoimg=false
28                 AC_MSG_RESULT(no)
29         else
30                 AC_MSG_RESULT(yes)
31         fi
32         rm -f tesseract.png
33 fi
34 AM_CONDITIONAL(ENABLE_PSTOIMG, $have_pstoimg)
35
36 ])