From 0881560e77d9d9f545eeaeeec730739dcece7c2f Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 12 May 2021 15:35:01 -0500 Subject: [PATCH] doc: Look in $srcdir for documentation sources In several places, we look for documentation source files in e.g. 'doc/man-pages', 'doc/xml', etc. But if we are running an objdir build, those directories won't exist relative to the current working directory; we need to look in $srcdir to find them. So, if we're running an objdir build, our man pages and other documentation won't be installed. We don't report any error in this case (the relevant steps are just skipped), since building the documentation is optional, in case the doc sources are not present. To fix this, look in $srcdir in the various places that reference doc source files. Fixing the 'for' loops in the 'dest' and 'install' targets in doc/man-pages requires some extra cd'ing around, because $M is used as part of another path in the body of the loop. Change-Id: Ic3c90ab5e64aeefe6235efb6f6ec26080d7b3a70 Reviewed-on: https://gerrit.openafs.org/14622 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- configure.ac | 14 +++++++------- doc/man-pages/Makefile.in | 12 ++++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 4a3a795..b7bbf50 100644 --- a/configure.ac +++ b/configure.ac @@ -25,25 +25,25 @@ OPENAFS_GSS dnl Checks for summary OPENAFS_SUMMARY_CHECK_NAMEI -AS_IF([test -d 'doc/man-pages'], +AS_IF([test -d "$srcdir/doc/man-pages"], [MAN_MAKEFILE="doc/man-pages/Makefile doc/man-pages/install-man"], [MAN_MAKEFILE=]) -AS_IF([test -f 'doc/xml/AdminGuide/Makefile.in'], +AS_IF([test -f "$srcdir/doc/xml/AdminGuide/Makefile.in"], [ADMINGUIDE_MAKEFILE="doc/xml/AdminGuide/Makefile"], [ADMINGUIDE_MAKEFILE=]) -AS_IF([test -f 'doc/xml/QuickStartUnix/Makefile.in'], +AS_IF([test -f "$srcdir/doc/xml/QuickStartUnix/Makefile.in"], [QSUNIX_MAKEFILE="doc/xml/QuickStartUnix/Makefile"], [QSUNIX_MAKEFILE=]) -AS_IF([test -f 'doc/xml/UserGuide/Makefile.in'], +AS_IF([test -f "$srcdir/doc/xml/UserGuide/Makefile.in"], [USERGUIDE_MAKEFILE="doc/xml/UserGuide/Makefile"], [USERGUIDE_MAKEFILE=]) -AS_IF([test -f 'doc/xml/AdminRef/Makefile.in'], +AS_IF([test -f "$srcdir/doc/xml/AdminRef/Makefile.in"], [ADMINREF_MAKEFILE="doc/xml/AdminRef/Makefile"], [ADMINREF_MAKEFILE=]) -AS_IF([test -f 'doc/xml/mobi-fixup.xsl.in'], +AS_IF([test -f "$srcdir/doc/xml/mobi-fixup.xsl.in"], [MOBI_FIXUP_XSL="doc/xml/mobi-fixup.xsl"], [MOBI_FIXUP_XSL=]) -AS_IF([test -f 'doc/doxygen/Doxyfile.in'], +AS_IF([test -f "$srcdir/doc/doxygen/Doxyfile.in"], [DOXYFILE="doc/doxygen/Doxyfile"], [DOXYFILE=]) diff --git a/doc/man-pages/Makefile.in b/doc/man-pages/Makefile.in index 882dd48..0b66642 100644 --- a/doc/man-pages/Makefile.in +++ b/doc/man-pages/Makefile.in @@ -43,9 +43,11 @@ dest: prep-noinstall chmod +x install-man mkdir -p $(DEST)/man/man1 $(DEST)/man/man3 \ $(DEST)/man/man5 $(DEST)/man/man8 - set -e; for M in man1/*.1 man3/*.3 man5/*.5 man8/*.8 ; do \ + set -e; orig_pwd=`pwd` ; cd $(srcdir) ; \ + for M in man1/*.1 man3/*.3 man5/*.5 man8/*.8 ; do \ + cd $$orig_pwd ; \ if ! [ -e $$M.noinstall ] ; then \ - ./install-man $$M $(DEST)/man/$$M ; \ + ./install-man $(srcdir)/$$M $(DEST)/man/$$M ; \ fi ; \ done set -e; for M in ${LINKEDPAGES}; do \ @@ -69,9 +71,11 @@ install: prep-noinstall $(MAN1) $(MAN8) chmod +x install-man mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man3 \ $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man8 - set -e; for M in man1/*.1 man3/*.3 man5/*.5 man8/*.8 ; do \ + set -e; orig_pwd=`pwd` ; cd $(srcdir) ; \ + for M in man1/*.1 man3/*.3 man5/*.5 man8/*.8 ; do \ + cd $$orig_pwd ; \ if ! [ -e $$M.noinstall ] ; then \ - ./install-man $$M $(DESTDIR)$(mandir)/$$M ; \ + ./install-man $(srcdir)/$$M $(DESTDIR)$(mandir)/$$M ; \ fi; \ done set -e; for M in ${LINKEDPAGES}; do \ -- 1.9.4