[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 15/16: Weaken build dependency on TeX.
From: |
G. Branden Robinson |
Subject: |
[groff] 15/16: Weaken build dependency on TeX. |
Date: |
Thu, 9 Jun 2022 23:59:15 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 31f64af693b077b846ac2540f4ea2baf95c4ef10
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Jun 9 16:45:42 2022 -0500
Weaken build dependency on TeX.
[build]: Weaken dependency on TeX, instead using it (to generate the DVI
and PDF forms of our Texinfo manual) only if it is available.
* m4/groff.m4 (GROFF_USE_TEX_CHECK): Check for presence of 'tex'
executable in path. Set shell variable `groff_use_tex` to "yes" if
present, and "no" otherwise. This check runs only if the 'makeinfo'
and 'texi2dvi' version checks have already passed.
* configure.ac: Run the new check. Set Automake conditional `USE_TEX`
only if shell variable `groff_use_tex` is "yes". Report whether
"groff.dvi" and "groff.pdf" are (re-)buildable.
* doc/doc.am: Parameterize names of groff.{dvi,pdf} targets as Make
macros `GROFF_DVI` and `GROFF_PDF`. Define them only if `USE_TEX`.
Do _not_ update `EXTRA_DIST` macro; leave the literal file names there
because we require that distribution archives contain these files.
(.texi.dvi, .texi.pdf): Update suffix rules to check `USE_TEX` and
fail, complaining of missing 'tex' program, if these targets are
attempted without it being true. Only manually specifying the file
names as targets to 'make' or attempting to generate a distribution
archive without TeX present should cause these errors.
* INSTALL.REPO: Update dependency information.
Fixes <https://savannah.gnu.org/bugs/?62592>. Thanks to Deri James for
the report.
---
ChangeLog | 32 ++++++++++++++++++++++++++++++++
INSTALL.REPO | 6 +++++-
configure.ac | 3 +++
doc/doc.am | 23 +++++++++++++++++++----
m4/groff.m4 | 10 ++++++++++
5 files changed, 69 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1179e02e..ce454eb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2022-06-09 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [build]: Weaken dependency on TeX, instead using it (to generate
+ the DVI and PDF forms of our Texinfo manual) only if it is
+ available.
+
+ * m4/groff.m4 (GROFF_USE_TEX_CHECK): Check for presence of 'tex'
+ executable in path. Set shell variable `groff_use_tex` to "yes"
+ if present, and "no" otherwise. This check runs only if the
+ 'makeinfo' and 'texi2dvi' version checks have already passed.
+
+ * configure.ac: Run the new check. Set Automake conditional
+ `USE_TEX` only if shell variable `groff_use_tex` is "yes".
+ Report whether "groff.dvi" and "groff.pdf" are (re-)buildable.
+
+ * doc/doc.am: Parameterize names of groff.{dvi,pdf} targets as
+ Make macros `GROFF_DVI` and `GROFF_PDF`. Define them only if
+ `USE_TEX`. Do _not_ update `EXTRA_DIST` macro; leave the
+ literal file names there because we require that distribution
+ archives contain these files.
+ (.texi.dvi, .texi.pdf): Update suffix rules to check `USE_TEX`
+ and fail, complaining of missing 'tex' program, if these targets
+ are attempted without it being true. Only manually specifying
+ the file names as targets to 'make' or attempting to generate a
+ distribution archive without TeX present should cause these
+ errors.
+
+ * INSTALL.REPO: Update dependency information.
+
+ Fixes <https://savannah.gnu.org/bugs/?62592>. Thanks to Deri
+ James for the report.
+
2022-06-09 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/doc.am (.texi.dvi, .texi.pdf, $(DOC_GNU_EPS)): Quote names
diff --git a/INSTALL.REPO b/INSTALL.REPO
index 066cb77d..e6cf192c 100644
--- a/INSTALL.REPO
+++ b/INSTALL.REPO
@@ -35,7 +35,11 @@ are several others.
* groff's Texinfo manual is generated in several formats: GNU Info,
HTML, plain text, TeX DVI, and PDF. The former three require
'makeinfo' from GNU Texinfo 5.0 or later. The latter two additionally
- require a TeX installation, such as TeX Live.
+ require a TeX installation, such as TeX Live. If TeX is not
+ installed, the DVI and PDF formats of the manual cannot be generated.
+ This will cause a build failure only if the Texinfo source file
+ "groff.texi" is updated and the make(1) "dist" or relevant file
+ targets are manually specified.
* You will need the 'xpmtoppm', 'pnmdepth', and 'pnmtops' programs from
the Netpbm distribution.
diff --git a/configure.ac b/configure.ac
index b2d6df94..ef06727a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,7 @@ GROFF_PROG_YACC
GROFF_PROG_M4
GROFF_PROG_MAKEINFO
GROFF_PROG_TEXI2DVI
+GROFF_USE_TEX_CHECK
AC_PROG_RANLIB
GROFF_INSTALL_SH
GROFF_INSTALL_INFO
@@ -207,6 +208,7 @@ AM_CONDITIONAL([USE_GROFF_ALLOCATOR],
AM_CONDITIONAL([HAVE_URW_FONTS], [test "$groff_have_urw_fonts" = yes ])
AM_CONDITIONAL([HAVE_PDFTOOLS], [test "$groff_have_pdftools" = yes ])
AM_CONDITIONAL([HAVE_TEXI2DVI], [test "$groff_have_texi2dvi" = yes ])
+AM_CONDITIONAL([USE_TEX], [test "$groff_use_tex" = yes ])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([test-groff], [chmod +x test-groff])
@@ -244,6 +246,7 @@ echo "\
'groff -l' uses print spooler : $groff_have_spooler
use URW fonts for PDF output : $groff_have_urw_fonts
preconv can use uchardet library : $groff_have_uchardet
+ can build groff.dvi, groff.pdf : $groff_use_tex
tests can use poppler PDF tools : $groff_have_pdftools
----------------------------------------------------------------------"
diff --git a/doc/doc.am b/doc/doc.am
index 77c60779..cede334d 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -503,8 +503,13 @@ endif
#info_TEXINFOS = doc/groff.texi
#doc_groff_TEXINFOS = doc/fdl.texi
-all: doc/groff.info doc/groff.txt doc/groff.html doc/groff.dvi \
- doc/groff.pdf
+if USE_TEX
+GROFF_DVI = doc/groff.dvi
+GROFF_PDF = doc/groff.pdf
+endif
+
+all: doc/groff.info doc/groff.txt doc/groff.html $(GROFF_DVI) \
+ $(GROFF_PDF)
# Distribute the manual in source form as well.
EXTRA_DIST += doc/groff.texi doc/fdl.texi
@@ -561,6 +566,7 @@ EXTRA_DIST += doc/groff.dvi doc/groff.pdf
# 'install-pdf' and 'install-dvi' are standard Automake targets.
.texi.dvi:
if HAVE_TEXI2DVI
+if USE_TEX
$(AM_V_at)$(MKDIR_P) $(doc_builddir)
$(AM_V_GEN)LANG=C \
LC_ALL=C \
@@ -569,14 +575,19 @@ if HAVE_TEXI2DVI
FORCE_SOURCE_DATE=1 \
$(PROG_TEXI2DVI) -e --batch --build-dir=doc/`basename $@`.t2d \
-o $@ $<
+else
+ @echo "program 'tex' is missing; cannot generate $@" >&2; \
+ exit 1
+endif # USE_TEX
else
@echo "program 'texi2dvi' is missing or too old;" \
"cannot generate $@" >&2; \
exit 1
-endif
+endif # HAVE_TEXI2DVI
.texi.pdf:
if HAVE_TEXI2DVI
+if USE_TEX
$(AM_V_at)$(MKDIR_P) $(doc_builddir)
$(AM_V_GEN)LANG=C \
LC_ALL=C \
@@ -584,11 +595,15 @@ if HAVE_TEXI2DVI
MAKEINFO='$(MAKEINFO) -I $(doc_srcdir)' \
$(PROG_TEXI2DVI) -e --batch --pdf \
--build-dir=doc/`basename $@`.t2p -o $@ $<
+else
+ @echo "program 'tex' is missing; cannot generate $@" >&2; \
+ exit 1
+endif # USE_TEX
else
@echo "program 'texi2dvi' is missing or too old;" \
"cannot generate $@" >&2; \
exit 1
-endif
+endif # HAVE_TEXI2DVI
install-doc: install-pdf install-html
diff --git a/m4/groff.m4 b/m4/groff.m4
index a72acb5f..8740ce10 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -161,6 +161,16 @@ AC_DEFUN([GROFF_PROG_TEXI2DVI], [
fi
])
+# 'texi2dvi' can be installed without TeX itself, so check for a 'tex'
+# executable independently.
+
+AC_DEFUN([GROFF_USE_TEX_CHECK], [
+ AC_REQUIRE([GROFF_PROG_TEXI2DVI])
+ AC_CHECK_PROG([PROG_TEX], [tex], [found], [missing])
+ groff_use_tex=no
+ test "$PROG_TEX" = found && groff_use_tex=yes
+])
+
# grohtml needs the following programs to produce images from tbl(1)
# tables and eqn(1) equations.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 15/16: Weaken build dependency on TeX.,
G. Branden Robinson <=