Skip to content

Commit

Permalink
maint: check for dot before using it
Browse files Browse the repository at this point in the history
* configure.ac: here.
* doc/Makefile.am: Use $(DOT).
Ship the generated files, to spare the user the need for Graphviz.
  • Loading branch information
akimd committed Oct 19, 2012
1 parent fc4fdd6 commit a029e56
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
25 changes: 13 additions & 12 deletions README-hacking
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,17 @@ These requirements do not apply when building from a distribution tarball.

** Requirements

We've opted to keep only the highest-level sources in the repository.
This eases our maintenance burden, (fewer merges etc.), but imposes more
We've opted to keep only the highest-level sources in the repository. This
eases our maintenance burden, (fewer merges etc.), but imposes more
requirements on anyone wishing to build from the just-checked-out sources.
For example, you have to use the latest stable versions of the maintainer
tools we depend upon, including:

- Automake <http://www.gnu.org/software/automake/>
- Autoconf <http://www.gnu.org/software/autoconf/>
- Automake <http://www.gnu.org/software/automake/>
- Flex <http://www.gnu.org/software/flex/>
- Gettext <http://www.gnu.org/software/gettext/>
- Graphviz <http://www.graphviz.org>
- Gzip <http://www.gnu.org/software/gzip/>
- Perl <http://www.cpan.org/>
- Rsync <http://samba.anu.edu.au/rsync/>
Expand All @@ -61,16 +62,16 @@ tools we depend upon, including:
Valgrind <http://valgrind.org/> is also highly recommended, if it supports
your architecture.

Bison is written using Bison grammars, so there are bootstrapping
issues. The bootstrap script attempts to discover when the C code
generated from the grammars is out of date, and to bootstrap with an
out-of-date version of the C code, but the process is not foolproof.
Also, you may run into similar problems yourself if you modify Bison.
Bison is written using Bison grammars, so there are bootstrapping issues.
The bootstrap script attempts to discover when the C code generated from the
grammars is out of date, and to bootstrap with an out-of-date version of the
C code, but the process is not foolproof. Also, you may run into similar
problems yourself if you modify Bison.

Only building the initial full source tree will be a bit painful.
Later, after synchronizing from the repository a plain 'make' should
be sufficient. Note, however, that when gnulib is updated, running
'./bootstrap' again might be needed.
Only building the initial full source tree will be a bit painful. Later,
after synchronizing from the repository a plain 'make' should be sufficient.
Note, however, that when gnulib is updated, running './bootstrap' again
might be needed.

** First checkout

Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ AC_SUBST([YACC_SCRIPT])
AC_SUBST([YACC_LIBRARY])

# Checks for programs.
AM_MISSING_PROG([DOT], [dot])
AC_PROG_LEX
$LEX_IS_FLEX || AC_MSG_ERROR([Flex is required])
AC_PROG_YACC
Expand Down
17 changes: 10 additions & 7 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,29 @@ nodist_man_MANS = yacc.1
## ----------------------------- ##

CLEANDIRS += figs
EXTRA_DIST += figs/example-reduce.dot figs/example-shift.dot
FIGS_DOT = figs/example-reduce.dot figs/example-shift.dot
EXTRA_DIST += \
$(FIGS_DOT) \
$(FIGS_DOT:.dot=.eps) $(FIGS_DOT:.dot=.pdf) $(FIGS_DOT:.dot=.png)
SUFFIXES += .dot .eps .pdf .png

bison.dvi: figs/example-reduce.eps figs/example-shift.eps
bison.html: figs/example-reduce.png figs/example-shift.png
bison.pdf: figs/example-reduce.pdf figs/example-shift.pdf
bison.dvi: $(FIGS_DOT:.dot=.eps)
bison.html: $(FIGS_DOT:.dot=.png)
bison.pdf: $(FIGS_DOT:.dot=.pdf)

.dot.eps:
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
$(AM_V_at) dot -Teps $< >$@.tmp
$(AM_V_at) $(DOT) -Gmargin=0 -Teps $< >$@.tmp
$(AM_V_at) mv $@.tmp $@

.dot.pdf:
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
$(AM_V_at) dot -Tpdf -Gmargin=0 $< >$@.tmp
$(AM_V_at) $(DOT) -Gmargin=0 -Tpdf $< >$@.tmp
$(AM_V_at) mv $@.tmp $@

.dot.png:
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
$(AM_V_at) dot -Tpng $< >$@.tmp
$(AM_V_at) $(DOT) -Gmargin=0 -Tpng $< >$@.tmp
$(AM_V_at) mv $@.tmp $@

## -------------- ##
Expand Down

0 comments on commit a029e56

Please sign in to comment.