From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050:0:465::202]) by sourceware.org (Postfix) with ESMTPS id 0F83A3858CDA for ; Sat, 11 Mar 2023 20:33:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0F83A3858CDA Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=aarsen.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aarsen.me Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4PYvkL5VDCz9sW1; Sat, 11 Mar 2023 21:32:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1678566778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s41074Pj+zX9+LBh9cITasdcLjFGO80KyPZZF9oDI2k=; b=ASCv19w9/znj8o6sqaJl1Jh+Ftn2WLkVRWYxR+uP5hfJa/q3lDB2Lc+9FJlUsTKEYT7oOK ax1hua8SfKJNdhKZCuMpAt3FpOwqgMwgDX+kR35kTnv/fF6sdkKdpD7SoYfMYq1b5LyTa1 Oo/i9dkEMoPh0vbJO51zOv32uF9B0X5T4CfPerzQqjI7hMcaAhzJdKrBZLY202aM42iRbU Kuufkl5v+q+XfxbspRrzvnmlGA0tFd8+GV4fV+bwsADRnE1pMsdIYRYMDuMzR25ot8+wll jD4yasD++kXkHtssL6iKTLCmCeQBCl91LbJCBftCULB96eQpkjWUx8CSvcSmew== From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= To: arsen@aarsen.me Cc: gcc-patches@gcc.gnu.org, gerald@pfeifer.com, joseph@codesourcery.com, sandra.loosemore@siemens.com, sandra@codesourcery.com Subject: [PATCH v2] html: Set CONTENTS_OUTPUT_LOCATION=inline if makeinfo supports it Date: Sat, 11 Mar 2023 21:32:34 +0100 Message-Id: <20230311203234.2257423-1-arsen@aarsen.me> In-Reply-To: <868rg3xclp.fsf@aarsen.me> References: <868rg3xclp.fsf@aarsen.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_INFOUSMEBIZ,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This flag allows us to restore old (pre-6.8) behavior of the @{summary,}content commands, so that texi2any continues to emit summarycontents first. maintainer-scripts/ChangeLog: * update_web_docs_git: Set CONTENTS_OUTPUT_LOCATION=inline in order to put @shortcontents above contents. gcc/ChangeLog: * configure.ac: Add check for the Texinfo 6.8 CONTENTS_OUTPUT_LOCATION customization variable and set it if supported. * configure: Regenerate. * Makefile.in (MAKEINFO_TOC_INLINE_FLAG): New variable. Set by configure.ac to -c CONTENTS_OUTPUT_LOCATION=inline if CONTENTS_OUTPUT_LOCATION support is detected, empty otherwise. ($(build_htmldir)/%/index.html): Pass MAKEINFO_TOC_INLINE_FLAG. --- Here's an updated version of that patch, for review. I'm sending it separately and properly to not accidentally alienate potential reviewers. gcc/Makefile.in | 6 ++++- gcc/configure | 35 ++++++++++++++++++++++++-- gcc/configure.ac | 21 ++++++++++++++++ maintainer-scripts/update_web_docs_git | 2 +- 4 files changed, 60 insertions(+), 4 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 6001c9e3b55..d8b76d83d68 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -787,6 +787,9 @@ INSTALL_HEADERS=install-headers install-mkheaders # Control whether Info documentation is built and installed. BUILD_INFO = @BUILD_INFO@ +# Control flags for @contents placement in HTML output +MAKEINFO_TOC_INLINE_FLAG = @MAKEINFO_TOC_INLINE_FLAG@ + # Control whether manpages generated by texi2pod.pl can be rebuilt. GENERATED_MANPAGES = @GENERATED_MANPAGES@ @@ -3461,7 +3464,8 @@ html:: $(HTMLS_BUILD) $(build_htmldir)/%/index.html: %.texi $(mkinstalldirs) $(@D) rm -f $(@D)/* - $(TEXI2HTML) -I $(abs_docdir) -I $(abs_docdir)/include -o $(@D) $< + $(TEXI2HTML) $(MAKEINFO_TOC_INLINE_FLAG) \ + -I $(abs_docdir) -I $(abs_docdir)/include -o $(@D) $< # Duplicate entry to handle renaming of gccinstall $(build_htmldir)/gccinstall/index.html: $(TEXI_GCCINSTALL_FILES) diff --git a/gcc/configure.ac b/gcc/configure.ac index 62bc908b991..120151c474a 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1242,6 +1242,27 @@ else fi AC_SUBST(BUILD_INFO) +# Determine whether makeinfo supports the CONTENTS_OUTPUT_LOCATION variable. +# If it does, we want to pass it to makeinfo in order to restore the old +# behavior of @{summary,}contents placement. +MAKEINFO_TOC_INLINE_FLAG= +AS_IF([test x"$MAKEINFO" != x], [ + AC_CACHE_CHECK([for CONTENTS_OUTPUT_LOCATION support in $MAKEINFO], + [gcc_cv_texi_add_toc_inline_flags], [ + # Detect the unknown variable CONTENTS_OUTPUT_LOCATION warning + if "$MAKEINFO" -c CONTENTS_OUTPUT_LOCATION=inline &1 \ + | grep CONTENTS_OUTPUT_LOCATION >/dev/null; then + gcc_cv_texi_add_toc_inline_flags=no + else + gcc_cv_texi_add_toc_inline_flags=yes + fi + ]) + if test x"$gcc_cv_texi_add_toc_inline_flags" = xyes; then + MAKEINFO_TOC_INLINE_FLAG='-c CONTENTS_OUTPUT_LOCATION=inline' + fi +]) +AC_SUBST([MAKEINFO_TOC_INLINE_FLAG]) + # Is pod2man recent enough to regenerate manpages? AC_MSG_CHECKING([for recent Pod::Man]) if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then diff --git a/maintainer-scripts/update_web_docs_git b/maintainer-scripts/update_web_docs_git index 9ded1744df4..c9f14d1a4d1 100755 --- a/maintainer-scripts/update_web_docs_git +++ b/maintainer-scripts/update_web_docs_git @@ -169,7 +169,7 @@ for file in $MANUALS; do if [ "$file" = "gnat_ugn" ]; then includes="$includes -I gcc/gcc/ada -I gcc/gcc/ada/doc/gnat_ugn" fi - makeinfo --html --css-ref $CSS $includes -o ${file} ${filename} + makeinfo --html -c CONTENTS_OUTPUT_LOCATION=inline --css-ref $CSS $includes -o ${file} ${filename} tar cf ${file}-html.tar ${file}/*.html texi2dvi $includes -o ${file}.dvi ${filename} /dev/null && dvips -o ${file}.ps ${file}.dvi texi2pdf $includes -o ${file}.pdf ${filename}