Add tests for -L png and -L eps arguments to fig2dev.
authorRichard Boulton <richard@tartarus.org>
Sun, 7 Jan 2001 13:58:57 +0000 (13:58 +0000)
committerRichard Boulton <richard@tartarus.org>
Sun, 7 Jan 2001 13:58:57 +0000 (13:58 +0000)
Original commit message from CVS:
Add tests for -L png and -L eps arguments to fig2dev.
Correct slip in docs/manuals.mak which used HAVE_DB2PS instead of
HAVE_PS2PDF.

configure.in
docs/manuals.mak

index 2651de3..6b312d4 100644 (file)
@@ -76,6 +76,23 @@ AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, true, false)
 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 ==============================================
@@ -496,7 +513,8 @@ AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
 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")
index 4bba6ae..dcdd1f0 100644 (file)
@@ -10,7 +10,7 @@
 PDFFILES=$(manualname).pdf
 PSFILES=$(manualname).ps
 
-if HAVE_FIG2DEV
+if HAVE_FIG2DEV_PNG
 $(manualname)/$(htmlname): $(sgml_files) $(png_files)
 else
 $(manualname)/$(htmlname): $(sgml_files)
@@ -29,12 +29,12 @@ else
        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"
@@ -43,11 +43,15 @@ endif
 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