dnl check for image conversion tool
AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, true, false)
+dnl The following is a hack: if fig2dev doesn't display an error message
+dnl for the desired type, we assume it supports it.
+HAVE_FIG2DEV_PNG=false
+if test "x$HAVE_FIG2DEV" = "xtrue" ; then
+ fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
+ if test "x$fig2dev_quiet" = "x" ; then
+ HAVE_FIG2DEV_PNG=true
+ fi
+fi
+HAVE_FIG2DEV_EPS=false
+if test "x$HAVE_FIG2DEV" = "xtrue" ; then
+ fig2dev_quiet=`fig2dev -L eps </dev/null 2>&1 >/dev/null`
+ if test "x$fig2dev_quiet" = "x" ; then
+ HAVE_FIG2DEV_EPS=true
+ fi
+fi
+
dnl Set up conditionals for (target) architecture:
dnl ==============================================
AM_CONDITIONAL(HAVE_DB2HTML, $HAVE_DB2HTML)
AM_CONDITIONAL(HAVE_DB2PS, $HAVE_DB2PS)
AM_CONDITIONAL(HAVE_PS2PDF, $HAVE_PS2PDF)
-AM_CONDITIONAL(HAVE_FIG2DEV, $HAVE_FIG2DEV)
+AM_CONDITIONAL(HAVE_FIG2DEV_PNG, $HAVE_FIG2DEV_PNG)
+AM_CONDITIONAL(HAVE_FIG2DEV_EPS, $HAVE_FIG2DEV_EPS)
AM_CONDITIONAL(HAVE_CDPARANOIA, test "x$HAVE_CDPARANOIA" = "xyes")
AM_CONDITIONAL(HAVE_LIBLAME, test "x$HAVE_LIBLAME" = "xyes")
AM_CONDITIONAL(HAVE_LIBESD, test "x$HAVE_LIBESD" = "xyes")
PDFFILES=$(manualname).pdf
PSFILES=$(manualname).ps
-if HAVE_FIG2DEV
+if HAVE_FIG2DEV_PNG
$(manualname)/$(htmlname): $(sgml_files) $(png_files)
else
$(manualname)/$(htmlname): $(sgml_files)
echo "Can't build $@: don't have ps2pdf tool"
endif
-if HAVE_FIG2DEV
+if HAVE_FIG2DEV_EPS
$(manualname).ps: $(sgml_files) $(eps_files)
else
$(manualname).ps: $(sgml_files)
endif
-if HAVE_PS2PDF
+if HAVE_DB2PS
@if [ -r $< ] ; then db2ps $(manualname).sgml ; fi
else
echo "Can't build $@: don't have db2ps tool"
images :
mkdir images
+if HAVE_FIG2DEV_PNG
images/%.png : %.fig images
fig2dev -L png -s 16 $< $@
+endif
+if HAVE_FIG2DEV_EPS
images/%.eps : %.fig images
fig2dev -L eps -s 16 -m 0.5 $< $@
+endif
$(manualname)/images:
@ln -sf ../images $(manualname)/images