[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/09: Add fine-tuning of doc generation to `configure'.
From: |
Werner LEMBERG |
Subject: |
[groff] 01/09: Add fine-tuning of doc generation to `configure'. |
Date: |
Sun, 30 Mar 2014 20:13:34 +0000 |
wl pushed a commit to branch master
in repository groff.
commit 531c426949e71a270e3af89cb38ba398c1de0c94
Author: Steffen Nurpmeso <address@hidden>
Date: Sun Mar 30 07:54:44 2014 +0200
Add fine-tuning of doc generation to `configure'.
* m4/groff.m4 (GROFF_DOC_CHECK): New macro, handling option
`--with-doc' and its new arguments. It sets
`docadd_{html,info,other,pdf,examples}' and exports
`make{_,_install_,_uninstall_}{otherdoc,examples}'.
(GROFF_MAKEINFO): Extended to export
`make{_,_install_,_uninstall_}infodoc'.
(GROFF_HTML_PROGRAMS): Extended to export
`make{_,_install_,_uninstall_}{htmldoc,htmlexamples}'.
(GROFF_PDFDOC_PROGRAMS): Extended to export
`make{_,_install_,_uninstall_}{pdfdoc,pdfexamples}'.
(GROFF_INSTALL_INFO): Guard test with `docadd_info'.
* configure.ac: Use GROFF_DOC_CHECK.
* Makefile.in: Updated.
* doc/Makefile.sub: Handle examples separately, controlled by
$(make{_,_install_,_uninstall_}examples).
* contrib/chem/Makefile.sub: Handle examples separately, controlled by
$(make{_,_install_,_uninstall_}examples).
* contrib/httbl/Makefile.sub: Handle examples separately, controlled by
$(make{_,_install_,_uninstall_}examples).
* contrib/mom/Makefile.sub: Handle examples separately, controlled by
$(make{_,_install_,_uninstall_}examples).
* contrib/pdfmark/Makefile.sub: Handle examples separately, controlled by
$(make{_,_install_,_uninstall_}examples).
---
ChangeLog | 22 ++++
Makefile.in | 64 +++++++++++-
configure.ac | 5 +-
contrib/chem/ChangeLog | 7 +-
contrib/chem/Makefile.sub | 24 +++--
contrib/hdtbl/ChangeLog | 7 +-
contrib/hdtbl/Makefile.sub | 25 +++--
contrib/mom/ChangeLog | 5 +
contrib/mom/Makefile.sub | 47 +++++++--
contrib/pdfmark/ChangeLog | 7 +-
contrib/pdfmark/Makefile.sub | 13 ++-
doc/Makefile.sub | 113 ++++++++++++++--------
m4/groff.m4 | 225 ++++++++++++++++++++++++++++++++----------
13 files changed, 429 insertions(+), 135 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ee682f5..459127a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2014-03-29 Steffen Nurpmeso <address@hidden>
+
+ Add fine-tuning of doc generation to `configure'.
+
+ * m4/groff.m4 (GROFF_DOC_CHECK): New macro, handling option
+ `--with-doc' and its new arguments. It sets
+ `docadd_{html,info,other,pdf,examples}' and exports
+ `make{_,_install_,_uninstall_}{otherdoc,examples}'.
+ (GROFF_MAKEINFO): Extended to export
+ `make{_,_install_,_uninstall_}infodoc'.
+ (GROFF_HTML_PROGRAMS): Extended to export
+ `make{_,_install_,_uninstall_}{htmldoc,htmlexamples}'.
+ (GROFF_PDFDOC_PROGRAMS): Extended to export
+ `make{_,_install_,_uninstall_}{pdfdoc,pdfexamples}'.
+ (GROFF_INSTALL_INFO): Guard test with `docadd_info'.
+
+ * configure.ac: Use GROFF_DOC_CHECK.
+ * Makefile.in: Updated.
+
+ * doc/Makefile.sub: Handle examples separately, controlled by
+ $(make{_,_install_,_uninstall_}examples).
+
2014-03-27 Bjarni Ingi Gislason <address@hidden>
* tmac/www.tmac (TAG): Define register `PN'.
diff --git a/Makefile.in b/Makefile.in
index f9da331..f629fb7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,8 @@
-# Copyright (C) 1989-2006, 2009-2013
+# Copyright (C) 1989-2006, 2009-2014
# Free Software Foundation, Inc.
# Written by James Clark (address@hidden)
#
-# Last update: 25 Feb 2014
+# Last update: 29 Mar 2014
#
# This file is part of groff.
#
@@ -264,15 +264,46 @@ man5dir=$(manroot)/man$(man5ext)
man7ext=7
man7dir=$(manroot)/man$(man7ext)
+# `dist' target is disallowed in some `configure' combinations.
address@hidden@
+
+# The configure script checks whether the user wants the info documentation.
+# For the repo version this mechanism also suppresses building via `makeinfo'.
address@hidden@
address@hidden@
address@hidden@
+
# The configure script checks whether all necessary utility programs for
# grohtml are available -- only then we can build the HTML documentation.
address@hidden@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
address@hidden@
address@hidden@
address@hidden@
# The configure script also checks whether all necessary utility programs
# for pdfroff are available -- only then we can build PDF documentation.
address@hidden@
address@hidden@
address@hidden@
+
address@hidden@
address@hidden@
address@hidden@
+
+# `other' documentation, e.g., `meref.me' and `pic.ms', as well as their
+# generated counterparts..
address@hidden@
address@hidden@
address@hidden@
+
+# `examples' -- a generic switch, but the generated examples are furtherly
+# subdivided to catch HTML and PDF production availability.
address@hidden@
address@hidden@
address@hidden@
# All the previous installation directories, when used, are prefixed with
# $(DESTDIR) during install and uninstall, to support staged installations.
@@ -534,10 +565,27 @@ MDEFINES=\
"libprogramdir=$(libprogramdir)" \
"localfontdir=$(localfontdir)" \
"localtmacdir=$(localtmacdir)" \
- "make_html=$(make_html)" \
- "make_install_html=$(make_install_html)" \
+ "make_infodoc=$(make_infodoc)" \
+ "make_install_infodoc=$(make_install_infodoc)" \
+ "make_uninstall_infodoc=$(make_uninstall_infodoc)" \
+ "make_htmldoc=$(make_htmldoc)" \
+ "make_install_htmldoc=$(make_install_htmldoc)" \
+ "make_uninstall_htmldoc=$(make_uninstall_htmldoc)" \
+ "make_htmlexamples=$(make_htmlexamples)" \
+ "make_install_htmlexamples=$(make_install_htmlexamples)" \
+ "make_uninstall_htmlexamples=$(make_uninstall_htmlexamples)" \
"make_pdfdoc=$(make_pdfdoc)" \
"make_install_pdfdoc=$(make_install_pdfdoc)" \
+ "make_uninstall_pdfdoc=$(make_uninstall_pdfdoc)" \
+ "make_pdfexamples=$(make_pdfexamples)" \
+ "make_install_pdfexamples=$(make_install_pdfexamples)" \
+ "make_uninstall_pdfexamples=$(make_uninstall_pdfexamples)" \
+ "make_otherdoc=$(make_otherdoc)" \
+ "make_install_otherdoc=$(make_install_otherdoc)" \
+ "make_uninstall_otherdoc=$(make_uninstall_otherdoc)" \
+ "make_examples=$(make_examples)" \
+ "make_install_examples=$(make_install_examples)" \
+ "make_uninstall_examples=$(make_uninstall_examples)" \
"man1dir=$(man1dir)" \
"man1ext=$(man1ext)" \
"man5dir=$(man5dir)" \
@@ -830,6 +878,10 @@ $(INCDIRS) $(PROGDEPDIRS) $(SHPROGDIRS) $(OTHERDIRS): FORCE
.PHONY: dist
dist:
+ if test "${doc_dist_target_ok}" != yes; then \
+ echo "The \`dist' target is not applicable to this configuration"; \
+ exit 1; \
+ fi
-rm -fr tmp
rm -f groff-$(version)$(revision).tar.gz
mkdir tmp
diff --git a/configure.ac b/configure.ac
index 72fe2fc..a11f879 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,8 @@
# Autoconf configuration file for groff.
-# Copyright (C) 1989-1995, 2001-2007, 2009, 2011-2013
+# Copyright (C) 1989-1995, 2001-2007, 2009, 2011-2014
# Free Software Foundation, Inc.
#
-# Last update: 28 Mar 2013
+# Last update: 29 Mar 2014
#
# This file is part of groff.
#
@@ -69,6 +69,7 @@ GROFF_PERL
GROFF_PRINT
AC_PROG_EGREP
GROFF_PROG_YACC
+GROFF_DOC_CHECK
GROFF_MAKEINFO
AC_PROG_RANLIB
GROFF_INSTALL_SH
diff --git a/contrib/chem/ChangeLog b/contrib/chem/ChangeLog
index b9e978f..3142dda 100644
--- a/contrib/chem/ChangeLog
+++ b/contrib/chem/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-29 Steffen Nurpmeso <address@hidden>
+
+ * Makefile.sub: Handle examples separately, controlled by
+ $(make{_,_install_,_uninstall_}examples).
+
2013-01-29 Bernd Warken <address@hidden>
* all: Change license into GPL2.
@@ -219,7 +224,7 @@
________________________________________________________________
License
- Copyright (C) 2006-2010, 2013
+ Copyright (C) 2006-2010, 2013, 2014
Free Software Foundation, Inc.
Written by Bernd Warken <address@hidden>.
diff --git a/contrib/chem/Makefile.sub b/contrib/chem/Makefile.sub
index 93f3e19..bfc7a63 100644
--- a/contrib/chem/Makefile.sub
+++ b/contrib/chem/Makefile.sub
@@ -6,7 +6,7 @@
# Free Software Foundation, Inc.
# Written by Bernd Warken <address@hidden>.
-# Last update: 27 Feb 2014
+# Last update: 29 Mar 2014
# This file is part of `chem' which is part of `groff'.
@@ -35,13 +35,14 @@ MOSTLYCLEANADD=\
# not all make programs have $(RM) predefined.
RM=rm -f
-all: README examples/README examples/122/README \
- chem \
- $(MAN1)
+all: README chem $(MAN1) $(make_examples)
README: $(srcdir)/README.txt
sed -e "s|@g@|$(g)|g" $? >$@
+.PHONY: examples
+examples: examples/README examples/122/README
+
examples/README: $(srcdir)/examples/README.txt
-test -d examples || $(mkinstalldirs) examples
sed -e "s|@g@|$(g)|g" $? >$@
@@ -62,10 +63,8 @@ chem: $(srcdir)/chem.pl $(SH_DEPS_SED_SCRIPT)
$(srcdir)/chem.pl >$@
chmod +x $@
-install_data: chem \
- README examples/README examples/122/README \
- $(srcdir)/chem.pic \
- $(srcdir)/examples/*.chem $(srcdir)/examples/122/*.chem
+install_data: install_always $(make_install_examples)
+install_always: chem README $(srcdir)/chem.pic
-test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
$(RM) $(DESTDIR)$(bindir)/$(g)chem
$(INSTALL_SCRIPT) chem $(DESTDIR)$(bindir)/$(g)chem
@@ -74,6 +73,8 @@ install_data: chem \
$(RM) $(DESTDIR)$(datasubdir)/pic/chem.pic
$(INSTALL_DATA) $(srcdir)/chem.pic \
$(DESTDIR)$(datasubdir)/pic/chem.pic
+
+install_examples: install_always examples
-test -d $(DESTDIR)$(exampledir)/chem \
|| $(mkinstalldirs) $(DESTDIR)$(exampledir)/chem
-test -d $(DESTDIR)$(exampledir)/chem/122 \
@@ -91,12 +92,15 @@ install_data: chem \
for i in $(srcdir)/examples/122/*.chem; do \
n=`echo $$i | sed 's|$(srcdir)/examples/122/||g'`; \
$(INSTALL_DATA) $$i $(DESTDIR)$(exampledir)/chem/122/$$n; \
- done
+ done
-uninstall_sub:
+uninstall_sub: uninstall_always $(make_uninstall_examples)
+uninstall_always:
$(RM) $(DESTDIR)$(bindir)/chem
$(RM) $(DESTDIR)$(datasubdir)/pic/chem.pic
-rmdir $(DESTDIR)$(datasubdir)/pic
+
+uninstall_examples: uninstall_always
$(RM) $(DESTDIR)$(exampledir)/chem/122/*
-rmdir $(DESTDIR)$(exampledir)/chem/122
$(RM) $(DESTDIR)$(exampledir)/chem/*
diff --git a/contrib/hdtbl/ChangeLog b/contrib/hdtbl/ChangeLog
index 4b54910..57729f8 100644
--- a/contrib/hdtbl/ChangeLog
+++ b/contrib/hdtbl/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-29 Steffen Nurpmeso <address@hidden>
+
+ * Makefile.sub: Handle examples separately, controlled by
+ $(make{_,_install_,_uninstall_}examples).
+
2013-02-06 Werner LEMBERG <address@hidden>
* groff_hdtbl.man: Correct details on loading hdtbl.tmac.
@@ -301,7 +306,7 @@
* Import of hdtbl 0.91 (with some further modifications). Still
many rough edges.
-Copyright 2006, 2008-2013
+Copyright 2006, 2008-2014
Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
diff --git a/contrib/hdtbl/Makefile.sub b/contrib/hdtbl/Makefile.sub
index f894a8e..0493dd2 100644
--- a/contrib/hdtbl/Makefile.sub
+++ b/contrib/hdtbl/Makefile.sub
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2009, 2010, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009, 2010, 2012, 2014 Free Software Foundation, Inc.
# Written by Werner Lemberg (address@hidden)
#
# This file is part of groff.
@@ -96,8 +96,10 @@ MOSTLYCLEANADD=\
.in.roff:
sed -e "s|@fontdir@|$(fontdir)|" $< >$@
+all: $(make_examples) stamp-strip
-all: $(PROCESSEDEXAMPLEFILES) stamp-strip
+.PHONY: examples
+examples: $(PROCESSEDEXAMPLEFILES)
$(PROCESSEDEXAMPLEFILES): gnu.eps examples/stamp examples/common.roff
@@ -112,7 +114,7 @@ gnu.eps:
fi
examples/stamp:
- test -d examples || $(mkinstalldirs) examples
+ -test -d examples || $(mkinstalldirs) examples
touch $@
stamp-strip: $(STRIPFILES)
@@ -122,13 +124,16 @@ stamp-strip: $(STRIPFILES)
done
touch $@
-install_data: $(STRIPFILES) $(EXAMPLEFILES) $(GENFILES) \
- $(PROCESSEDEXAMPLEFILES) gnu.eps stamp-strip
+install_data: install_always $(make_install_examples)
+install_always: $(STRIPFILES) $(GENFILES)
-test -d $(DESTDIR)$(tmacdir) || $(mkinstalldirs) $(DESTDIR)$(tmacdir)
for f in $(STRIPFILES); do \
rm -f $(DESTDIR)$(tmacdir)/$$f; \
$(INSTALL_DATA) $$f-s $(DESTDIR)$(tmacdir)/$$f; \
done
+
+install_examples: install_always $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES) \
+ gnu.eps stamp-strip
-test -d $(DESTDIR)$(exampledir)/hdtbl \
|| $(mkinstalldirs) $(DESTDIR)$(exampledir)/hdtbl
for f in $(EXAMPLEFILES_); do \
@@ -142,13 +147,15 @@ install_data: $(STRIPFILES) $(EXAMPLEFILES) $(GENFILES) \
done
$(INSTALL_DATA) gnu.eps $(DESTDIR)$(exampledir)/hdtbl/gnu.eps
-uninstall_sub:
+uninstall_sub: uninstall_always $(make_uninstall_examples)
+uninstall_always:
-for f in $(STRIPFILES); do \
rm -f $(DESTDIR)$(tmacdir)/$$f; \
done
- -for f in $(EXAMPLEFILES_) $(PROCESSEDEXAMPLEFILES_) \
- $(GENFILES_); do \
+
+uninstall_examples: uninstall_always
+ -for f in $(EXAMPLEFILES_) $(PROCESSEDEXAMPLEFILES_) $(GENFILES_); do \
rm -f $(DESTDIR)$(exampledir)/hdtbl/$$f; \
done
- -rm $(DESTDIR)$(exampledir)/hdtbl/gnu.eps
+ rm -f $(DESTDIR)$(exampledir)/hdtbl/gnu.eps
-rmdir $(DESTDIR)$(exampledir)/hdtbl
diff --git a/contrib/mom/ChangeLog b/contrib/mom/ChangeLog
index b4d8ca3..ace63d8 100644
--- a/contrib/mom/ChangeLog
+++ b/contrib/mom/ChangeLog
@@ -1,3 +1,8 @@
+* Sat Mar 29 2014
+
+o Makefile.sub: Handle examples separately, controlled by
+ $(make{_,_install_,_uninstall_}examples).
+
* Wed Mar 26 2014
o Added user settable space to PARA_SPACE.
diff --git a/contrib/mom/Makefile.sub b/contrib/mom/Makefile.sub
index e956346..06058ec 100644
--- a/contrib/mom/Makefile.sub
+++ b/contrib/mom/Makefile.sub
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2006, 2009, 2012-2013
+# Copyright (C) 2002-2006, 2009, 2012-2014
# Free Software Foundation, Inc.
# Written by Werner Lemberg (address@hidden)
#
@@ -116,21 +116,25 @@ MOSTLYCLEANADD=\
.mom.pdf:
$(PDFMOM) $< >$@
-all: stamp-strip $(PROCESSEDEXAMPLEFILES)
+all: stamp-strip $(make_pdfexamples)
$(PROCESSEDEXAMPLEFILES): penguin.ps penguin.pdf examples/stamp
+pdfexamples: $(PROCESSEDEXAMPLEFILES)
+
penguin.ps:
cp $(srcdir)/examples/penguin.ps .
penguin.pdf:
cp $(srcdir)/examples/penguin.pdf .
examples/stamp:
- test -d examples || $(mkinstalldirs) examples
+ -test -d examples || $(mkinstalldirs) examples
touch $@
-install_data: stamp-strip $(NORMALFILES) $(HTMLDOCFILES) \
- $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES)
+install_data: install_always \
+ $(make_install_pdfdoc) $(make_install_htmldoc) \
+ $(make_install_examples)
+install_always: stamp-strip $(NORMALFILES)
-test -d $(DESTDIR)$(tmacdir) || $(mkinstalldirs) $(DESTDIR)$(tmacdir)
for f in $(NORMALFILES); do \
rm -f $(DESTDIR)$(tmacdir)/$$f; \
@@ -140,6 +144,11 @@ install_data: stamp-strip $(NORMALFILES) $(HTMLDOCFILES) \
rm -f $(DESTDIR)$(tmacdir)/$$f; \
$(INSTALL_DATA) $$f-s $(DESTDIR)$(tmacdir)/$$f; \
done
+
+install_pdfdoc:
+# Since this uses examples/, it's in install_pdfexamples
+
+install_htmldoc: install_always $(HTMLDOCFILES)
-test -d $(DESTDIR)$(htmldocdir)/mom \
|| $(mkinstalldirs) $(DESTDIR)$(htmldocdir)/mom
for f in $(HTMLDOCFILES_); do \
@@ -147,6 +156,9 @@ install_data: stamp-strip $(NORMALFILES) $(HTMLDOCFILES) \
$(INSTALL_DATA) $(srcdir)/momdoc/$$f \
$(DESTDIR)$(htmldocdir)/mom/$$f; \
done
+
+install_examples: install_examples_always $(make_install_pdfexamples)
+install_examples_always: $(EXAMPLEFILES)
-test -d $(DESTDIR)$(exampledir)/mom \
|| $(mkinstalldirs) $(DESTDIR)$(exampledir)/mom
for f in $(EXAMPLEFILES_); do \
@@ -154,6 +166,8 @@ install_data: stamp-strip $(NORMALFILES) $(HTMLDOCFILES) \
$(INSTALL_DATA) $(srcdir)/examples/$$f \
$(DESTDIR)$(exampledir)/mom/$$f; \
done
+
+install_pdfexamples: install_examples_always $(PROCESSEDEXAMPLEFILES)
for f in $(PROCESSEDEXAMPLEFILES_); do \
rm -f $(DESTDIR)$(exampledir)/mom/$$f; \
$(INSTALL_DATA) examples/$$f $(DESTDIR)$(exampledir)/mom/$$f; \
@@ -172,18 +186,35 @@ stamp-strip: $(STRIPFILES)
done
touch $@
-uninstall_sub:
+uninstall_sub: uninstall_always \
+ $(make_uninstall_pdfdoc) $(make_uninstall_htmldoc) \
+ $(make_uninstall_examples)
+uninstall_always:
-for f in $(NORMALFILES) $(STRIPFILES); do \
rm -f $(DESTDIR)$(tmacdir)/$$f; \
done
+
+uninstall_pdfdoc: uninstall_always
+# Since that used examples/, it's in uninstall_pdfexamples
+
+uninstall_htmldoc: uninstall_always
-for f in $(HTMLDOCFILES_); do \
rm -f $(DESTDIR)$(htmldocdir)/mom/$$f; \
done
-rmdir $(DESTDIR)$(htmldocdir)/mom
- -for f in $(EXAMPLEFILES_) $(PROCESSEDEXAMPLEFILES_); do \
+
+uninstall_examples: uninstall_examples_always $(make_uninstall_pdfexamples)
+ -rmdir $(DESTDIR)$(exampledir)/mom
+
+uninstall_examples_always:
+ -for f in $(EXAMPLEFILES_); do \
rm -f $(DESTDIR)$(exampledir)/mom/$$f; \
done
+
+uninstall_pdfexamples: uninstall_examples_always
-for f in $(PDFDOCFILE); do \
rm -f $(DESTDIR)$(pdfdocdir)/$$f; \
done
- -rmdir $(DESTDIR)$(exampledir)/mom
+ -for f in $(PROCESSEDEXAMPLEFILES_); do \
+ rm -f $(DESTDIR)$(exampledir)/mom/$$f; \
+ done
diff --git a/contrib/pdfmark/ChangeLog b/contrib/pdfmark/ChangeLog
index 4d273a6..9f06f13 100644
--- a/contrib/pdfmark/ChangeLog
+++ b/contrib/pdfmark/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-29 Steffen Nurpmeso <address@hidden>
+
+ * Makefile.sub: Handle examples separately, controlled by
+ $(make{_,_install_,_uninstall_}examples).
+
2013-01-28 Deri James <address@hidden>
* pdfmark.tmac (pdfmark, pdf:composed): Use `\!' instead of `\X'.
@@ -369,7 +374,7 @@
First import of pdfmark files.
-Copyright 2004-2013
+Copyright 2004-2014
Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
diff --git a/contrib/pdfmark/Makefile.sub b/contrib/pdfmark/Makefile.sub
index 768f24a..ada32b9 100644
--- a/contrib/pdfmark/Makefile.sub
+++ b/contrib/pdfmark/Makefile.sub
@@ -1,4 +1,5 @@
-# Copyright (C) 2005, 2006, 2009, 2011, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006, 2009, 2011, 2012, 2014
+# Free Software Foundation, Inc.
# Written by Keith Marshall (address@hidden)
#
# This file is part of groff.
@@ -90,7 +91,8 @@ pdfroff: pdfroff.sh $(SH_DEPS_SED_SCRIPT)
-e "s|@GROFF_BIN_DIR@|$(bindir)|" $(srcdir)/pdfroff.sh >$@
chmod +x $@
-install_data: $(make_install_pdfdoc)
+install_data: install_always $(make_install_pdfdoc)
+install_always:
-test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
for f in $(CMDFILES); do \
$(RM) $(DESTDIR)$(bindir)/$$f; \
@@ -102,7 +104,7 @@ install_data: $(make_install_pdfdoc)
$(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(tmacdir)/$$f; \
done
-install_pdfdoc:
+install_pdfdoc: install_always
-test -d $(DESTDIR)$(pdfdocdir) \
|| $(mkinstalldirs) $(DESTDIR)$(pdfdocdir)
for f in $(PDFDOCFILES); do \
@@ -110,13 +112,16 @@ install_pdfdoc:
$(INSTALL_DATA) $$f $(DESTDIR)$(pdfdocdir)/$$f; \
done
-uninstall_sub:
+uninstall_sub: uninstall_always $(make_uninstall_pdfdoc)
+uninstall_always:
for f in $(CMDFILES); do \
$(RM) $(DESTDIR)$(bindir)/$$f; \
done
for f in $(TMACFILES); do \
$(RM) $(DESTDIR)$(tmacdir)/$$f; \
done
+
+uninstall_pdfdoc: uninstall_always
for f in $(PDFDOCFILES); do \
$(RM) $(DESTDIR)$(pdfdocdir)/$$f; \
done
diff --git a/doc/Makefile.sub b/doc/Makefile.sub
index 913b262..f068e5c 100644
--- a/doc/Makefile.sub
+++ b/doc/Makefile.sub
@@ -122,12 +122,16 @@ MOSTLYCLEANNOTSRCDIRADD=\
$(GROFF) -Tps -ms -mwww >$@
-all: groff.info $(PROCESSEDDOCFILES) prepare_examples \
- $(PROCESSEDEXAMPLEFILES) $(make_html)
+all: $(make_otherdoc) $(make_infodoc) $(make_htmldoc) \
+ $(make_examples) $(make_htmlexamples)
-html: $(HTMLDOCFILES) $(HTMLEXAMPLEFILES)
+otherdoc: $(PROCESSEDDOCFILES)
+infodoc: groff.info
+htmldoc: $(HTMLDOCFILES)
-prepare_examples: examples.stamp
+examples: examples.stamp $(PROCESSEDEXAMPLEFILES)
+
+html_examples: $(HTMLEXAMPLEFILES)
examples.stamp: grnexmpl.g groff.css gnu.eps
test -f grnexmpl.g || cp $(srcdir)/grnexmpl.g .
@@ -164,13 +168,28 @@ grnexmpl.ps: grnexmpl.me grnexmpl.g
distfiles: groff.info gnu.eps
-install_data: groff.info gnu.eps $(DOCFILES) $(PROCESSEDDOCFILES) \
- $(make_install_html) $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES)
+install_data: install_always $(make_install_otherdoc) \
+ $(make_install_infodoc) $(make_install_htmldoc) \
+ $(make_install_examples)
+
+install_always:
+ -test -d $(DESTDIR)$(docdir) || $(mkinstalldirs) $(DESTDIR)$(docdir)
+
+install_otherdoc: install_always $(DOCFILES) $(PROCESSEDDOCFILES)
+ for f in $(DOCFILES); do \
+ rm -f $(DESTDIR)$(docdir)/$$f; \
+ $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(docdir)/$$f; \
+ done
+ for f in $(PROCESSEDDOCFILES); do \
+ rm -f $(DESTDIR)$(docdir)/$$f; \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f; \
+ done
+
+install_infodoc: install_always groff.info
# Prefer info files in builddir over srcdir; we test for
# the existence of `groff.info'.
-test -d $(DESTDIR)$(infodir) || $(mkinstalldirs) $(DESTDIR)$(infodir)
- d=.; \
- test -f "groff.info" || d=$(srcdir); \
+ d=.; test -f "groff.info" || d=$(srcdir); \
for p in $$d/groff.info `ls $$d/groff.info*`; do \
f=`basename $$p`; \
rm -f $(DESTDIR)$(infodir)/$$f; \
@@ -178,15 +197,24 @@ install_data: groff.info gnu.eps $(DOCFILES)
$(PROCESSEDDOCFILES) \
done
$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) \
$(DESTDIR)$(infodir)/groff.info
- -test -d $(DESTDIR)$(docdir) || $(mkinstalldirs) $(DESTDIR)$(docdir)
- for f in $(DOCFILES); do \
- rm -f $(DESTDIR)$(docdir)/$$f; \
- $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(docdir)/$$f; \
- done
- for f in $(PROCESSEDDOCFILES); do \
- rm -f $(DESTDIR)$(docdir)/$$f; \
- $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f; \
+
+install_htmldoc: install_always $(HTMLDOCFILES)
+ -test -d $(DESTDIR)$(htmldocdir) \
+ || $(mkinstalldirs) $(DESTDIR)$(htmldocdir)
+ for f in `ls $(HTMLDOCFILESALL)`; do \
+ rm -f $(DESTDIR)$(htmldocdir)/$$f; \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(htmldocdir)/$$f; \
done
+ -test -d $(DESTDIR)$(htmldocimagedir) \
+ || $(mkinstalldirs) $(DESTDIR)$(htmldocimagedir)
+ rm -f $(DESTDIR)$(htmldocimagedir)/$(HTMLDOCIMAGEFILES)
+ $(INSTALL_DATA) $(imagedir)/$(HTMLDOCIMAGEFILES) \
+ $(DESTDIR)$(htmldocimagedir)
+
+install_examples: install_always install_examples_always \
+ $(make_install_htmlexamples)
+
+install_examples_always: gnu.eps $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES)
# Prefer gnu.eps in builddir over srcdir.
-test -d $(DESTDIR)$(exampledir) \
|| $(mkinstalldirs) $(DESTDIR)$(exampledir)
@@ -203,20 +231,7 @@ install_data: groff.info gnu.eps $(DOCFILES)
$(PROCESSEDDOCFILES) \
$(INSTALL_DATA) $$f $(DESTDIR)$(exampledir)/$$f; \
done
-install_html: $(HTMLDOCFILES) $(HTMLEXAMPLEFILES)
- -test -d $(DESTDIR)$(htmldocdir) \
- || $(mkinstalldirs) $(DESTDIR)$(htmldocdir)
- for f in `ls $(HTMLDOCFILESALL)`; do \
- rm -f $(DESTDIR)$(htmldocdir)/$$f; \
- $(INSTALL_DATA) $$f $(DESTDIR)$(htmldocdir)/$$f; \
- done
- -test -d $(DESTDIR)$(htmldocimagedir) \
- || $(mkinstalldirs) $(DESTDIR)$(htmldocimagedir)
- rm -f $(DESTDIR)$(htmldocimagedir)/$(HTMLDOCIMAGEFILES)
- $(INSTALL_DATA) $(imagedir)/$(HTMLDOCIMAGEFILES) \
- $(DESTDIR)$(htmldocimagedir)
- -test -d $(DESTDIR)$(exampledir) \
- || $(mkinstalldirs) $(DESTDIR)$(exampledir)
+install_htmlexamples: install_examples_always $(HTMLEXAMPLEFILES)
for f in `ls $(HTMLEXAMPLEFILESALL)`; do \
rm -f $(DESTDIR)$(exampledir)/$$f; \
$(INSTALL_DATA) $$f $(DESTDIR)$(exampledir)/$$f; \
@@ -227,24 +242,42 @@ install_html: $(HTMLDOCFILES) $(HTMLEXAMPLEFILES)
$(INSTALL_DATA) $(imagedir)/$(HTMLEXAMPLEIMAGEFILES) \
$(DESTDIR)$(exampleimagedir)
-uninstall_sub:
- $(INSTALL_INFO) --remove --info-dir=$(DESTDIR)$(infodir) \
+uninstall_sub: uninstall_always \
+ $(make_uninstall_infodoc) $(make_uninstall_htmldoc) \
+ $(make_uninstall_examples)
+
+uninstall_always:
+ -for f in $(DOCFILES) $(PROCESSEDDOCFILES); do \
+ rm -f $(DESTDIR)$(docdir)/$$f; \
+ done
+
+uninstall_infodoc: uninstall_always
+ -$(INSTALL_INFO) --remove --info-dir=$(DESTDIR)$(infodir) \
$(DESTDIR)$(infodir)/groff.info
-for f in groff `ls groff.info*`; do \
rm -f $(DESTDIR)$(infodir)/$$f; \
done
- -for f in $(DOCFILES) $(PROCESSEDDOCFILES); do \
- rm -f $(DESTDIR)$(docdir)/$$f; \
- done
+
+uninstall_htmldoc: uninstall_always
-for f in `ls $(HTMLDOCFILESALL)`; do \
rm -f $(DESTDIR)$(htmldocdir)/$$f; \
done
- -rm -f $(DESTDIR)$(htmldocimagedir)/$(HTMLDOCIMAGEFILES)
+ rm -f $(DESTDIR)$(htmldocimagedir)/$(HTMLDOCIMAGEFILES)
-rmdir $(DESTDIR)$(htmldocimagedir)
- -for f in $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES) \
- `ls $(HTMLEXAMPLEFILESALL)`; do \
+
+uninstall_examples: uninstall_always uninstall_examples_always \
+ $(make_uninstall_htmlexamples)
+ -rmdir $(DESTDIR)$(exampledir)
+
+uninstall_examples_always:
+ -for f in $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES); do \
rm -f $(DESTDIR)$(exampledir)/$$f; \
done
- -rm -f $(DESTDIR)$(exampledir)/gnu.eps
- -rm -f $(DESTDIR)$(exampleimagedir)/$(HTMLEXAMPLEIMAGEFILES)
+ rm -f $(DESTDIR)$(exampledir)/gnu.eps
+
+uninstall_htmlexamples: uninstall_examples_always
+ -for f in `ls $(HTMLEXAMPLEFILESALL)`; do \
+ rm -f $(DESTDIR)$(exampledir)/$$f; \
+ done
+ rm -f $(DESTDIR)$(exampleimagedir)/$(HTMLEXAMPLEIMAGEFILES)
-rmdir $(DESTDIR)$(exampleimagedir)
diff --git a/m4/groff.m4 b/m4/groff.m4
index 9b4ce26..6021c22 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -1,8 +1,8 @@
# Autoconf macros for groff.
-# Copyright (C) 1989-1995, 2001-2007, 2009, 2011, 2013
+# Copyright (C) 1989-1995, 2001-2007, 2009, 2011, 2013, 2014
# Free Software Foundation, Inc.
#
-# Last update: 15 Apr 2013
+# Last update: 29 Mar 2014
#
# This file is part of groff.
#
@@ -71,51 +71,135 @@ AC_DEFUN([GROFF_PERL],
AC_MSG_ERROR([perl version is too old], 1))])
+# It is possible to fine-tune generation of documenation.
+
+AC_DEFUN([GROFF_DOC_CHECK],
+ [AC_ARG_WITH([doc],
+ [AS_HELP_STRING([--with-doc[[=TYPE]]],
+ [choose which manuals (beside man pages) are desirable. \
+ TYPE can be `yes' or `no', or a comma-separated list of \
+ one or multiple of `html', `info', `other', `pdf', and \
+ `examples', to restrict what is produced])],
+ [doc="$withval"],
+ [doc=yes])
+ test "x$doc" = xno && doc=''
+ if test "x$doc" = xyes; then
+ doc_dist_target_ok=yes
+ docadd_html=yes
+ docadd_info=yes
+ docadd_other=yes
+ docadd_pdf=yes
+ docadd_examples=yes
+ else
+ # Don't use case/esac, verify input.
+ doc_dist_target_ok=no
+ docadd_html=no
+ docadd_info=no
+ docadd_other=no
+ docadd_pdf=no
+ docadd_examples=no
+ OFS=$IFS
+ IFS=','
+ set -- $doc
+ IFS=$OFS
+ for i
+ do
+ test "x$i" = xhtml && { docadd_html=yes; continue; }
+ test "x$i" = xinfo && { docadd_info=yes; continue; }
+ test "x$i" = xother && { docadd_other=yes; continue; }
+ test "x$i" = xpdf && { docadd_pdf=yes; continue; }
+ test "x$i" = xexamples && { docadd_examples=yes; continue; }
+ AC_MSG_WARN([Invalid `--with-doc' argument:] $i)
+ done
+ fi
+ if test $docadd_other = yes; then
+ make_otherdoc=otherdoc
+ make_install_otherdoc=install_otherdoc
+ make_uninstall_otherdoc=uninstall_otherdoc
+ else
+ make_otherdoc=
+ make_install_otherdoc=
+ make_uninstall_otherdoc=
+ fi
+ if test $docadd_examples = yes; then
+ make_examples=examples
+ make_install_examples=install_examples
+ make_uninstall_examples=uninstall_examples
+ else
+ make_examples=
+ make_install_examples=
+ make_uninstall_examples=
+ fi
+ AC_SUBST([doc_dist_target_ok])
+ AC_SUBST([make_otherdoc])
+ AC_SUBST([make_install_otherdoc])
+ AC_SUBST([make_uninstall_otherdoc])
+ AC_SUBST([make_examples])
+ AC_SUBST([make_install_examples])
+ AC_SUBST([make_uninstall_examples])])
+
+
# We need makeinfo 4.8 or newer.
AC_DEFUN([GROFF_MAKEINFO],
- [missing=
- AC_CHECK_PROG([MAKEINFO], [makeinfo], [makeinfo])
- if test -z "$MAKEINFO"; then
- missing="\`makeinfo' is missing."
- else
- AC_MSG_CHECKING([for makeinfo version])
- # We need an additional level of quoting to make sed's regexps work.
- [makeinfo_version=`$MAKEINFO --version 2>&1 \
- | sed -e 's/^.* \([^ ][^ ]*\)$/\1/' -e '1q'`]
- AC_MSG_RESULT([$makeinfo_version])
- # Consider only the first two numbers in version number string.
- makeinfo_version_major=`IFS=.; set x $makeinfo_version; echo 0${2}`
- makeinfo_version_minor=`IFS=.; set x $makeinfo_version; echo 0${3}`
- makeinfo_version_numeric=`
- expr ${makeinfo_version_major}000 \+ ${makeinfo_version_minor}`
- if test $makeinfo_version_numeric -lt 4008; then
- missing="\`makeinfo' is too old."
+ [make_infodoc=
+ make_install_infodoc=
+ make_uninstall_infodoc=
+ MAKEINFO=
+ if test $docadd_info = yes; then
+ missing=
+ AC_CHECK_PROG([MAKEINFO], [makeinfo], [makeinfo])
+ if test -z "$MAKEINFO"; then
+ missing="\`makeinfo' is missing."
+ else
+ AC_MSG_CHECKING([for makeinfo version])
+ # We need an additional level of quoting to make sed's regexps work.
+ [makeinfo_version=`$MAKEINFO --version 2>&1 \
+ | sed -e 's/^.* \([^ ][^ ]*\)$/\1/' -e '1q'`]
+ AC_MSG_RESULT([$makeinfo_version])
+ # Consider only the first two numbers in version number string.
+ makeinfo_version_major=`IFS=.; set x $makeinfo_version; echo 0${2}`
+ makeinfo_version_minor=`IFS=.; set x $makeinfo_version; echo 0${3}`
+ makeinfo_version_numeric=`
+ expr ${makeinfo_version_major}000 \+ ${makeinfo_version_minor}`
+ if test $makeinfo_version_numeric -lt 4008; then
+ missing="\`makeinfo' is too old."
+ fi
fi
- fi
- if test -n "$missing"; then
- infofile=doc/groff.info
- test -f ${infofile} || infofile=${srcdir}/${infofile}
- if test ! -f ${infofile} \
+ if test -n "$missing"; then
+ infofile=doc/groff.info
+ test -f ${infofile} || infofile=${srcdir}/${infofile}
+ if test ! -f ${infofile} \
|| test ${srcdir}/doc/groff.texinfo -nt ${infofile}; then
- AC_MSG_ERROR($missing
+ AC_MSG_ERROR($missing
[Get the `texinfo' package version 4.8 or newer.])
- else
- AC_MSG_WARN($missing
+ else
+ AC_MSG_WARN($missing
[Get the `texinfo' package version 4.8 or newer if you want to convert
`groff.texinfo' into a PDF or HTML document.])
+ fi
fi
+ make_infodoc=infodoc
+ make_install_infodoc=install_infodoc
+ make_uninstall_infodoc=uninstall_infodoc
fi
- AC_SUBST([MAKEINFO])])
+ AC_SUBST([MAKEINFO])
+ AC_SUBST([make_infodoc])
+ AC_SUBST([make_install_infodoc])
+ AC_SUBST([make_uninstall_infodoc])])
# The following programs are needed for grohtml.
AC_DEFUN([GROFF_HTML_PROGRAMS],
- [AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH])
- make_html=html
- make_install_html=install_html
+ [make_htmldoc=
+ make_install_htmldoc=
+ make_uninstall_htmldoc=
+ make_htmlexamples=
+ make_install_htmlexamples=
+ make_uninstall_htmlexamples=
+ AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH])
missing=
AC_FOREACH([groff_prog],
@@ -127,7 +211,18 @@ AC_DEFUN([GROFF_HTML_PROGRAMS],
test "$GHOSTSCRIPT" = "missing" && missing="$missing \`gs'"
- if test -n "$missing"; then
+ if test -z "$missing"; then
+ if test $docadd_html = yes; then
+ make_htmldoc=htmldoc
+ make_install_htmldoc=install_htmldoc
+ make_uninstall_htmldoc=uninstall_htmldoc
+ if test $docadd_examples = yes; then
+ make_htmlexamples=html_examples
+ make_install_htmlexamples=install_htmlexamples
+ make_uninstall_htmlexamples=uninstall_htmlexamples
+ fi
+ fi
+ else
plural=`set $missing; test $[#] -gt 1 && echo s`
missing=`set $missing
missing=""
@@ -142,56 +237,78 @@ AC_DEFUN([GROFF_HTML_PROGRAMS],
done
echo $missing`
- make_html=
- make_install_html=
+ docnote=.
+ test $docadd_html = yes && docnote=';
+ therefore, it will neither be possible to prepare, nor to install,
+ documentation in HTML format.'
AC_MSG_WARN([missing program$plural:
The program$plural
$missing
cannot be found in the PATH.
- Consequently, groff's HTML backend (grohtml) will not work properly;
- therefore, it will neither be possible to prepare, nor to install,
- documentation in HTML format.
+ Consequently, groff's HTML backend (grohtml) will not work properly$docnote
])
+ doc_dist_target_ok=no
fi
-
- AC_SUBST([make_html])
- AC_SUBST([make_install_html])])
+ AC_SUBST([make_htmldoc])
+ AC_SUBST([make_install_htmldoc])
+ AC_SUBST([make_uninstall_htmldoc])
+ AC_SUBST([make_htmlexamples])
+ AC_SUBST([make_install_htmlexamples])
+ AC_SUBST([make_uninstall_htmlexamples])])
# To produce PDF docs, we need both awk and ghostscript.
AC_DEFUN([GROFF_PDFDOC_PROGRAMS],
- [AC_REQUIRE([GROFF_AWK_PATH])
+ [make_pdfdoc=
+ make_install_pdfdoc=
+ make_uninstall_pdfdoc=
+ make_pdfexamples=
+ make_install_pdfexamples=
+ make_uninstall_pdfexamples=
+ AC_REQUIRE([GROFF_AWK_PATH])
AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH])
- make_pdfdoc=pdfdoc
- make_install_pdfdoc=install_pdfdoc
-
missing=""
test "$AWK" = missing && missing="\`awk'"
test "$GHOSTSCRIPT" = missing && missing="$missing \`gs'"
- if test -n "$missing"; then
+ if test -z "$missing"; then
+ if test $docadd_pdf = yes; then
+ make_pdfdoc=pdfdoc
+ make_install_pdfdoc=install_pdfdoc
+ make_uninstall_pdfdoc=uninstall_pdfdoc
+ if test $docadd_examples = yes; then
+ make_pdfexamples=pdfexamples
+ make_install_pdfexamples=install_pdfexamples
+ make_uninstall_pdfexamples=uninstall_pdfexamples
+ fi
+ fi
+ else
plural=`set $missing; test $[#] -eq 2 && echo s`
test x$plural = xs \
&& missing=`set $missing; echo "$[1] and $[2]"` \
|| missing=`echo $missing`
- make_pdfdoc=
- make_install_pdfdoc=
+ docnote=.
+ test $docadd_pdf = yes && docnote=';
+ therefore, it will neither be possible to prepare, nor to install,
+ documentation and most of the examples in PDF format.'
AC_MSG_WARN([missing program$plural:
The program$plural $missing cannot be found in the PATH.
- Consequently, groff's PDF formatter (pdfroff) will not work properly;
- therefore, it will neither be possible to prepare, nor to install,
- documentation in PDF format.
+ Consequently, groff's PDF formatter (pdfroff) will not work properly$docnote
])
+ doc_dist_target_ok=no
fi
-
AC_SUBST([make_pdfdoc])
- AC_SUBST([make_install_pdfdoc])])
+ AC_SUBST([make_install_pdfdoc])
+ AC_SUBST([make_uninstall_pdfdoc])
+ AC_SUBST([make_pdfexamples])
+ AC_SUBST([make_install_pdfexamples])
+ AC_SUBST([make_uninstall_pdfexamples])])
# Check whether pnmtops can handle the -nosetpage option.
@@ -800,7 +917,9 @@ AC_DEFUN([GROFF_INSTALL_SH],
# Test whether install-info is available.
AC_DEFUN([GROFF_INSTALL_INFO],
- [AC_CHECK_PROGS([INSTALL_INFO], [install-info], [:])])
+ [if test $docadd_info = yes; then
+ AC_CHECK_PROGS([INSTALL_INFO], [install-info], [:])
+ fi])
# At least one UNIX system, Apple Macintosh Rhapsody 5.5,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/09: Add fine-tuning of doc generation to `configure'.,
Werner LEMBERG <=