groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 33/45: Build texinfo doc.


From: Bertrand Garrigues
Subject: [groff] 33/45: Build texinfo doc.
Date: Tue, 11 Nov 2014 21:26:00 +0000

bgarrigues pushed a commit to branch automake3
in repository groff.

commit 6462950fc0b9082f35a33025135ed49b24a74bda
Author: Bertrand Garrigues <address@hidden>
Date:   Mon Sep 8 00:37:19 2014 +0200

    Build texinfo doc.
    
    By default only info doc is built.  Add optional targets to build
    html, pdf, txt, and dvi doc.
---
 TESTS          |   18 +++++++++-
 doc/doc.am     |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 doc/fixinfo.sh |    4 ++-
 m4/groff.m4    |   10 ++++--
 4 files changed, 128 insertions(+), 5 deletions(-)

diff --git a/TESTS b/TESTS
index 4d9bee5..25abda0 100644
--- a/TESTS
+++ b/TESTS
@@ -21,7 +21,7 @@ Current status
   - man files from 'man' directory installed
   - tmac files from 'tmac' directory installed
   - Build and installation of contrib
-  - Build and installation of doc, except texinfo doc
+  - Build and installation of doc, including texinfo doc
 
 Tests
 -----
@@ -180,6 +180,21 @@ from doc
   - gnu.eps
   - html and doc files
 
+from doc, texinfo files:
+
+  - By default, only doc/groff.info is built, as GNU standards require
+    to install only info doc.
+
+  - Additional optional targets are available to build the doc in various 
formats:
+    -- make doc_txt
+    -- make doc_dvi
+    -- make doc_pdf
+    -- make doc_html (this will build the html in 2 directories: all
+       in 1 .html file, and 1 file per node). Note also that if
+       texinfo version is < 5.0, the resulting (mono) file will be
+       patched by fixinfo.sh
+    -- make doc_all will build all the 4 previous formats
+
 In order to check and improve the dependencies, the following targets
 were built from a clean environment:
   - make lib/libgnu.a
@@ -365,6 +380,7 @@ Differences with former build system:
 
     -- webpageXX.html files
     -- picXX.html files
+    -- info file from groff.texinfo
 
 Diff with previous build system:
   - devcp1047 fonts are installed $(DESTDIR)/usr/local/groff/1.22.3/font
diff --git a/doc/doc.am b/doc/doc.am
index 596535b..fbb38be 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -22,6 +22,7 @@ doc_srcdir = $(abs_top_srcdir)/doc
 doc_builddir = $(abs_top_builddir)/doc
 
 DOC_GROFF=\
+  LANG=C LC_ALL=C \
   sed -e "s;@VERSION@;$(VERSION);" $< \
   | GROFF_COMMAND_PREFIX= \
     GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
@@ -233,6 +234,87 @@ uninstall_doc_htmldoc:
        -rmdir $(DESTDIR)$(htmldocdir)/$(imagedir)
        -rmdir $(DESTDIR)$(htmldocdir)
 
+# Texinfo doc
+#
+# Users who want to print out the groff manual are expected to have a
+# working TeX installation.  Note that texi2dvi properly honours the
+# `MAKEINFO' environment variable.
+#
+# We can't use automake's facilities because the make dist target attempts to 
+# generate a pdf version of groff.texi by invoking texi2dvi without the -e 
+# option, which is needed to build this file.
+# info_TEXINFOS = doc/groff.texi
+# doc_groff_TEXINFOS = doc/fdl.texi
+#
+# Note that GNU standards require to install only info doc.
+all: doc/groff.info
+groffinfodir = $(infodir)
+groffpdfdir = $(infodir)
+MOSTLYCLEANFILES += doc/groff.info doc/groff.info-2 doc/groff.info-2
+EXTRA_DIST += doc/groff.texi doc/fdl.texi
+doc/groff.info: $(doc_srcdir)/groff.texi
+       @$(MKDIR_P) $(doc_builddir)
+       LANG=C \
+       LC_ALL=C \
+       $(MAKEINFO) -o doc/groff.info --enable-encoding -I$(doc_srcdir) 
$(doc_srcdir)/groff.texi
+
+# Rules to generate various doc files from .texi files.
+.texi.txt:
+       @$(MKDIR_P) $(doc_builddir)
+       LANG=C \
+       LC_ALL=C \
+       $(MAKEINFO) --enable-encoding -I$(doc_srcdir) --plaintext -o $@ $<
+
+.texi.dvi:
+       @$(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 address@hidden -o $@ $<
+
+.texi.pdf:
+       @$(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 address@hidden 
-o $@ $<
+
+# 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
+# (mono) .html file with fixinfo.sh du to a problem with blockquote
+# closing (for example 5.6.1 Setting Registers, the 'Request'
+# blockquote is not properly closed, see fixinfo.sh for more details
+.texi.html:
+       @$(MKDIR_P) $(doc_builddir)/
+       @$(MKDIR_P) $(doc_builddir)/`basename address@hidden/
+       LANG=C \
+       LC_ALL=C \
+       $(MAKEINFO) --html -I $(doc_srcdir) \
+         -o doc/`basename address@hidden $<
+       LANG=C \
+       LC_ALL=C \
+       $(MAKEINFO) --html -I $(doc_srcdir) --no-split \
+         -o doc/`basename address@hidden/`basename address@hidden $<
+       if test "$(makeinfo_version_numeric)" -lt 5000; then \
+         echo "patching $@ with fixinfo.sh"; \
+         $(SHELL) $(doc_srcdir)/fixinfo.sh \
+           doc/`basename address@hidden/`basename address@hidden; \
+       fi
+
+# Targets to make all the doc in all formats. These doc are not built
+# by default.
+doc: doc_all
+doc_all: doc_txt dvi pdf html
+doc_txt: doc/groff.txt
+dvi: doc_dvi
+doc_dvi: doc/groff.dvi
+pdf: doc_pdf
+doc_pdf: doc/groff.pdf
+html: doc_html
+doc_html: doc/groff.html
+
 distclean-local: clean_infodoc clean_otherdoc
 maintainer-clean-local: clean_infodoc clean_otherdoc
 clean_infodoc:
@@ -241,6 +323,25 @@ clean_otherdoc:
        -cd $(doc_builddir) && \
          rm -rf *.pdf *.html *.txt *.dvi *.html.mono *.t2p *.t2d
 
+install-data-local: install_infodoc
+install_infodoc: doc/groff.info
+       -test -d $(DESTDIR)$(infodir) || $(mkinstalldirs) $(DESTDIR)$(infodir)
+         for p in doc/groff.info `ls doc/groff.info*`; do \
+           f=`basename $$p`; \
+           rm -f $(DESTDIR)$(infodir)/$$f; \
+           $(INSTALL_DATA) $$p $(DESTDIR)$(infodir)/$$f; \
+         done
+       $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) \
+         $(DESTDIR)$(infodir)/groff.info
+
+uninstall-local: uninstall_infodoc
+uninstall_infodoc:
+       -$(INSTALL_INFO) --remove --info-dir=$(DESTDIR)$(infodir) \
+         $(DESTDIR)$(infodir)/groff.info
+       -for f in `ls $(DESTDIR)$(infodir)/groff.info*`; do \
+         rm -f $$f; \
+       done
+
 # File used by contrib/hdtbl and contrib/pdfmark. It is distributed in
 # doc.eps. We try in priority to use the file in 'doc'.
 EXTRA_DIST += doc/gnu.xpm
diff --git a/doc/fixinfo.sh b/doc/fixinfo.sh
index 2c853f8..1c48d99 100644
--- a/doc/fixinfo.sh
+++ b/doc/fixinfo.sh
@@ -21,7 +21,9 @@
 # Note that this script is a quick hack and tightly bound to the current
 # groff.texinfo macro code.  Hopefully, a new texinfo version makes it
 # unnecessary.
-
+#
+# 09-2014: no more problem with texinfo 5.0 or higher
+#
 t=${TMPDIR-.}/gro$$.tmp
 
 cat $1 | sed '
diff --git a/m4/groff.m4 b/m4/groff.m4
index 4b34b7e..251b7ed 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -148,7 +148,11 @@ AC_DEFUN([GROFF_DOC_CHECK],
 # We need makeinfo 4.8 or newer.
 
 AC_DEFUN([GROFF_MAKEINFO],
-  [if test $docadd_info = yes; then
+  # By default automake will set MAKEINFO to MAKEINFO = ${SHELL} <top
+  # src dir>/build-aux/missing makeinfo.As we need a more precise
+  # check of makeinfo version, we don't use it.
+  [MAKEINFO=
+   if test $docadd_info = yes; then
      missing=
      AC_CHECK_PROG([MAKEINFO], [makeinfo], [makeinfo])
      if test -z "$MAKEINFO"; then
@@ -195,8 +199,8 @@ AC_DEFUN([GROFF_MAKEINFO],
    AC_SUBST([MAKEINFO])
    AC_SUBST([make_infodoc])
    AC_SUBST([make_install_infodoc])
-   AC_SUBST([make_uninstall_infodoc])])
-
+   AC_SUBST([make_uninstall_infodoc])
+   AC_SUBST([makeinfo_version_numeric])])
 
 # The following programs are needed for grohtml.
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]