summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBertrand Garrigues <bertrand.garrigues@laposte.net>2018-12-18 18:57:16 +0100
committerBertrand Garrigues <bertrand.garrigues@laposte.net>2018-12-18 22:13:01 +0100
commitb78b8ba1a973421ad00770fc10bcd894fc7fc717 (patch)
tree54bac15e3a8610d898ed8900a594e7a0d270ce19
parent255f4ce6d9e2db9a6625724813379438b665aca7 (diff)
Fix 'dvi' and 'pdf' texinfo doc generation.1.22.4.rc5
GNU make has a built-in variable 'TEXI2DVI' but it is not the case of all 'make' implementations, which causes 'make doc' to fail with an unclear message although 'texi2dvi' is available. Also, 'texi2dvi' is invoked inconditionnally. * m4/groff.m4 (GROFF_TEXI2DVI): new macro to detect properly the presence of 'texi2dvi'. * configure.ac: use 'GROFF_TEXI2DVI' and define automake conditional 'HAVE_TEXI2DVI'. * doc/doc.am: - Define TEXI2DVI to 'texi2dvi'. - Print an error message if 'texi2dvi' is not available.
-rw-r--r--ChangeLog19
-rw-r--r--configure.ac2
-rw-r--r--doc/doc.am16
-rw-r--r--m4/groff.m411
4 files changed, 47 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5de9469aa..835d26c38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2018-12-18 Bertrand Garrigues <bertrand.garrigues@laposte.net>
+
+ Fix 'dvi' and 'pdf' texinfo doc generation.
+
+ GNU make has a built-in variable 'TEXI2DVI' but it is not the case
+ of all 'make' implementations, which causes 'make doc' to fail
+ with an unclear message although 'texi2dvi' is available. Also,
+ 'texi2dvi' is invoked inconditionnally.
+
+ * m4/groff.m4 (GROFF_TEXI2DVI): new macro to detect properly the
+ presence of 'texi2dvi'.
+
+ * configure.ac: use 'GROFF_TEXI2DVI' and define automake conditional
+ 'HAVE_TEXI2DVI'.
+
+ * doc/doc.am:
+ - Define TEXI2DVI to 'texi2dvi'.
+ - Print an error message if 'texi2dvi' is not available.
+
2018-12-08 Bertrand Garrigues <bertrand.garrigues@laposte.net>
Install texinfo doc on 'make install-pdf' and 'make install-html'
diff --git a/configure.ac b/configure.ac
index e0a049f65..28e75f175 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,7 @@ AC_PROG_EGREP
GROFF_PROG_YACC
GROFF_DOC_CHECK
GROFF_MAKEINFO
+GROFF_TEXI2DVI
AC_PROG_RANLIB
GROFF_INSTALL_SH
GROFF_INSTALL_INFO
@@ -200,6 +201,7 @@ AM_CONDITIONAL([BUILD_OTHERDOC], [test -n "$make_otherdoc"])
AM_CONDITIONAL([BUILD_EXAMPLES], [test -n "$make_examples"])
AM_CONDITIONAL([INSTALL_SHIPPED_HTML], [test -n "$make_install_shipped_htmldoc"])
AM_CONDITIONAL([HAVE_PDFTOOLS], [test "x$groff_have_pdftools" = "xyes" ])
+AM_CONDITIONAL([HAVE_TEXI2DVI], [test "x$groff_have_texi2dvi" = "xyes" ])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([test-groff], [chmod +x test-groff])
diff --git a/doc/doc.am b/doc/doc.am
index 97332d74a..a3a2ff0bd 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -315,6 +315,12 @@ build_infodoc:
endif
EXTRA_DIST += doc/groff.texi doc/fdl.texi
+# GNU Make has a built-in variable TEXI2DVI but it is not the case of
+# all 'make' implementation. As it default to 'texi2dvi' we simply
+# redefine it here.
+
+TEXI2DVI = texi2dvi
+texi2dvi_missing = no
# Rules to generate various doc files from .texi files.
.texi.txt:
@$(MKDIR_P) $(doc_builddir)
@@ -323,20 +329,30 @@ EXTRA_DIST += doc/groff.texi doc/fdl.texi
$(MAKEINFO) --enable-encoding -I$(doc_srcdir) --plaintext -o $@ $<
.texi.dvi:
+if HAVE_TEXI2DVI
@$(MKDIR_P) $(doc_builddir)
LANG=C \
LC_ALL=C \
TEXINPUTS="$(top_srcdir)/build-aux:$(TEXINPUTS)" \
MAKEINFO='$(MAKEINFO) -I $(doc_srcdir)' \
$(TEXI2DVI) -e --batch --build-dir=doc/`basename $@`.t2d -o $@ $<
+else
+ @echo "Program texi2dvi is missing, cannot generate dvi doc"; \
+ exit 1
+endif
.texi.pdf:
+if HAVE_TEXI2DVI
@$(MKDIR_P) $(doc_builddir)
LANG=C \
LC_ALL=C \
TEXINPUTS="$(top_srcdir)/build-aux:$(TEXINPUTS)" \
MAKEINFO='$(MAKEINFO) -I $(doc_srcdir)' \
$(TEXI2DVI) -e --batch --pdf --build-dir=doc/`basename $@`.t2p -o $@ $<
+else
+ @echo "Program texi2dvi is missing, cannot generate pdf doc"; \
+ exit 1
+endif
# This will generate both html split into several files and html doc
# in a single file. If texinfo version < 5.0, we process the resulting
diff --git a/m4/groff.m4 b/m4/groff.m4
index 75aa3e25b..5343f22f5 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -209,6 +209,15 @@ AC_DEFUN([GROFF_MAKEINFO],
AC_SUBST([make_uninstall_infodoc])
AC_SUBST([makeinfo_version_numeric])])
+AC_DEFUN([GROFF_TEXI2DVI],
+ [AC_CHECK_PROG([PROG_TEXI2DVI], [texi2dvi], [found], [missing])
+ if test "x$PROG_TEXI2DVI" = "xfound"; then
+ groff_have_texi2dvi=yes;
+ else
+ groff_have_texi2dvi=no;
+ fi
+ ])
+
# The following programs are needed for grohtml.
AC_DEFUN([GROFF_HTML_PROGRAMS],
@@ -1585,7 +1594,7 @@ AC_DEFUN([GROFF_REFERDIR_DEFAULT],
AC_DEFUN([GROFF_PROG_XPMTOPPM],
[AC_CHECK_PROG([XPMTOPPM], [xpmtoppm], [found], [missing])])
-# Check for make builtin variable RM
+# Check for make built-in variable RM
AC_DEFUN([GROFF_MAKE_RM],
[AC_MSG_CHECKING(whether make has builtin variable RM)
cat <<EOF > test_make_rm.mk