[m-dev.] diff: handle missing info in doc/Mmakefile

Tyson Dowd trd at cs.mu.OZ.AU
Wed Nov 24 12:58:57 AEDT 1999


On 17-Nov-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 17-Nov-1999, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > doc/Mmakefile:
> > 	Don't try to build mdb_doc if you don't have info.
> > 	Instead output a nice warning message.
> ...
> > +++ Mmakefile	1999/11/17 07:26:27
> > @@ -33,16 +33,22 @@
> >  endif
> >  
> >  ifeq ("$(MAKEINFO)","")
> > -	INFO=
> > +	INFOPAGES=
> >  	INSTALL_INFO=
> >  	MDB_DOC=
> >  else
> > -	INFO=info
> > +	ifeq ("$(INFO)","")
> > +		MDB_DOC=warn_no_mdb_doc
> > +		INSTALL_MDB_DOC=
> 
> That code will cause a problem with source tar distributions.
> If mdb_doc is already up-to-date, as it should be in the
> source distributions, then the mdb documentation should
> be installed, even if you don't have the tools to recreate it.
> The current code and your modification of it both have the
> problem that they don't install the mdb documentation if
> you don't have the tools to recreate it, even if it doesn't
> need to be recreated.
> 
> The same problem applies for the other types of documentation too.

Fair enough.  I think this fix is a better one and doesn't suffer from
this problem.

Although we can't install the .info files if install-info is not
present.

===================================================================


Estimated hours taken: 3

Fix the building of documentation in the presence of missing tools.

Mmake.common.in:
configure.in:
	Check for info -- it is required to build the mdb documentation.

doc/Mmakefile:
	Don't stop the installation of documentation (except if install-info
	is required but not present). 
	Stop the attempt to generate documentation when there is a
	missing utility.
	This means if pre-built documentation is present it can be
	installed, but building from a clean checkout doesn't try to
	make documentation that cannot be built.


Index: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.41
diff -u -r1.41 Mmake.common.in
--- Mmake.common.in	1999/11/15 05:10:22	1.41
+++ Mmake.common.in	1999/11/24 01:49:46
@@ -156,6 +156,7 @@
 #-----------------------------------------------------------------------------#
 
 INSTALL_INFO=@INSTALL_INFO@
+INFO=@INFO@
 TEXI2DVI=@TEXI2DVI@
 DVIPS=@DVIPS@
 MAKEINFO=@MAKEINFO@
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.190
diff -u -r1.190 configure.in
--- configure.in	1999/11/16 07:51:07	1.190
+++ configure.in	1999/11/24 01:49:46
@@ -191,6 +191,9 @@
 AC_PATH_PROG(MAKEINFO,makeinfo)
 AC_SUBST(MAKEINFO)
 #-----------------------------------------------------------------------------#
+AC_PATH_PROG(INFO,info)
+AC_SUBST(INFO)
+#-----------------------------------------------------------------------------#
 AC_PATH_PROG(PERL,perl)
 AC_SUBST(PERL)
 #-----------------------------------------------------------------------------#
Index: doc/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/Mmakefile,v
retrieving revision 1.20
diff -u -r1.20 Mmakefile
--- Mmakefile	1999/10/25 14:07:30	1.20
+++ Mmakefile	1999/11/24 01:49:49
@@ -17,40 +17,44 @@
 TEXI2HTML_SPLIT=$(PERL) texi2html -split
 
 ifeq ("$(PERL)","")
-	HTML=
-	INSTALL_HTML=
+	HTML=warn_no_html
 else
 	HTML=html
-	INSTALL_HTML=install_html
 endif
 
 ifeq ("$(TEXI2DVI)","")
-	DVI=
-	INSTALL_DVI=
+	DVI=warn_no_dvi
+	PS=warn_no_ps
 else
 	DVI=dvi
-	INSTALL_DVI=install_dvi
+	ifeq ("$(DVIPS)","")
+		PS=warn_no_ps
+	else
+		PS=ps
+	endif
 endif
 
-ifeq ("$(MAKEINFO)","")
-	INFO=
-	INSTALL_INFO=
-	MDB_DOC=
+ 
+ifeq ("$(INSTALL_INFO)","")
+	SHOULD_INSTALL_INFO=warn_no_install_info
 else
-	INFO=info
-	INSTALL_INFO=install_info
-	MDB_DOC=mdb_doc mdb_command_list mdb_command_test.inp
-	INSTALL_MDB_DOC=install_mdb_doc
+	SHOULD_INSTALL_INFO=install_info
 endif
 
-ifeq ("$(DVIPS)","")
-	PS=
-	INSTALL_PS=
+ifeq ("$(MAKEINFO)","")
+	INFOPAGES=warn_no_info
+	MDB_DOC=warn_no_mdb_doc
 else
-	PS=ps
-	INSTALL_PS=install_ps
+	ifeq ("$(INFO)","")
+		MDB_DOC=warn_no_mdb_doc
+	else
+		MDB_DOC=mdb_doc mdb_command_list mdb_command_test.inp
+	endif
+	INFOPAGES=info
 endif
 
+
+
 #-----------------------------------------------------------------------------#
 
 .SUFFIXES: .texi .dvi .ps .text
@@ -61,9 +65,6 @@
 .texi.text:
 	$(MAKEINFO) --no-headers -o $@ $<
 
-.dvi.ps:
-	$(DVIPS) -o $@ $<
- 
 %.html %_toc.html: %.texi
 	$(TEXI2HTML) $<
 
@@ -81,7 +82,7 @@
 	# Currently `mmake all' does not build the PostScript or plain-text
 	# versions of the documentation.  But it might make sense to add them.
 .PHONY: all
-all: $(INFO) $(DVI) $(HTML) manpages $(MDB_DOC) 
+all: $(INFOPAGES) $(DVI) $(HTML) manpages $(MDB_DOC) 
 #all: ps text
 
 #-----------------------------------------------------------------------------#
@@ -90,17 +91,37 @@
 dvi: user_guide.dvi reference_manual.dvi library.dvi faq.dvi \
 	transition_guide.dvi
 
+.PHONY: warn_no_dvi
+warn_no_dvi: 
+	# Warning: Unable to build .dvi files.
+	# This is probably due to a missing `texi2dvi'
+
 .PHONY: info
 info: mercury.info mercury_ref.info mercury_user_guide.info \
 	mercury_library.info mercury_faq.info mercury_trans_guide.info
 
+.PHONY: warn_no_info
+warn_no_info: 
+	# Warning: Unable to build .info files.
+	# This is probably due to a missing `makeinfo'
+
 .PHONY: html
 html: mercury.html user_guide_toc.html reference_manual_toc.html \
 	library_toc.html faq_toc.html transition_guide_toc.html
 
+.PHONY: warn_no_html
+warn_no_html: 
+	# Warning: Unable to build .html files.
+	# This is probably due to a missing `perl'
+
 .PHONY: ps
 ps: user_guide.ps reference_manual.ps library.ps faq.ps transition_guide.ps
 
+.PHONY: warn_no_ps
+warn_no_ps: 
+	# Warning: Unable to build .ps files.
+	# This is probably due to a missing `dvips' or `text2dvi'
+
 .PHONY: text
 text: user_guide.text reference_manual.text library.text faq.text \
 	transition_guide.text
@@ -128,6 +149,11 @@
 
 #-----------------------------------------------------------------------------#
 
+.PHONY: warn_no_mdb_doc
+warn_no_mdb_doc: 
+	# Warning: Unable to build mdb documentation.
+	# This is probably due to a missing `makeinfo' or `info'
+
 mdb_doc: generate_mdb_doc mercury_user_guide.info mdb_categories
 	./generate_mdb_doc
 
@@ -204,8 +230,8 @@
 	# versions of the documentation.  If they are added they should
 	# be installed here.
 .PHONY: install
-install: $(INSTALL_INFO) $(INSTALL_HTML) $(INSTALL_DVI) install_manpages \
-	$(INSTALL_MDB_DOC) 
+install: $(SHOULD_INSTALL_INFO) install_html install_dvi install_manpages \
+	install_mdb_doc
 	# install_text install_ps
 
 .PHONY: install_dirs
@@ -221,36 +247,41 @@
 	-[ -d $(INSTALL_WEBPAGE_DIR) ] || mkdir -p $(INSTALL_WEBPAGE_DIR)
 
 .PHONY: install_info
-install_info: info install_dirs
+install_info: $(INFOPAGES) install_dirs
 	-cp *.info* $(INSTALL_INFO_DIR)
 	# Update the .../info/dir file.
 	-if [ -x "$(INSTALL_INFO)" ]; then				\
 		$(INSTALL_INFO) $(INSTALL_INFO_DIR)/mercury.info;	\
 	fi
 
+.PHONY: warn_no_install_info
+warn_no_install_info:
+	# Warning: Unable to install .info files.
+	# This is probably due to a missing `install-info'
+
 .PHONY: install_html
-install_html: html install_dirs
-	cp *.html $(INSTALL_HTML_DIR)
+install_html: $(HTML) install_dirs
+	-cp *.html $(INSTALL_HTML_DIR)
 
 .PHONY: install_dvi
-install_dvi: dvi install_dirs
-	cp *.dvi $(INSTALL_DVI_DIR)
+install_dvi: $(DVI) install_dirs
+	-cp *.dvi $(INSTALL_DVI_DIR)
 
 .PHONY: install_text
 install_text: text install_dirs
 	cp *.txt $(INSTALL_TEXT_DIR)
 
 .PHONY: install_ps
-install_ps: ps install_dirs
-	cp *.ps $(INSTALL_PS_DIR)
+install_ps: $(PS) install_dirs
+	-cp *.ps $(INSTALL_PS_DIR)
 
 .PHONY: install_manpages
 install_manpages: manpages install_dirs
 	cp *.1 $(INSTALL_MAN_DIR)/man1
 
 .PHONY: install_mdb_doc
-install_mdb_doc: mdb_doc install_dirs
-	cp mdb_doc $(INSTALL_MDB_DOC_DIR)
+install_mdb_doc: $(MDB_DOC) install_dirs
+	-cp mdb_doc $(INSTALL_MDB_DOC_DIR)
 
 # The uninstall rule here only removes the info files; the others
 # are removed by the top-level uninstall rule.


-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list