Improve the documentation build process.

The choice between troff implementations is now made at configure time,
rather than using shell logic in the Makefile to choose while building.
This commit is contained in:
John "Elwin" Edwards 2017-12-30 14:15:52 -05:00
parent 7fac45d848
commit bb37c1c3f7
12 changed files with 180 additions and 54 deletions

View file

@ -78,12 +78,14 @@ clean:
docs: $(DOCS)
$(PROGRAM).doc: rogue.nr
if test "x$(GROFF)" != "x" ; then \
$(GROFF) -P-c -P-b -P-u -t -mm -Tascii rogue.nr >$(PROGRAM).doc ;\
elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then \
$(TBL) rogue.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\
fi
$(PROGRAM).doc@DOCS_GROFF@: rogue.nr
$(GROFF) -P-c -P-b -P-u -t -mm -Tascii rogue.nr >$(PROGRAM).doc
$(PROGRAM).doc@DOCS_NROFF@: rogue.nr
$(TBL) rogue.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc
$(PROGRAM).doc@DOCS_NONE@: rogue.nr
@echo "Not building" $(PROGRAM).doc
install: all
touch test

View file

@ -32,6 +32,24 @@ AC_CHECK_PROG([GROFF], [groff], [groff],)
AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
AC_CHECK_PROG([TBL], [tbl], [tbl],)
if test "x$GROFF" != "x" ; then
DOCS_GROFF=
DOCS_NROFF=.no-nroff
DOCS_NONE=.none
elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then
DOCS_GROFF=.no-groff
DOCS_NROFF=
DOCS_NONE=.none
else
DOCS_GROFF=.no-groff
DOCS_NROFF=.no-nroff
DOCS_NONE=
fi
AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="srogue"] )
PROGRAM=$progname
AC_SUBST(PROGRAM)