Hi PCB developers,

I've been working on an automated installer for the entire gEDA Suite,
including PCB.   PCB has a couple of pre-requisites which make it not
install cleanly on a stock "Red Hat 9 Professional" installation,
which is one of my target platforms.

Specifically, PCB has two issues:

1.  It needs wish, which is part of Tcl/Tk.  Configure fails when it
doesn't find wish.  Ummm, I am not a PCB expert.  Why does it need
wish?  

Tcl/Tk is not installed as part of a vanilla RH9 Pro
installation.  Don't ask me why. . . . . 

Note that I have fixed this problem by checking for Tcl/Tk as part of
my installation process, and installing it if necessary.  No action is
needed on your part.

2.  PCB's docs need TeX/LaTeX to convert the .texi docs to .pdf and
.dvi.  RH9 doesn't install TeX/LaTeX as part of a vanilla install.
Again, don't ask me why; I'm just (writing) the installer.

I have fixed this problem by putting checks into PCB's configure.in
and Makefile.am which look for a tex installation, and then just don't
build the docs from .texi files if tex is missing.  I've tested this
stuff on my RH9 box and it seems to work.  Please find these patches
below.  Feel free to test them and include them into PCB.

Thanks,

Stuart

--- pcb-20040903/configure.ac   2004-09-03 00:28:11.000000000 -0400
+++ pcb-20040903-sdb/configure.ac          2004-10-13 08:10:56.000000000 -0400
@@ -25,9 +25,27 @@
 GNUM4=$M4
 AC_SUBST(GNUM4)
 AC_DEFINE_UNQUOTED(GNUM4,"$M4",[m4 program used by pcb])
-AC_CHECK_PROGS(LATEX, latex)
-AC_CHECK_PROGS(DVIPS, dvips)
-AC_CHECK_PROGS(TGIF, tgif, true)
+
+dnl Changes made by SDB to prevent build failure if user doesn't have
+dnl documentation build tools latex or dvips installed.
+AC_PATH_PROGS(LATEX, latex, no, ${PATH})
+AM_CONDITIONAL(HASTEX, test $LATEX != no)
+dnl  Specifically prevent doc build from pcb.texi in docs dir . . . .
+if test "x$LATEX" = "xno"; then
+   PCB_TEXI=""
+else
+       PCB_TEXI="pcb.texi"
+fi
+AC_SUBST(PCB_TEXI)
+
+AC_PATH_PROGS(DVIPS, dvips, no, ${PATH})
+AM_CONDITIONAL(HASDVIPS, test $DVIPS != no)
+
+AC_PATH_PROGS(TGIF, tgif, no, ${PATH})
+AM_CONDITIONAL(HASTGIF, test $TGIF != no)
+
+
+
 
 dnl Checks for libraries.
 AC_CHECK_LIB(m, sqrt)
--- pcb-20040903/doc/Makefile.am        2004-08-26 21:53:53.000000000 -0400
+++ pcb-20040903-sdb/doc/Makefile.am    2004-10-13 08:09:36.000000000 -0400
@@ -26,14 +26,18 @@
 ##  RCS: $Id: Makefile.am,v 1.5 2004/08/27 01:53:53 danmc Exp $
 ##
 
-info_TEXINFOS= pcb.texi
+##  Make pcb.texi a conditional variable so that latex and 
+##  associated progs are not invoked if it doesn't exist.
+TEXI_SOURCES=  @PCB_TEXI@
+
 pkgdata_DATA=  ${html_docs} ${ps_docs} ${pdf_docs}
 
 man_MANS=      pcb.1
 
-html_docs=     ${info_TEXINFOS:.texi=.html}
-ps_docs=       ${info_TEXINFOS:.texi=.ps} refcard.ps
-pdf_docs=      ${info_TEXINFOS:.texi=.pdf} refcard.pdf
+html_docs=     ${TEXI_SOURCES:.texi=.html}
+ps_docs=       ${TEXI_SOURCES:.texi=.ps} refcard.ps
+pdf_docs=      ${TEXI_SOURCES:.texi=.pdf} refcard.pdf
+dvi_docs=      ${TEXI_SOURCES:.texi=.dvi}
 
 EXTRA_DIST= \
             ${man_MANS} \
@@ -75,19 +79,65 @@
 .texi.html:
        $(MAKEINFO) --html $<
 
+##-----------------------------------------------------------------------
+## This stuff inserted by SDB so that PCB would build (and not bomb) on
+## systems lacking Tex or Latex.
+.texi.dvi:
+if HASTEX
+   TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+   MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+   $(TEXI2DVI) `test -f '$<' || echo '$(srcdir)/'`$<
+else
+       echo "You don't have Tex or Latex installed, so I can't \
+build .dvi documentation from .texi files."
+endif
+
+.texi.pdf:
+if HASTEX
+   TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+   MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+   $(TEXI2PDF) `test -f '$<' || echo '$(srcdir)/'`$<
+else 
+     echo "You don't have Tex or Latex installed, so I can't \
+build .pdf documentation from .texi files."
+endif
+
+.dvi.ps:
+if HASDVIPS
+   $(DVIPS) $< -o $@
+else 
+     echo "You don't have dvips installed, so I can't \
+build .ps documentation from .dvi files."
+endif
+
+
+##-----------------------------------------------------------------------
+
 .PHONY: html
 html: version.texi $(html_docs)
 
-
 .PHONY: ps
 ps: version.texi $(ps_docs)
 
 .PHONY: pdf
 pdf: version.texi $(pdf_docs)
 
+##-----------------------------------------------------------------------
+##  Modified by SDB to prevent build failure if user doesn't have
+##  latex or dvips installed.
 refcard.dvi: refcard.tex
+if HASTEX
    ${LATEX} ${srcdir}/refcard.tex
+else
+       echo "You don't have Tex or Latex installed, so I can't \
+build refcard.dvi from refcard.tex "
+endif
 
 refcard.ps: refcard.dvi
+if HASDVIPS
    ${DVIPS} -Ppdf -j0 -D 300 -o $@ refcard.dvi
+else
+       echo "You don't have dvips installed, so I can't \
+build refcard.ps from refcard.dvi."
+endif

Reply via email to