Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Helpfiles again (was Re: modify functions hierarchy (was: etc.))



On Nov 23,  9:25pm, Martin Vaeth wrote:
} Subject: Re: Helpfiles again (was Re: modify functions hierarchy (was: etc
}
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} >
} > Why do we care at this point whether $(runhelpdir) is defined?
} 
} Because if the user does not want to install the helpfiles, he can say
} 
}   ./configure --disable-runhelpdir

That's not the way this ought to be done.  The absence of tools like
"ansi2knr" and "yodl" is not handled by obscuring the dependencies,
it's handled by checking for their availability in configure and
substituting no-op replacements (which is the reason for the existence
of e.g. the doc tarball), so the "make" targets still have the correct
dependency chain.

How about the following as a compromise.  When --disable-runhelpdir,
assure that $(runhelp) is also empty string, otherwise $(runhelp) is
"runhelp".  Then use $(runhelp) in dependency lists, so e.g. "make all"
has no indirect dependency on running perl etc., but the dependencies
for the "runhelp" target can be accurate.

(Could have done this by substitution of @runhelp@ in Doc/Makefile.in
but it seems more consistent to put it in Config/defs.mk.in and use
$(runhelp) instead.)

This isn't quite as good as what's done with yodl because it means the
doc tarball has to assure help.txt is newer than zshbuiltins.1.  On the
other hand, it can be prevented from griping the way the "texi" target
does when neither the [contents of the] doc tarball nor yodl itself is
available.


diff --git a/Config/defs.mk.in b/Config/defs.mk.in
index 5c19cc4..2c813a3 100644
--- a/Config/defs.mk.in
+++ b/Config/defs.mk.in
@@ -52,6 +52,7 @@ scriptdir       = @scriptdir@
 sitescriptdir   = @sitescriptdir@
 htmldir         = @htmldir@
 runhelpdir      = @runhelpdir@
+runhelp         = @runhelp@
 
 # compilation
 CC              = @CC@
diff --git a/Doc/Makefile.in b/Doc/Makefile.in
index eae3301..50e210f 100644
--- a/Doc/Makefile.in
+++ b/Doc/Makefile.in
@@ -83,7 +83,7 @@ Zsh/seealso.yo Zsh/tcpsys.yo Zsh/zftpsys.yo Zsh/zle.yo
 
 # ========== DEPENDENCIES FOR BUILDING ==========
 
-all: man runhelp texi ../META-FAQ
+all: man $(runhelp) texi ../META-FAQ
 .PHONY: all
 
 everything: all dvi html pdf info
@@ -184,13 +184,14 @@ $(sdir)/zsh.texi: $(YODLSRC)
 man: $(MAN)
 .PHONY: man
 
-runhelp: man
-	test x"$(runhelpdir)" = x"" || { \
-	    test -r $(sdir)/help.txt && test -r $(sdir)/help/ztcp; \
-	} || perl $(sdir_top)/Util/helpfiles \
+runhelp: help.txt
+.PHONY: runhelp
+
+help.txt: zshbuiltins.1
+	@-rm -f $(sdir)/help.txt $(sdir)/help/*
+	perl $(sdir_top)/Util/helpfiles \
 	    $(sdir)/zshbuiltins.1 $(sdir)/help $(sdir)/help.txt \
 	    || { rm -f $(sdir)/help.txt $(sdir)/help/*; false; }
-.PHONY: runhelp
 
 $(MAN): zmacros.yo zman.yo
 
@@ -312,7 +313,7 @@ install.man: man
 .PHONY: install.man
 
 # install runhelp pages, creating install directory if necessary
-install.runhelp: runhelp
+install.runhelp: $(runhelp)
 	if test x"$(runhelpdir)" != x""; then \
 	    ${SHELL} $(sdir_top)/mkinstalldirs $(DESTDIR)$(runhelpdir); \
 	    $(INSTALL_DATA) $(sdir)/help/* $(DESTDIR)$(runhelpdir); \
diff --git a/configure.ac b/configure.ac
index 607c612..5ca364b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -268,6 +268,9 @@ else
 fi], [runhelpdir=yes])
 if test x"$runhelpdir" = xyes; then
   runhelpdir=${datadir}/${tzsh_name}/'${VERSION}'/help
+  runhelp=runhelp
+else
+  runhelp=
 fi
 
 ifdef([fndir],[undefine([fndir])])dnl
@@ -310,6 +313,7 @@ else
 fi], [additionalfpath=""])
 
 AC_SUBST(runhelpdir)dnl
+AC_SUBST(runhelp)dnl
 AC_SUBST(additionalfpath)dnl
 AC_SUBST(fndir)dnl
 AC_SUBST(sitefndir)dnl



Messages sorted by: Reverse Date, Date, Thread, Author