[gnutls-devel] [PATCH V2 4/4] Fix build failures involving doc/invoke-*.texi

Kevin Cernekee cernekee at gmail.com
Sat Mar 8 05:38:30 CET 2014


Several problems were found in this area:

1) Currently, if SRC_DEF_* are undefined, autogen will get invoked with
no input file and it will hang forever waiting for content from stdin:

    mv -f enums.texi-tmp enums.texi
    mkdir enums
    ../../doc/scripts/split-texi.pl enums enum < enums.texi
    echo stamp_enums > stamp_enums
    cd ../src/ && autogen -Tagtexi-cmd.tpl  && \
        rm -f ../doc/invoke-gnutls-cli.texi && \
        ../doc/scripts/cleanup-autogen.pl <../src/invoke-gnutls-cli.texi >../doc/invoke-gnutls-cli.texi.tmp && \
        mv -f ../doc/invoke-gnutls-cli.texi.tmp ../doc/invoke-gnutls-cli.texi && \
        rm -f ../src/invoke-gnutls-cli.texi
    <HANG>

Since these documents are @include'd by other documents, it is probably
a good idea to make sure the targets are buildable in case they get
listed as prerequisites.

2) SRC_DEF_* used relative paths which are correct for an in-place build,
but incorrect for an out-of-tree build.  They should use something like
$(top_srcdir)/src to resolve the ambiguity.

3) cleanup-autogen.pl was also referenced using a relative pathname,
breaking out-of-tree builds.

4) The non-portable "sed -i" flag was used.

Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 .gitignore      |  12 +---
 doc/Makefile.am | 207 +++++++++++++++++++++++++++-----------------------------
 2 files changed, 102 insertions(+), 117 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6b50937..6b2615a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -689,16 +689,8 @@ src/gl/warn-on-use.h
 doc/stamp_invoke
 src/gl/libgnu_gpl.a
 src/gl/libgnu_gpl.la
-doc/invoke-certtool.texi
-doc/invoke-danetool.texi
-doc/invoke-gnutls-cli-debug.texi
-doc/invoke-gnutls-cli.texi
-doc/invoke-gnutls-serv.texi
-doc/invoke-ocsptool.texi
-doc/invoke-p11tool.texi
-doc/invoke-psktool.texi
-doc/invoke-srptool.texi
-doc/invoke-tpmtool.texi
+doc/invoke-*.texi
+doc/invoke-*.menu
 doc/parse-datetime.texi
 tests/fips-test
 tests/global-init
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 7c33cfa..73fe681 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -31,113 +31,106 @@ endif
 
 -include $(top_srcdir)/doc/doc.mk
 
-
-SRC_DEF_CLI = 
-SRC_DEF_CLI_DEBUG = 
-SRC_DEF_SERV = 
-SRC_DEF_CERTTOOL = 
-SRC_DEF_OCSPTOOL = 
-SRC_DEF_DANETOOL = 
-SRC_DEF_SRPTOOL = 
-SRC_DEF_PSKTOOL = 
-SRC_DEF_P11TOOL = 
-SRC_DEF_TPMTOOL = 
-if WANT_TEST_SUITE
-SRC_DEF_CLI += ../src/cli-args.def
-SRC_DEF_CLI_DEBUG += ../src/cli-debug-args.def
-SRC_DEF_SERV += ../src/serv-args.def
-SRC_DEF_CERTTOOL += ../src/certtool-args.def
-SRC_DEF_OCSPTOOL += ../src/ocsptool-args.def
-SRC_DEF_DANETOOL += ../src/danetool-args.def
-SRC_DEF_SRPTOOL += ../src/srptool-args.def
-SRC_DEF_PSKTOOL += ../src/psk-args.def
-SRC_DEF_P11TOOL += ../src/p11tool-args.def
-SRC_DEF_TPMTOOL += ../src/tpmtool-args.def
-endif
-
-invoke-gnutls-cli.texi: $(SRC_DEF_CLI)
-	-cd ../src/ && $(AUTOGEN) -Tagtexi-cmd.tpl $< && \
-	rm -f ../doc/$@ && \
-	../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
-	mv -f ../doc/$@.tmp ../doc/$@ && \
-	rm -f ../src/$@
-
-invoke-gnutls-cli-debug.texi: $(SRC_DEF_CLI_DEBUG) invoke-gnutls-cli.texi
-	-cd ../src/ && $(AUTOGEN) -Tagtexi-cmd.tpl $< && \
-	rm -f ../doc/$@ && \
-	../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
-	mv -f ../doc/$@.tmp ../doc/$@ && \
-	rm -f ../src/$@
-
-invoke-gnutls-serv.texi: $(SRC_DEF_SERV) invoke-gnutls-cli-debug.texi
-	-cd ../src/ && $(AUTOGEN) -Tagtexi-cmd.tpl $< && \
-	rm -f ../doc/$@ && \
-	../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
-	mv -f ../doc/$@.tmp ../doc/$@ && \
-	rm -f ../src/$@
-
-invoke-certtool.texi: $(SRC_DEF_CERTTOOL) invoke-gnutls-serv.texi
-	-cd ../src/ && $(AUTOGEN) -Tagtexi-cmd.tpl $< && \
-	rm -f ../doc/$@ && \
-	../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
-	mv -f ../doc/$@.tmp ../doc/$@ && \
-	rm -f ../src/$@ && \
-	sed -i 's/@subheading/@subsubheading/g' ../doc/$@ && \
-	sed -i 's/@section/@subsection/g' ../doc/$@
-
-invoke-ocsptool.texi: $(SRC_DEF_OCSPTOOL) invoke-certtool.texi
-	-cd ../src/ && $(AUTOGEN) -Tagtexi-cmd.tpl $< && \
-	rm -f ../doc/$@ && \
-	../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
-	mv -f ../doc/$@.tmp ../doc/$@ && \
-	rm -f ../src/$@ && \
-	sed -i 's/@subheading/@subsubheading/g' ../doc/$@ && \
-	sed -i 's/@section/@subsection/g' ../doc/$@
-
-invoke-danetool.texi: $(SRC_DEF_DANETOOL) invoke-ocsptool.texi
-	-cd ../src/ && $(AUTOGEN) -Tagtexi-cmd.tpl $< && \
-	rm -f ../doc/$@ && \
-	../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
-	mv -f ../doc/$@.tmp ../doc/$@ && \
-	rm -f ../src/$@ && \
-	sed -i 's/@subheading/@subsubheading/g' ../doc/$@ && \
-	sed -i 's/@section/@subsection/g' ../doc/$@
-
-invoke-srptool.texi: $(SRC_DEF_SRPTOOL) invoke-danetool.texi
-	-cd ../src/ && $(AUTOGEN) -Tagtexi-cmd.tpl $< && \
-	rm -f ../doc/$@ && \
-	../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
-	mv -f ../doc/$@.tmp ../doc/$@ && \
-	rm -f ../src/$@ && \
-	sed -i 's/@subheading/@subsubheading/g' ../doc/$@ && \
-	sed -i 's/@section/@subsubsection/g' ../doc/$@
-
-invoke-psktool.texi: $(SRC_DEF_PSKTOOL) invoke-srptool.texi
-	-cd ../src/ && $(AUTOGEN) -Tagtexi-cmd.tpl $< && \
-	rm -f ../doc/$@ && \
-	../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
-	mv -f ../doc/$@.tmp ../doc/$@ && \
-	rm -f ../src/$@ && \
-	sed -i 's/@subheading/@subsubheading/g' ../doc/$@ && \
-	sed -i 's/@section/@subsubsection/g' ../doc/$@
-
-invoke-p11tool.texi: $(SRC_DEF_P11TOOL) invoke-psktool.texi
-	-cd ../src/ && $(AUTOGEN) -Tagtexi-cmd.tpl $< && \
-	rm -f ../doc/$@ && \
-	../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
-	mv -f ../doc/$@.tmp ../doc/$@ && \
-	rm -f ../src/$@ && \
-	sed -i 's/@subheading/@subsubheading/g' ../doc/$@ && \
-	sed -i 's/@section/@subsection/g' ../doc/$@
-
-invoke-tpmtool.texi: $(SRC_DEF_TPMTOOL) invoke-p11tool.texi
-	-cd ../src/ && $(AUTOGEN) -Tagtexi-cmd.tpl $< && \
-	rm -f ../doc/$@ && \
-	../doc/scripts/cleanup-autogen.pl <../src/$@ >../doc/$@.tmp && \
-	mv -f ../doc/$@.tmp ../doc/$@ && \
-	rm -f ../src/$@ && \
-	sed -i 's/@subheading/@subsubheading/g' ../doc/$@ && \
-	sed -i 's/@section/@subsection/g' ../doc/$@
+invoke-gnutls-cli.texi: $(top_srcdir)/src/cli-args.def
+	$(AUTOGEN) -Tagtexi-cmd.tpl $<; \
+	if [ ! -e $@ ]; then \
+		cp $(srcdir)/$@ .; \
+	fi; \
+	$(srcdir)/scripts/cleanup-autogen.pl < $@ > $@.tmp && \
+	mv -f $@.tmp $@
+
+invoke-gnutls-cli-debug.texi: $(top_srcdir)/src/cli-debug-args.def invoke-gnutls-cli.texi
+	$(AUTOGEN) -Tagtexi-cmd.tpl $<; \
+	if [ ! -e $@ ]; then \
+		cp $(srcdir)/$@ .; \
+	fi; \
+	$(srcdir)/scripts/cleanup-autogen.pl < $@ > $@.tmp && \
+	mv -f $@.tmp $@
+
+invoke-gnutls-serv.texi: $(top_srcdir)/src/serv-args.def invoke-gnutls-cli-debug.texi
+	$(AUTOGEN) -Tagtexi-cmd.tpl $<; \
+	if [ ! -e $@ ]; then \
+		cp $(srcdir)/$@ .; \
+	fi; \
+	$(srcdir)/scripts/cleanup-autogen.pl < $@ > $@.tmp && \
+	mv -f $@.tmp $@
+
+invoke-certtool.texi: $(top_srcdir)/src/certtool-args.def invoke-gnutls-serv.texi
+	$(AUTOGEN) -Tagtexi-cmd.tpl $<; \
+	if [ ! -e $@ ]; then \
+		cp $(srcdir)/$@ .; \
+	fi; \
+	$(srcdir)/scripts/cleanup-autogen.pl < $@ > $@.tmp && \
+	rm -f $@ && \
+	sed -e 's/@subheading/@subsubheading/g' \
+	    -e 's/@section/@subsection/g' $@.tmp > $@ && \
+	rm -f $@.tmp
+
+invoke-ocsptool.texi: $(top_srcdir)/src/ocsptool-args.def invoke-certtool.texi
+	$(AUTOGEN) -Tagtexi-cmd.tpl $<; \
+	if [ ! -e $@ ]; then \
+		cp $(srcdir)/$@ .; \
+	fi; \
+	$(srcdir)/scripts/cleanup-autogen.pl < $@ > $@.tmp && \
+	rm -f $@ && \
+	sed -e 's/@subheading/@subsubheading/g' \
+	    -e 's/@section/@subsection/g' $@.tmp > $@ && \
+	rm -f $@.tmp
+
+invoke-danetool.texi: $(top_srcdir)/src/danetool-args.def invoke-ocsptool.texi
+	$(AUTOGEN) -Tagtexi-cmd.tpl $<; \
+	if [ ! -e $@ ]; then \
+		cp $(srcdir)/$@ .; \
+	fi; \
+	$(srcdir)/scripts/cleanup-autogen.pl < $@ > $@.tmp && \
+	rm -f $@ && \
+	sed -e 's/@subheading/@subsubheading/g' \
+	    -e 's/@section/@subsection/g' $@.tmp > $@ && \
+	rm -f $@.tmp
+
+invoke-srptool.texi: $(top_srcdir)/src/srptool-args.def invoke-danetool.texi
+	$(AUTOGEN) -Tagtexi-cmd.tpl $<; \
+	if [ ! -e $@ ]; then \
+		cp $(srcdir)/$@ .; \
+	fi; \
+	$(srcdir)/scripts/cleanup-autogen.pl < $@ > $@.tmp && \
+	rm -f $@ && \
+	sed -e 's/@subheading/@subsubheading/g' \
+	    -e 's/@section/@subsubsection/g' $@.tmp > $@ && \
+	rm -f $@.tmp
+
+invoke-psktool.texi: $(top_srcdir)/src/psktool-args.def invoke-srptool.texi
+	$(AUTOGEN) -Tagtexi-cmd.tpl $<; \
+	if [ ! -e $@ ]; then \
+		cp $(srcdir)/$@ .; \
+	fi; \
+	$(srcdir)/scripts/cleanup-autogen.pl < $@ > $@.tmp && \
+	rm -f $@ && \
+	sed -e 's/@subheading/@subsubheading/g' \
+	    -e 's/@section/@subsubsection/g' $@.tmp > $@ && \
+	rm -f $@.tmp
+
+invoke-p11tool.texi: $(top_srcdir)/src/p11tool-args.def invoke-psktool.texi
+	$(AUTOGEN) -Tagtexi-cmd.tpl $<; \
+	if [ ! -e $@ ]; then \
+		cp $(srcdir)/$@ .; \
+	fi; \
+	$(srcdir)/scripts/cleanup-autogen.pl < $@ > $@.tmp && \
+	rm -f $@ && \
+	sed -e 's/@subheading/@subsubheading/g' \
+	    -e 's/@section/@subsection/g' $@.tmp > $@ && \
+	rm -f $@.tmp
+
+invoke-tpmtool.texi: $(top_srcdir)/src/tpmtool-args.def invoke-p11tool.texi
+	$(AUTOGEN) -Tagtexi-cmd.tpl $<; \
+	if [ ! -e $@ ]; then \
+		cp $(srcdir)/$@ .; \
+	fi; \
+	$(srcdir)/scripts/cleanup-autogen.pl < $@ > $@.tmp && \
+	rm -f $@ && \
+	sed -e 's/@subheading/@subsubheading/g' \
+	    -e 's/@section/@subsection/g' $@.tmp > $@ && \
+	rm -f $@.tmp
 
 info_TEXINFOS = gnutls.texi gnutls-guile.texi
 gnutls_TEXINFOS = gnutls.texi fdl-1.3.texi				\
-- 
1.8.3.2




More information about the Gnutls-devel mailing list